mirror of
https://github.com/ForgeFlow/stock-rma.git
synced 2025-01-21 12:57:49 +02:00
[IMP] rma: Added serial/lot selection on from stock move wizard on rma groups
- added restriction to approve rma with product tracking on serial, should be only one to receive
This commit is contained in:
committed by
Florian da Costa
parent
3c51940502
commit
f1581f1ba4
@@ -595,7 +595,19 @@ class RmaOrderLine(models.Model):
|
||||
self.reference_move_id = False
|
||||
return True
|
||||
|
||||
def _check_production_lot_assigned(self):
|
||||
for rec in self:
|
||||
if rec.product_id.tracking == "serial" and rec.product_qty != 1:
|
||||
raise ValidationError(
|
||||
_(
|
||||
"Product %s has serial tracking configuration, "
|
||||
"quantity to receive should be 1"
|
||||
)
|
||||
% (rec.product_id.display_name)
|
||||
)
|
||||
|
||||
def action_rma_to_approve(self):
|
||||
self._check_production_lot_assigned()
|
||||
self.write({"state": "to_approve"})
|
||||
for rec in self:
|
||||
if rec.product_id.rma_approval_policy == "one_step":
|
||||
|
||||
Reference in New Issue
Block a user