Skip to content

Commit

Permalink
[MIG] sale_order_carrier_auto_assign: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lef-adhoc committed Apr 29, 2024
1 parent 74be8c1 commit 27ba25c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion sale_order_carrier_auto_assign/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"name": "Sale Order Carrier Auto Assign",
"summary": "Auto assign delivery carrier on sale order confirmation",
"version": "16.0.1.1.0",
"version": "17.0.1.0.0",
"development_status": "Alpha",
"category": "Operations/Inventory/Delivery",
"website": "https://github.com/OCA/sale-workflow",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def setUpClass(cls):
product = cls.env.ref("product.product_product_9")
cls.delivery_local_delivery = cls.env.ref("delivery.delivery_local_delivery")
cls.delivery_local_delivery.fixed_price = 10
cls.delivery_local_delivery.free_over = False
sale_order_form = Form(cls.env["sale.order"])
sale_order_form.partner_id = cls.partner
with sale_order_form.order_line.new() as line_form:
Expand All @@ -32,7 +33,9 @@ def test_sale_order_carrier_auto_assign(self):
self.sale_order.action_confirm()
self.assertEqual(self.sale_order.state, "sale")
self.assertEqual(self.sale_order.carrier_id, self.delivery_local_delivery)
delivery_line = self.sale_order.order_line.filtered(lambda l: l.is_delivery)
delivery_line = self.sale_order.order_line.filtered(
lambda line: line.is_delivery
)
delivery_rate = self.delivery_local_delivery.rate_shipment(self.sale_order)
self.assertEqual(delivery_line.price_unit, delivery_rate["carrier_price"])

Expand Down
22 changes: 9 additions & 13 deletions sale_order_carrier_auto_assign/views/res_config_settings_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,15 @@
<field name="model">res.config.settings</field>
<field name="inherit_id" ref="sale.res_config_settings_view_form" />
<field name="arch" type="xml">
<xpath expr="//div[@name='shipping_setting_container']" position="inside">
<div class="col-12 col-lg-6 o_setting_box" id="carrier_auto_assign">
<div class="o_setting_left_pane">
<field name="carrier_auto_assign" />
</div>
<div class="o_setting_right_pane">
<label for="carrier_auto_assign" string="Carrier auto assign" />
<div class="text-muted">
Assigns automatically delivery carrier on sale order confirmation.
</div>
</div>
</div>
</xpath>
<block name='sale_shipping_setting_container' position="inside">
<setting
id="carrier_auto_assign"
help="Assigns automatically delivery carrier on sale order confirmation."
company_dependent="1"
>
<field name="carrier_auto_assign" />
</setting>
</block>
</field>
</record>

Expand Down

0 comments on commit 27ba25c

Please sign in to comment.