Skip to content

Commit

Permalink
[MIG] l10n_br_delivery: Migration to 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
antoniospneto authored and rvalyi committed Jan 3, 2025
1 parent 7ac2385 commit 34b45b4
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 26 deletions.
2 changes: 1 addition & 1 deletion l10n_br_delivery/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"author": "Akretion, Odoo Community Association (OCA)",
"maintainers": ["renatonlima", "mbcosta"],
"website": "https://github.com/OCA/l10n-brazil",
"version": "15.0.1.0.0",
"version": "16.0.1.0.0",
"development_status": "Beta",
"depends": [
"l10n_br_sale_stock",
Expand Down
33 changes: 12 additions & 21 deletions l10n_br_delivery/demo/l10n_br_delivery_demo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
<field name="fixed_price">10.0</field>
<field name="sequence">3</field>
<field name="delivery_type">fixed</field>
<field name="product_id" ref="delivery.product_product_delivery_normal" />
<field name="product_id" ref="delivery.product_product_local_delivery" />
<field name="partner_id" ref="test_carrier" />
<field name="antt_code">Teste - Código ANTT</field>
<field
Expand All @@ -78,35 +78,26 @@
/>
</record>

<!-- Resource: stock.inventory -->
<!-- Resource: stock.quant -->

<record id="l10n_br_delivery_stock_inventory_0" model="stock.inventory">
<field name="name">Starting Inventory - l10n_br_delivery</field>
<field name="state">confirm</field>
</record>

<!-- Resource: stock.inventory.line -->

<record id="l10n_br_delivery_stock_inventory_line_1" model="stock.inventory.line">
<record id="l10n_br_delivery_stock_quant_1" model="stock.quant">
<field name="product_id" ref="product.product_delivery_01" />
<field name="product_uom_id" ref="uom.product_uom_unit" />
<field name="inventory_id" ref="l10n_br_delivery_stock_inventory_0" />
<field name="product_qty">100</field>
<field name="inventory_quantity">100</field>
<field name="location_id" ref="stock.stock_location_stock" />
</record>

<record id="l10n_br_delivery_stock_inventory_line_2" model="stock.inventory.line">
<record id="l10n_br_delivery_stock_quant_2" model="stock.quant">
<field name="product_id" ref="product.product_delivery_02" />
<field name="product_uom_id" ref="uom.product_uom_unit" />
<field name="inventory_id" ref="l10n_br_delivery_stock_inventory_0" />
<field name="product_qty">100</field>
<field name="inventory_quantity">100</field>
<field name="location_id" ref="stock.stock_location_stock" />
</record>

<function model="stock.inventory" name="action_validate">
<function
eval="[[('state','=','draft'),('id', '=', ref('l10n_br_delivery_stock_inventory_0'))]]"
model="stock.inventory"
<function model="stock.quant" name="action_apply_inventory">
<function
eval="[[('id', 'in', (ref('l10n_br_delivery_stock_quant_1'),
ref('l10n_br_delivery_stock_quant_2'),
))]]"
model="stock.quant"
name="search"
/>
</function>
Expand Down
8 changes: 7 additions & 1 deletion l10n_br_delivery/models/vehicle.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,15 @@ class CarrierVehicle(models.Model):
_name = "l10n_br_delivery.carrier.vehicle"
_description = "Carrier Vehicle"

name = fields.Char(required=True, size=32)
name = fields.Char(
required=True,
size=32,
unaccent=False,
)

description = fields.Char(
size=132,
unaccent=False,
)

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

driver = fields.Char(
size=64,
unaccent=False,
)

rntc_code = fields.Char(
Expand Down
9 changes: 7 additions & 2 deletions l10n_br_delivery/tests/test_delivery_inverse_amount.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def setUpClass(cls):

# Alteração para permitir do teste
cls.sale_order_line_id.company_id.delivery_costs = "total"
cls.sale_order_line_id.company_id.sale_create_invoice_policy = "sale_order"
# Change freight, insurance and other costs amount by Total values
with Form(cls.sale_order_total_id) as so:
so.amount_freight_value = 100.0
Expand Down Expand Up @@ -110,9 +111,11 @@ def test_sale_order_total_amounts(self):
110.0,
"Unexpected value for the field amount_price_gross from Sale Order",
)
# No amount_untaxed é esperado o valor total dos produtos + frete, seguro
# e outros.
self.assertEqual(
self.sale_order_total_id.amount_untaxed,
110.0,
410.0,
"Unexpected value for the field amount_untaxed from Sale Order",
)
self.assertEqual(
Expand Down Expand Up @@ -143,9 +146,11 @@ def test_sale_order_line_amounts(self):
110.0,
"Unexpected value for the field amount_price_gross from Sale Order",
)
# No amount_untaxed é esperado o valor total dos produtos + frete, seguro
# e outros.
self.assertEqual(
self.sale_order_line_id.amount_untaxed,
110.0,
410.0,
"Unexpected value for the field amount_untaxed from Sale Order",
)
self.assertEqual(
Expand Down
2 changes: 1 addition & 1 deletion l10n_br_delivery/views/l10n_br_delivery_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<menuitem
name="Vehicle"
id="menu_l10n_br_delivery_carrier_vehicle_form"
parent="delivery.menu_delivery"
parent="stock.menu_delivery"
action="action_l10n_br_delivery_carrier_vehicle_form"
sequence="10"
/>
Expand Down

0 comments on commit 34b45b4

Please sign in to comment.