Skip to content

Commit e52946a

Browse files
antoniospnetorvalyi
authored andcommitted
[MIG] l10n_br_delivery: Migration to 16.0
1 parent 870d1a8 commit e52946a

File tree

7 files changed

+34
-26
lines changed

7 files changed

+34
-26
lines changed

l10n_br_delivery/__manifest__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"author": "Akretion, Odoo Community Association (OCA)",
88
"maintainers": ["renatonlima", "mbcosta"],
99
"website": "https://github.com/OCA/l10n-brazil",
10-
"version": "15.0.1.0.0",
10+
"version": "16.0.1.0.0",
1111
"development_status": "Beta",
1212
"depends": [
1313
"l10n_br_sale_stock",

l10n_br_delivery/demo/l10n_br_delivery_demo.xml

+12-21
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
<field name="fixed_price">10.0</field>
6868
<field name="sequence">3</field>
6969
<field name="delivery_type">fixed</field>
70-
<field name="product_id" ref="delivery.product_product_delivery_normal" />
70+
<field name="product_id" ref="delivery.product_product_local_delivery" />
7171
<field name="partner_id" ref="test_carrier" />
7272
<field name="antt_code">Teste - Código ANTT</field>
7373
<field
@@ -78,35 +78,26 @@
7878
/>
7979
</record>
8080

81-
<!-- Resource: stock.inventory -->
81+
<!-- Resource: stock.quant -->
8282

83-
<record id="l10n_br_delivery_stock_inventory_0" model="stock.inventory">
84-
<field name="name">Starting Inventory - l10n_br_delivery</field>
85-
<field name="state">confirm</field>
86-
</record>
87-
88-
<!-- Resource: stock.inventory.line -->
89-
90-
<record id="l10n_br_delivery_stock_inventory_line_1" model="stock.inventory.line">
83+
<record id="l10n_br_delivery_stock_quant_1" model="stock.quant">
9184
<field name="product_id" ref="product.product_delivery_01" />
92-
<field name="product_uom_id" ref="uom.product_uom_unit" />
93-
<field name="inventory_id" ref="l10n_br_delivery_stock_inventory_0" />
94-
<field name="product_qty">100</field>
85+
<field name="inventory_quantity">100</field>
9586
<field name="location_id" ref="stock.stock_location_stock" />
9687
</record>
9788

98-
<record id="l10n_br_delivery_stock_inventory_line_2" model="stock.inventory.line">
89+
<record id="l10n_br_delivery_stock_quant_2" model="stock.quant">
9990
<field name="product_id" ref="product.product_delivery_02" />
100-
<field name="product_uom_id" ref="uom.product_uom_unit" />
101-
<field name="inventory_id" ref="l10n_br_delivery_stock_inventory_0" />
102-
<field name="product_qty">100</field>
91+
<field name="inventory_quantity">100</field>
10392
<field name="location_id" ref="stock.stock_location_stock" />
10493
</record>
10594

106-
<function model="stock.inventory" name="action_validate">
107-
<function
108-
eval="[[('state','=','draft'),('id', '=', ref('l10n_br_delivery_stock_inventory_0'))]]"
109-
model="stock.inventory"
95+
<function model="stock.quant" name="action_apply_inventory">
96+
<function
97+
eval="[[('id', 'in', (ref('l10n_br_delivery_stock_quant_1'),
98+
ref('l10n_br_delivery_stock_quant_2'),
99+
))]]"
100+
model="stock.quant"
110101
name="search"
111102
/>
112103
</function>

l10n_br_delivery/models/vehicle.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,15 @@ class CarrierVehicle(models.Model):
88
_name = "l10n_br_delivery.carrier.vehicle"
99
_description = "Carrier Vehicle"
1010

11-
name = fields.Char(required=True, size=32)
11+
name = fields.Char(
12+
required=True,
13+
size=32,
14+
unaccent=False,
15+
)
1216

1317
description = fields.Char(
1418
size=132,
19+
unaccent=False,
1520
)
1621

1722
plate = fields.Char(
@@ -21,6 +26,7 @@ class CarrierVehicle(models.Model):
2126

2227
driver = fields.Char(
2328
size=64,
29+
unaccent=False,
2430
)
2531

2632
rntc_code = fields.Char(

l10n_br_delivery/tests/test_delivery_inverse_amount.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,11 @@ def test_sale_order_total_amounts(self):
110110
110.0,
111111
"Unexpected value for the field amount_price_gross from Sale Order",
112112
)
113+
# No amount_untaxed é esperado o valor total dos produtos + frete, seguro
114+
# e outros.
113115
self.assertEqual(
114116
self.sale_order_total_id.amount_untaxed,
115-
110.0,
117+
410.0,
116118
"Unexpected value for the field amount_untaxed from Sale Order",
117119
)
118120
self.assertEqual(
@@ -143,9 +145,11 @@ def test_sale_order_line_amounts(self):
143145
110.0,
144146
"Unexpected value for the field amount_price_gross from Sale Order",
145147
)
148+
# No amount_untaxed é esperado o valor total dos produtos + frete, seguro
149+
# e outros.
146150
self.assertEqual(
147151
self.sale_order_line_id.amount_untaxed,
148-
110.0,
152+
410.0,
149153
"Unexpected value for the field amount_untaxed from Sale Order",
150154
)
151155
self.assertEqual(

l10n_br_delivery/views/l10n_br_delivery_view.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
<menuitem
5959
name="Vehicle"
6060
id="menu_l10n_br_delivery_carrier_vehicle_form"
61-
parent="delivery.menu_delivery"
61+
parent="stock.menu_delivery"
6262
action="action_l10n_br_delivery_carrier_vehicle_form"
6363
sequence="10"
6464
/>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../l10n_br_delivery

setup/l10n_br_delivery/setup.py

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import setuptools
2+
3+
setuptools.setup(
4+
setup_requires=['setuptools-odoo'],
5+
odoo_addon=True,
6+
)

0 commit comments

Comments
 (0)