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",
|
||||
required=True,
|
||||
string="Operation",
|
||||
readonly=True,
|
||||
states={"draft": [("readonly", False)]},
|
||||
readonly=False,
|
||||
tracking=True,
|
||||
)
|
||||
assigned_to = fields.Many2one(
|
||||
comodel_name="res.users",
|
||||
@@ -330,8 +330,7 @@ class RmaOrderLine(models.Model):
|
||||
required=True,
|
||||
string="Receipts Policy",
|
||||
default="no",
|
||||
readonly=True,
|
||||
states={"draft": [("readonly", False)]},
|
||||
readonly=False,
|
||||
)
|
||||
delivery_policy = fields.Selection(
|
||||
[
|
||||
@@ -342,9 +341,8 @@ class RmaOrderLine(models.Model):
|
||||
required=True,
|
||||
string="Delivery Policy",
|
||||
default="no",
|
||||
readonly=True,
|
||||
readonly=False,
|
||||
ondelete="cascade",
|
||||
states={"draft": [("readonly", False)]},
|
||||
)
|
||||
in_route_id = fields.Many2one(
|
||||
"stock.location.route",
|
||||
@@ -584,8 +582,6 @@ class RmaOrderLine(models.Model):
|
||||
return True
|
||||
|
||||
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"})
|
||||
return True
|
||||
|
||||
|
||||
Reference in New Issue
Block a user