diff options
| author | dip-odoo <dip@odoo.com> | 2017-08-24 14:26:38 +0530 |
|---|---|---|
| committer | Simon Lejeune <sle@openerp.com> | 2018-01-29 11:02:05 +0100 |
| commit | 355f59eb5dfd3635c2feffacb4ec33a34515e54d (patch) | |
| tree | ce378a3bddd181b620ad0d5ed36137d2861a319f /addons | |
| parent | eaf537338c1fab4931d35ab93f798d4b7abb2763 (diff) | |
[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.
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/repair/data/repair_demo.xml | 3 | ||||
| -rw-r--r-- | addons/repair/models/repair.py | 15 | ||||
| -rw-r--r-- | addons/repair/views/repair_views.xml | 1 |
3 files changed, 4 insertions, 15 deletions
diff --git a/addons/repair/data/repair_demo.xml b/addons/repair/data/repair_demo.xml index d96f28b1905..caec822017c 100644 --- a/addons/repair/data/repair_demo.xml +++ b/addons/repair/data/repair_demo.xml @@ -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, diff --git a/addons/repair/models/repair.py b/addons/repair/models/repair.py index 5ec5704214a..dd7c7ddf5f2 100644 --- a/addons/repair/models/repair.py +++ b/addons/repair/models/repair.py @@ -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, }) diff --git a/addons/repair/views/repair_views.xml b/addons/repair/views/repair_views.xml index 8d1cde5b3a1..6a3fa0ca0a4 100644 --- a/addons/repair/views/repair_views.xml +++ b/addons/repair/views/repair_views.xml @@ -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"/> |
