[REF] mrp_repair: locations handling
This commit removes the location_dest_id on repair orders. This field was used to move the product to a specific location after the repair was done. It makes the usability of the repair order smoother and the user can still make a transfer to move the product to another location afterwards.
This commit is contained in:
@@ -7,7 +7,6 @@
|
||||
<field name="product_id" ref="product.product_product_3"/>
|
||||
<field name="product_uom" ref="product.product_uom_unit"/>
|
||||
<field name="partner_invoice_id" ref="base.res_partner_address_1"/>
|
||||
<field name="location_dest_id" ref="base.res_partner_address_1"/>
|
||||
<field name="location_id" ref="stock.stock_location_stock"/>
|
||||
<field name="operations" model="repair.line" eval="[(5, 0, 0), (0, 0, {
|
||||
'location_dest_id': obj().env.ref('stock.location_production').id,
|
||||
@@ -37,7 +36,6 @@
|
||||
<field name="guarantee_limit" eval="datetime.today().strftime('%Y-%m-%d')"/>
|
||||
<field name="invoice_method">after_repair</field>
|
||||
<field name="partner_invoice_id" ref="base.res_partner_address_1"/>
|
||||
<field name="location_dest_id" ref="stock.stock_location_14"/>
|
||||
<field name="location_id" ref="stock.stock_location_stock"/>
|
||||
<field name="operations" model="repair.line" eval="[(5, 0, 0), (0, 0, {
|
||||
'location_dest_id': obj().env.ref('stock.location_production').id,
|
||||
@@ -67,7 +65,6 @@
|
||||
<field name="guarantee_limit" eval="datetime.today().strftime('%Y-%m-%d')"/>
|
||||
<field name="invoice_method">b4repair</field>
|
||||
<field name="partner_invoice_id" ref="base.res_partner_address_1"/>
|
||||
<field name="location_dest_id" ref="stock.stock_location_stock"/>
|
||||
<field name="location_id" ref="stock.stock_location_14"/>
|
||||
<field name="operations" model="repair.line" eval="[(5, 0, 0), (0, 0, {
|
||||
'location_dest_id': obj().env.ref('stock.location_production').id,
|
||||
|
||||
@@ -69,13 +69,10 @@ class Repair(models.Model):
|
||||
"* The \'Done\' status is set when repairing is completed.\n"
|
||||
"* The \'Cancelled\' status is used when user cancel repair order.")
|
||||
location_id = fields.Many2one(
|
||||
'stock.location', 'Current Location',
|
||||
'stock.location', 'Location',
|
||||
default=_default_stock_location,
|
||||
index=True, readonly=True, required=True,
|
||||
states={'draft': [('readonly', False)], 'confirmed': [('readonly', True)]})
|
||||
location_dest_id = fields.Many2one(
|
||||
'stock.location', 'Delivery Location',
|
||||
readonly=True, required=True,
|
||||
help="This is the location where the product to repair is located.",
|
||||
states={'draft': [('readonly', False)], 'confirmed': [('readonly', True)]})
|
||||
lot_id = fields.Many2one(
|
||||
'stock.production.lot', 'Lot/Serial',
|
||||
@@ -176,10 +173,6 @@ class Repair(models.Model):
|
||||
self.product_uom = self.product_id.uom_id.id
|
||||
return res
|
||||
|
||||
@api.onchange('location_id')
|
||||
def onchange_location_id(self):
|
||||
self.location_dest_id = self.location_id.id
|
||||
|
||||
@api.onchange('partner_id')
|
||||
def onchange_partner_id(self):
|
||||
if not self.partner_id:
|
||||
@@ -468,7 +461,7 @@ class Repair(models.Model):
|
||||
'product_uom_qty': repair.product_qty,
|
||||
'partner_id': repair.address_id.id,
|
||||
'location_id': repair.location_id.id,
|
||||
'location_dest_id': repair.location_dest_id.id,
|
||||
'location_dest_id': repair.location_id.id,
|
||||
'move_line_ids': [(0, 0, {'product_id': repair.product_id.id,
|
||||
'lot_id': repair.lot_id.id,
|
||||
'product_uom_qty': 0, # bypass reservation here
|
||||
@@ -477,7 +470,7 @@ class Repair(models.Model):
|
||||
'package_id': False,
|
||||
'result_package_id': False,
|
||||
'location_id': repair.location_id.id, #TODO: owner stuff
|
||||
'location_dest_id': repair.location_dest_id.id,})],
|
||||
'location_dest_id': repair.location_id.id,})],
|
||||
'repair_id': repair.id,
|
||||
'origin': repair.name,
|
||||
})
|
||||
|
||||
@@ -63,7 +63,6 @@
|
||||
</group>
|
||||
<group>
|
||||
<field name="location_id"/>
|
||||
<field name="location_dest_id"/>
|
||||
<field name="company_id" groups="base.group_multi_company" options="{'no_create': True}"/>
|
||||
<field name="guarantee_limit"/>
|
||||
<field name="invoice_method"/>
|
||||
|
||||
Reference in New Issue
Block a user