[IMP] nfu_sale_order_batch: always adjust max_qty to be at least uom_qty
This commit is contained in:
parent
a1487b4fcf
commit
8c8091b4fd
4 changed files with 15 additions and 1 deletions
|
|
@ -46,6 +46,7 @@ Changelog
|
||||||
- on creation set max_qty to product_uom_qty if not set
|
- on creation set max_qty to product_uom_qty if not set
|
||||||
- remove zero exception for max_qty
|
- remove zero exception for max_qty
|
||||||
- store open_packaging_qty on batch product module to make it sortable
|
- store open_packaging_qty on batch product module to make it sortable
|
||||||
|
- always adjust max_qty to be at least uom_qty except you only set max qty
|
||||||
|
|
||||||
Bug Tracker
|
Bug Tracker
|
||||||
===========
|
===========
|
||||||
|
|
|
||||||
|
|
@ -32,3 +32,14 @@ class SaleOrderLine(models.Model):
|
||||||
packaging = self.env["product.packaging"].search([("product_id", "=", product_id)], limit=1)
|
packaging = self.env["product.packaging"].search([("product_id", "=", product_id)], limit=1)
|
||||||
vals["product_packaging_id"] = packaging.id
|
vals["product_packaging_id"] = packaging.id
|
||||||
return super().create(vals_list)
|
return super().create(vals_list)
|
||||||
|
|
||||||
|
def write(self, vals):
|
||||||
|
product_qty = vals.get("product_uom_qty")
|
||||||
|
product_max_qty = vals.get("product_uom_max_qty")
|
||||||
|
if product_qty and product_max_qty and product_qty > product_max_qty:
|
||||||
|
vals["product_uom_max_qty"] = product_qty
|
||||||
|
elif product_qty:
|
||||||
|
for line in self:
|
||||||
|
if product_qty > line.product_uom_max_qty:
|
||||||
|
line["product_uom_max_qty"] = product_qty
|
||||||
|
return super().write(vals)
|
||||||
|
|
|
||||||
|
|
@ -11,3 +11,4 @@
|
||||||
- on creation set max_qty to product_uom_qty if not set
|
- on creation set max_qty to product_uom_qty if not set
|
||||||
- remove zero exception for max_qty
|
- remove zero exception for max_qty
|
||||||
- store open_packaging_qty on batch product module to make it sortable
|
- store open_packaging_qty on batch product module to make it sortable
|
||||||
|
- always adjust max_qty to be at least uom_qty except you only set max qty
|
||||||
|
|
@ -422,6 +422,7 @@ and adds a packaging default to sale order batch.</p>
|
||||||
<li>on creation set max_qty to product_uom_qty if not set</li>
|
<li>on creation set max_qty to product_uom_qty if not set</li>
|
||||||
<li>remove zero exception for max_qty</li>
|
<li>remove zero exception for max_qty</li>
|
||||||
<li>store open_packaging_qty on batch product module to make it sortable</li>
|
<li>store open_packaging_qty on batch product module to make it sortable</li>
|
||||||
|
<li>always adjust max_qty to be at least uom_qty except you only set max qty</li>
|
||||||
</ul>
|
</ul>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue