Skip to content

Commit

Permalink
[MIG] mrp_subcontracting_skip_no_negative: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
david-s73 committed Jan 13, 2025
1 parent 78cb80d commit d923e91
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion mrp_subcontracting_skip_no_negative/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
{
"name": "MRP Subcontracting Skip No Negative",
"version": "16.0.1.0.2",
"version": "17.0.1.0.0",
"license": "AGPL-3",
"author": "Quartile Limited, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/manufacture",
Expand Down
4 changes: 2 additions & 2 deletions mrp_subcontracting_skip_no_negative/models/stock_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ def _action_done(self, cancel_backorder=False):
raise ValidationError(
_(
"You cannot validate this stock operation because the "
"stock level of the component product '{name}' would become "
"negative ({qty}) on the stock location '{location}' and "
"stock level of the component product '{name}' would become"
" negative ({qty}) on the stock location '{location}' and "
"negative stock is not allowed for this product and/or "
"location."
).format(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ def setUpClass(cls):
cls.subcontracting_receipt = picking_form.save()

def _create_stock_quant(self, product, qty):
partner1 = self.subcontractor_partner1
self.env["stock.quant"].create(
{
"product_id": product.id,
"location_id": self.subcontractor_partner1.property_stock_subcontractor.id,
"location_id": partner1.property_stock_subcontractor.id,
"quantity": qty,
}
)
Expand Down Expand Up @@ -78,7 +79,8 @@ def test_mrp_subcontracting_skip_no_negative_03(self):
self.assertEqual(self.subcontracting_receipt.state, "done")

def test_mrp_subcontracting_skip_no_negative_04(self):
self.subcontractor_partner1.property_stock_subcontractor.allow_negative_stock = True
partner1 = self.subcontractor_partner1
partner1.property_stock_subcontractor.allow_negative_stock = True
self.subcontracting_receipt.action_confirm()
self.assertEqual(self.subcontracting_receipt.state, "assigned")
immediate_wizard = self.subcontracting_receipt.sudo().button_validate()
Expand Down

0 comments on commit d923e91

Please sign in to comment.