Skip to content

Commit

Permalink
[MIG] sale_stock_picking_blocking: Migration to 18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
absal-smile committed Jan 31, 2025
1 parent 7bf6de5 commit 21db826
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion sale_stock_picking_blocking/models/sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def _check_not_auto_done(self):
raise ValidationError(
_('You cannot block a sale order with "auto_done_setting" active.')
)

@api.depends("partner_id", "payment_term_id")
def _compute_delivery_block_id(self):
"""Add the 'Default Delivery Block Reason' if set in the partner
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,15 @@ def setUpClass(cls):
prod_dict = {
"name": "test product",
"type": "consu",
"categ_id": cls.env.ref('product.product_category_all').id,
"categ_id": cls.env.ref("product.product_category_all").id,
"list_price": 100.0,
"standard_price": 60.0,
"uom_id": cls.env.ref('uom.product_uom_unit').id,
"uom_po_id": cls.env.ref('uom.product_uom_unit').id,
"uom_id": cls.env.ref("uom.product_uom_unit").id,
"uom_po_id": cls.env.ref("uom.product_uom_unit").id,
}
cls.product = cls.env["product.product"].with_user(cls.user_test).create(prod_dict)
cls.product = (
cls.env["product.product"].with_user(cls.user_test).create(prod_dict)
)
# Create Sale order:
so_dict = {
"partner_id": cls.env.ref("base.res_partner_1").id,
Expand Down Expand Up @@ -129,5 +131,3 @@ def test_default_delivery_block_payment_term(self):
so = so_form.save()
self.assertEqual(so.delivery_block_id, block_reason)
self.assertEqual(so.copy().delivery_block_id, block_reason)
print(self.env.context)

Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<!--License
AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).-->
<odoo>
<record id="sale_stock_picking_blocking_reason_list_view" model="ir.ui.view">
<field name="name">sale.delivery.block.reason.list</field>
<record id="sale_stock_picking_blocking_reason_tree_view" model="ir.ui.view">
<field name="name">sale.delivery.block.reason.view_list</field>
<field name="model">sale.delivery.block.reason</field>
<field name="arch" type="xml">
<list>
Expand Down

0 comments on commit 21db826

Please sign in to comment.