mirror of
https://github.com/ForgeFlow/stock-rma.git
synced 2025-01-21 12:57:49 +02:00
[14.0][IMP]rma: make operation editable after approved
* remove also validation error when setting the rma to draft where there are done pickings
This commit is contained in:
@@ -219,8 +219,8 @@ class RmaOrderLine(models.Model):
|
|||||||
comodel_name="rma.operation",
|
comodel_name="rma.operation",
|
||||||
required=True,
|
required=True,
|
||||||
string="Operation",
|
string="Operation",
|
||||||
readonly=True,
|
readonly=False,
|
||||||
states={"draft": [("readonly", False)]},
|
tracking=True,
|
||||||
)
|
)
|
||||||
assigned_to = fields.Many2one(
|
assigned_to = fields.Many2one(
|
||||||
comodel_name="res.users",
|
comodel_name="res.users",
|
||||||
@@ -330,8 +330,7 @@ class RmaOrderLine(models.Model):
|
|||||||
required=True,
|
required=True,
|
||||||
string="Receipts Policy",
|
string="Receipts Policy",
|
||||||
default="no",
|
default="no",
|
||||||
readonly=True,
|
readonly=False,
|
||||||
states={"draft": [("readonly", False)]},
|
|
||||||
)
|
)
|
||||||
delivery_policy = fields.Selection(
|
delivery_policy = fields.Selection(
|
||||||
[
|
[
|
||||||
@@ -342,9 +341,8 @@ class RmaOrderLine(models.Model):
|
|||||||
required=True,
|
required=True,
|
||||||
string="Delivery Policy",
|
string="Delivery Policy",
|
||||||
default="no",
|
default="no",
|
||||||
readonly=True,
|
readonly=False,
|
||||||
ondelete="cascade",
|
ondelete="cascade",
|
||||||
states={"draft": [("readonly", False)]},
|
|
||||||
)
|
)
|
||||||
in_route_id = fields.Many2one(
|
in_route_id = fields.Many2one(
|
||||||
"stock.location.route",
|
"stock.location.route",
|
||||||
@@ -584,8 +582,6 @@ class RmaOrderLine(models.Model):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
def action_rma_draft(self):
|
def action_rma_draft(self):
|
||||||
if self.in_shipment_count or self.out_shipment_count:
|
|
||||||
raise UserError(_("You cannot reset to draft a RMA with related pickings."))
|
|
||||||
self.write({"state": "draft"})
|
self.write({"state": "draft"})
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user