[IMP] rma_repair: Add the possibility to indicate a default location

in the rma operation
This commit is contained in:
Jordi Ballester
2022-06-27 11:11:40 +02:00
parent 94380a16b4
commit 0f321f952a
3 changed files with 34 additions and 3 deletions

View File

@@ -19,3 +19,25 @@ class RmaOperation(models.Model):
delivery_policy = fields.Selection(
selection_add=[("repair", "Based on Repair Quantities")]
)
repair_location_id = fields.Many2one(
string="Repair Location",
comodel_name="stock.location",
help="Indicate here the source location of the product to be repaired",
)
repair_location_dest_id = fields.Many2one(
string="Repair Destination Location",
comodel_name="stock.location",
help="Indicate here the destination location of the repair",
)
repair_invoice_method = fields.Selection(
string="Repair Invoice Method",
selection=[
("none", "No Invoice"),
("b4repair", "Before Repair"),
("after_repair", "After Repair"),
],
help="Selecting 'Before Repair' or 'After Repair' will allow you "
"to generate invoice before or after the repair is done "
"respectively. 'No invoice' means you don't want to generate "
"invoice for this repair order.",
)

View File

@@ -17,6 +17,13 @@
<field name="model">rma.operation</field>
<field name="inherit_id" ref="rma.rma_operation_form" />
<field name="arch" type="xml">
<group name="outbound" position="after">
<group name="repair" string="Repair">
<field name="repair_location_id" />
<field name="repair_location_dest_id" />
<field name="repair_invoice_method" />
</group>
</group>
<field name="delivery_policy" position="after">
<field name="repair_type" />
</field>

View File

@@ -32,9 +32,11 @@ class RmaLineMakeRepair(models.TransientModel):
"partner_id": line.partner_id.id,
"to_refurbish": to_refurbish,
"refurbish_product_id": refurbish_product_id,
"location_id": line.location_id.id,
"location_dest_id": line.location_id.id,
"invoice_method": "after_repair",
"location_id": line.operation_id.repair_location_id.id
or line.location_id.id,
"location_dest_id": line.operation_id.repair_location_dest_id.id
or line.location_id.id,
"invoice_method": line.operation_id.repair_invoice_method or "after_repair",
}
@api.model