[IMP] stock, mrp, purchase: rename propagate into propagate_cancel

This commit rename propagate field into propagate_cancel to be
more consistent with c514e8ae6a (introducing
propagate_date)

Task : 1913297
This commit is contained in:
Dhaval Panchal
2019-06-11 07:56:11 +00:00
committed by William Henrotin
parent a24fe59d3c
commit 1ccca8d267
8 changed files with 21 additions and 21 deletions
+4 -4
View File
@@ -187,8 +187,8 @@ class MrpProduction(models.Model):
'procurement.group', 'Procurement Group',
copy=False)
orderpoint_id = fields.Many2one('stock.warehouse.orderpoint', 'Orderpoint')
propagate = fields.Boolean(
'Propagate cancel and split',
propagate_cancel = fields.Boolean(
'Propagate cancel and split', oldname='propagate',
help='If checked, when the previous move of the move (which was generated by a next procurement) is cancelled or split, the move generated by this move will too')
propagate_date = fields.Boolean(string="Propagate Rescheduling",
help='The rescheduling is propagated to the next move.')
@@ -485,7 +485,7 @@ class MrpProduction(models.Model):
'warehouse_id': self.location_dest_id.get_warehouse().id,
'origin': self.name,
'group_id': self.procurement_group_id.id,
'propagate': self.propagate,
'propagate_cancel': self.propagate_cancel,
'propagate_date': self.propagate_date,
'propagate_date_minimum_delta': self.propagate_date_minimum_delta,
'move_dest_ids': [(4, x.id) for x in self.move_dest_ids],
@@ -545,7 +545,7 @@ class MrpProduction(models.Model):
'state': 'draft',
'warehouse_id': source_location.get_warehouse().id,
'group_id': self.procurement_group_id.id,
'propagate': self.propagate,
'propagate_cancel': self.propagate_cancel,
}
return data
+1 -1
View File
@@ -86,7 +86,7 @@ class StockRule(models.Model):
'date_planned_start': fields.Datetime.to_string(self._get_date_planned(product_id, company_id, values)),
'date_planned_finished': values['date_planned'],
'procurement_group_id': False,
'propagate': self.propagate,
'propagate_cancel': self.propagate_cancel,
'propagate_date': self.propagate_date,
'propagate_date_minimum_delta': self.propagate_date_minimum_delta,
'orderpoint_id': values.get('orderpoint_id', False) and values.get('orderpoint_id').id,
+2 -2
View File
@@ -125,7 +125,7 @@ class StockWarehouse(models.Model):
'company_id': self.company_id.id,
'action': 'pull',
'auto': 'manual',
'propagate': True,
'propagate_cancel': True,
'route_id': self._find_global_route('stock.route_warehouse0_mto', _('Make To Order')).id,
'name': self._format_rulename(self.lot_stock_id, self.pbm_loc_id, 'MTO'),
'location_id': self.pbm_loc_id.id,
@@ -149,7 +149,7 @@ class StockWarehouse(models.Model):
'company_id': self.company_id.id,
'action': 'pull',
'auto': 'manual',
'propagate': True,
'propagate_cancel': True,
'route_id': self._find_global_route('mrp.route_warehouse0_manufacture', _('Manufacture')).id,
'name': self._format_rulename(self.sam_loc_id, self.lot_stock_id, False),
'location_id': self.lot_stock_id.id,
@@ -70,7 +70,7 @@ class StockWarehouse(models.Model):
'company_id': self.company_id.id,
'action': 'pull',
'auto': 'manual',
'propagate': True,
'propagate_cancel': True,
'route_id': self._find_global_route('stock.route_warehouse0_mto', _('Make To Order')).id,
'name': self._format_rulename(self.lot_stock_id, subcontract_location_id, 'MTO'),
'location_id': subcontract_location_id.id,
@@ -88,7 +88,7 @@ class StockWarehouse(models.Model):
'company_id': self.company_id.id,
'action': 'pull',
'auto': 'manual',
'propagate': True,
'propagate_cancel': True,
'route_id': self._find_global_route('mrp_subcontracting.route_resupply_subcontractor_mto',
_('Resupply Subcontractor on Order')).id,
'name': self._format_rulename(self.lot_stock_id, subcontract_location_id, False),
+4 -4
View File
@@ -124,8 +124,8 @@ class StockMove(models.Model):
scrap_ids = fields.One2many('stock.scrap', 'move_id')
group_id = fields.Many2one('procurement.group', 'Procurement Group', default=_default_group_id)
rule_id = fields.Many2one('stock.rule', 'Stock Rule', ondelete='restrict', help='The stock rule that created this stock move')
propagate = fields.Boolean(
'Propagate cancel and split', default=True,
propagate_cancel = fields.Boolean(
'Propagate cancel and split', default=True, oldname='propagate',
help='If checked, when this move is cancelled, cancel the linked move too')
propagate_date = fields.Boolean(string="Propagate Rescheduling",
help='The rescheduling is propagated to the next move.')
@@ -537,7 +537,7 @@ class StockMove(models.Model):
def _clean_merged(self):
"""Cleanup hook used when merging moves"""
self.write({'propagate': False})
self.write({'propagate_cancel': False})
def _merge_moves(self, merge_into=False):
""" This method will, for each move in `self`, go up in their linked picking and try to
@@ -1020,7 +1020,7 @@ class StockMove(models.Model):
for move in moves_to_cancel:
siblings_states = (move.move_dest_ids.mapped('move_orig_ids') - move).mapped('state')
if move.propagate:
if move.propagate_cancel:
# only cancel the next move if all my siblings are also cancelled
if all(state == 'cancel' for state in siblings_states):
move.move_dest_ids.filtered(lambda m: m.state != 'done')._action_cancel()
+5 -5
View File
@@ -56,9 +56,9 @@ class StockRule(models.Model):
required=True)
delay = fields.Integer('Delay', default=0, help="The expected date of the created transfer will be computed based on this delay.")
partner_address_id = fields.Many2one('res.partner', 'Partner Address', help="Address where goods should be delivered. Optional.")
propagate = fields.Boolean(
'Propagate cancel and split', default=True,
help="When ticked, if the move is splitted or cancelled, the next move will be too.")
propagate_cancel = fields.Boolean(
'Cancel Next Move', default=False, oldname='propagate',
help="When ticked, if the move created by this rule is cancelled, the next move will be cancelled too.")
warehouse_id = fields.Many2one('stock.warehouse', 'Warehouse')
propagate_warehouse_id = fields.Many2one(
'stock.warehouse', 'Warehouse to Propagate',
@@ -170,7 +170,7 @@ class StockRule(models.Model):
'company_id': self.company_id.id,
'picking_id': False,
'picking_type_id': self.picking_type_id.id,
'propagate': self.propagate,
'propagate_cancel': self.propagate_cancel,
'warehouse_id': self.warehouse_id.id,
}
return new_move_vals
@@ -265,7 +265,7 @@ class StockRule(models.Model):
'warehouse_id': self.propagate_warehouse_id.id or self.warehouse_id.id,
'date': date_expected,
'date_expected': date_expected,
'propagate': self.propagate,
'propagate_cancel': self.propagate_cancel,
'propagate_date': self.propagate_date,
'propagate_date_minimum_delta': self.propagate_date_minimum_delta,
'description_picking': product_id._get_description(self.picking_type_id),
+2 -2
View File
@@ -338,7 +338,7 @@ class Warehouse(models.Model):
'company_id': self.company_id.id,
'action': 'pull',
'auto': 'manual',
'propagate': True,
'propagate_cancel': True,
'route_id': self._find_global_route('stock.route_warehouse0_mto', _('Make To Order')).id
},
'update_values': {
@@ -675,7 +675,7 @@ class Warehouse(models.Model):
'procure_method': first_rule and 'make_to_stock' or 'make_to_order',
'warehouse_id': self.id,
'company_id': self.company_id.id,
'propagate': routing.picking_type != self.pick_type_id,
'propagate_cancel': routing.picking_type != self.pick_type_id,
}
route_rule_values.update(values or {})
rules_list.append(route_rule_values)
+1 -1
View File
@@ -96,7 +96,7 @@
<group name="propagation_group" string="Propagation" attrs="{'invisible': [('action', '=', 'push')]}" groups="base.group_no_one">
<field name="group_propagation_option"/>
<field name="group_id" attrs="{'invisible': [('group_propagation_option', '!=', 'fixed')], 'required': [('group_propagation_option', '=', 'fixed')]}"/>
<field name="propagate"/>
<field name="propagate_cancel"/>
<field name="propagate_warehouse_id"/>
</group>
<group string="Options" attrs="{'invisible': [('action', 'not in', ['pull', 'push', 'pull_push'])]}">