Skip to content

Commit

Permalink
[MIG] sale_order_line_delivery_state: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bizzappdev committed Oct 9, 2024
1 parent ff0aeb6 commit ce4f543
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion sale_order_line_delivery_state/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
"name": "Sale Order Line Delivery State",
"summary": "Show the delivery state on the sale order line",
"version": "16.0.1.0.0",
"version": "17.0.1.0.0",
"category": "Product",
"website": "https://github.com/OCA/sale-workflow",
"author": "ForgeFlow, Odoo Community Association (OCA)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def setUpClass(cls):
# Base data
partner = cls.env.ref("base.res_partner_2")
product = cls.env.ref("product.product_product_25")
pricelist = cls.env.ref("product.list0")
pricelist = cls.env["product.pricelist"].create({"name": "Test Pricelist"})
cls.uom = cls.env.ref("uom.product_uom_unit")
# Create delivery product
cls.delivery_cost = cls.env["product.product"].create(
Expand Down Expand Up @@ -106,6 +106,12 @@ def test_forced_delivery_cost(self):
self.order.order_line[0].force_delivery_state = True
self.assertEqual(self.order.order_line[0].delivery_state, "done")
self.assertEqual(self.order.order_line[1].delivery_state, "no")
self.order.order_line[0].action_force_delivery_state()
# Assert the delivery state is set to done
self.assertEqual(self.order.order_line[0].delivery_state, "done")
self.order.order_line[0].action_unforce_delivery_state()
# Assert the delivery state is back to partially
self.assertEqual(self.order.order_line[0].delivery_state, "partially")

def test_delivery_done_delivery_cost(self):
self._add_delivery_cost_line()
Expand Down
4 changes: 2 additions & 2 deletions sale_order_line_delivery_state/views/sale_order_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
type="object"
string="Force delivery done"
states="done"
attrs="{'invisible': ['|', ('force_delivery_state', '=', True), ('delivery_state', '=', 'done')]}"
invisible="force_delivery_state or state == 'done'"
/>
<button
name="action_unforce_delivery_state"
type="object"
string="Unforce delivery done"
states="done"
attrs="{'invisible': [('force_delivery_state', '=', False)]}"
invisible="not force_delivery_state"
/>
</div>
</xpath>
Expand Down

0 comments on commit ce4f543

Please sign in to comment.