Skip to content

Commit 23cae1f

Browse files
[MIG] sale_order_secondary_unit: Continue migration to 18.0
TT54291
1 parent 6618bd1 commit 23cae1f

8 files changed

Lines changed: 19 additions & 16 deletions

File tree

sale_order_secondary_unit/README.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ Contributors
8686
- Sergio Teruel
8787
- Ernesto Tejeda
8888
- Pedro M. Baeza
89+
- Pilar Vargas
8990

9091
Maintainers
9192
-----------

sale_order_secondary_unit/models/product_template.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Copyright 2018-2020 Tecnativa - Sergio Teruel
22
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3-
from odoo import _, api, fields, models
3+
from odoo import api, fields, models
44

55

66
class ProductTemplate(models.Model):
@@ -44,8 +44,8 @@ def onchange_sale_secondary_uom_id(self):
4444
if len(self.product_variant_ids.sale_secondary_uom_id) > 1:
4545
return {
4646
"warning": {
47-
"title": _("Warning"),
48-
"message": _(
47+
"title": self.env._("Warning"),
48+
"message": self.env._(
4949
"Product variants have distinct sale secondary uom:"
5050
"\n{secondary_uom}\n"
5151
"All variants will be written with new secondary uom"

sale_order_secondary_unit/readme/CONTRIBUTORS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66
- Sergio Teruel
77
- Ernesto Tejeda
88
- Pedro M. Baeza
9+
- Pilar Vargas

sale_order_secondary_unit/report/sale_report_templates.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
expr="//table[hasclass('o_has_total_table','table','o_main_table')]//th[@name='th_quantity']"
99
position="before"
1010
>
11-
<th name="th_secondary_uom_id" class="text-right" groups="uom.group_uom">
11+
<th name="th_secondary_uom_id" class="text-end" groups="uom.group_uom">
1212
<span>Second. Qty</span>
1313
</th>
1414
</xpath>
1515
<xpath expr="//span[@t-field='line.product_uom_qty']/.." position="before">
16-
<td name="td_secondary_uom_id" class="text-right" groups="uom.group_uom">
16+
<td name="td_secondary_uom_id" class="text-end" groups="uom.group_uom">
1717
<t t-if="line.secondary_uom_id">
1818
<span t-field="line.secondary_uom_qty" />
1919
<span

sale_order_secondary_unit/static/description/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,7 @@ <h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
433433
<li>Sergio Teruel</li>
434434
<li>Ernesto Tejeda</li>
435435
<li>Pedro M. Baeza</li>
436+
<li>Pilar Vargas</li>
436437
</ul>
437438
</li>
438439
</ul>

sale_order_secondary_unit/tests/test_product_template.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Copyright 2018-2020 Tecnativa - Carlos Dauden
22
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
from odoo import Command
34
from odoo.tests import tagged
45

56
from odoo.addons.base.tests.common import BaseCommon
@@ -52,17 +53,13 @@ def setUpClass(cls):
5253
{
5354
"name": "Test Product 2",
5455
"attribute_line_ids": [
55-
(
56-
0,
57-
0,
56+
Command.create(
5857
{
5958
"attribute_id": cls.color_attribute.id,
6059
"value_ids": [(6, 0, cls.color_values.ids)],
6160
},
6261
),
63-
(
64-
0,
65-
0,
62+
Command.create(
6663
{
6764
"attribute_id": cls.size_attribute.id,
6865
"value_ids": [(6, 0, cls.size_values.ids)],

sale_order_secondary_unit/tests/test_sale_order.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Copyright 2018-2020 Tecnativa - Carlos Dauden
22
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
from odoo import Command
34
from odoo.tests import Form, tagged
45

56
from odoo.addons.base.tests.common import BaseCommon
@@ -27,9 +28,7 @@ def setUpClass(cls):
2728
cls.product.product_tmpl_id.write(
2829
{
2930
"secondary_uom_ids": [
30-
(
31-
0,
32-
0,
31+
Command.create(
3332
{
3433
"name": "unit-500",
3534
"uom_id": cls.product_uom_unit.id,

sale_order_secondary_unit/views/product_secondary_unit_views.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
<filter
1818
string="Product Variant"
1919
name="product_id"
20-
context="{'group_by':'product_tmpl_id'}"
20+
context="{'group_by':'product_id'}"
21+
groups="product.group_product_variant"
2122
/>
2223
<filter
2324
string="UoM"
@@ -35,7 +36,10 @@
3536
<field name="arch" type="xml">
3637
<list editable="top" multi_edit="1">
3738
<field name="product_tmpl_id" />
38-
<field name="product_id" />
39+
<field
40+
name="product_id"
41+
domain="[('product_tmpl_id', '=', product_tmpl_id)]"
42+
/>
3943
<field name="code" />
4044
<field name="name" />
4145
<field name="uom_id" />

0 commit comments

Comments
 (0)