[REF] stock, etc: rename picking type by operation type

As picking types aren't always used in a picking context, and picking
aren't really meanigful for a lot of people, we rename this concept as
"operation type" in views and in the planner.
This commit is contained in:
Dhaval Panchal
2017-02-17 13:21:58 +01:00
committed by Simon Lejeune
parent 44971c2be1
commit 5c837dec2a
20 changed files with 44 additions and 44 deletions
+3 -3
View File
@@ -52,9 +52,9 @@ class MrpBom(models.Model):
('asap', 'The components of 1st operation')], string='Manufacturing Readiness',
default='asap', required=True)
picking_type_id = fields.Many2one(
'stock.picking.type', 'Picking Type', domain=[('code', '=', 'mrp_operation')],
help="When a procurement has a ‘produce’ route with a picking type set, it will try to create "
"a Manufacturing Order for that product using a BoM of the same picking type. That allows "
'stock.picking.type', 'Operation Type', domain=[('code', '=', 'mrp_operation')],
help="When a procurement has a ‘produce’ route with a operation type set, it will try to create "
"a Manufacturing Order for that product using a BoM of the same operation type. That allows "
"to define procurement rules which trigger different manufacturing orders with different BoMs. ")
company_id = fields.Many2one(
'res.company', 'Company',
+1 -1
View File
@@ -64,7 +64,7 @@ class MrpProduction(models.Model):
oldname='product_uom', readonly=True, required=True,
states={'confirmed': [('readonly', False)]})
picking_type_id = fields.Many2one(
'stock.picking.type', 'Picking Type',
'stock.picking.type', 'Operation Type',
default=_get_default_picking_type, required=True)
location_src_id = fields.Many2one(
'stock.location', 'Raw Materials Location',
+1 -1
View File
@@ -282,7 +282,7 @@ class StockMove(models.Model):
self.ensure_one()
view = self.env.ref('mrp.view_stock_move_lots')
serial = (self.has_tracking == 'serial')
only_create = False # Check picking type in theory
only_create = False # Check operation type in theory
show_reserved = any([x for x in self.move_lot_ids if x.quantity > 0.0])
ctx.update({
'serial': serial,
+1 -1
View File
@@ -13,7 +13,7 @@ class StockWarehouse(models.Model):
manufacture_pull_id = fields.Many2one(
'procurement.rule', 'Manufacture Rule')
manu_type_id = fields.Many2one(
'stock.picking.type', 'Manufacturing Picking Type',
'stock.picking.type', 'Manufacturing Operation Type',
domain=[('code', '=', 'mrp_operation')])
def create_sequences_and_picking_types(self):
+1 -1
View File
@@ -58,7 +58,7 @@ class PosConfig(models.Model):
'account.journal', 'pos_config_journal_rel',
'pos_config_id', 'journal_id', string='Available Payment Methods',
domain="[('journal_user', '=', True ), ('type', 'in', ['bank', 'cash'])]",)
picking_type_id = fields.Many2one('stock.picking.type', string='Picking Type')
picking_type_id = fields.Many2one('stock.picking.type', string='Operation Type')
stock_location_id = fields.Many2one(
'stock.location', string='Stock Location',
domain=[('usage', '=', 'internal')], required=True, default=_get_default_location)
+1 -1
View File
@@ -371,7 +371,7 @@ class PosOrder(models.Model):
invoice_id = fields.Many2one('account.invoice', string='Invoice', copy=False)
account_move = fields.Many2one('account.move', string='Journal Entry', readonly=True, copy=False)
picking_id = fields.Many2one('stock.picking', string='Picking', readonly=True, copy=False)
picking_type_id = fields.Many2one('stock.picking.type', related='session_id.config_id.picking_type_id', string="Picking Type")
picking_type_id = fields.Many2one('stock.picking.type', related='session_id.config_id.picking_type_id', string="Operation Type")
location_id = fields.Many2one('stock.location', related='session_id.config_id.stock_location_id', string="Location", store=True)
note = fields.Text(string='Internal Notes')
nb_print = fields.Integer(string='Number of Print', readonly=True, copy=False, default=0)
+2 -2
View File
@@ -158,7 +158,7 @@ class PurchaseOrder(models.Model):
company_id = fields.Many2one('res.company', 'Company', required=True, index=True, states=READONLY_STATES, default=lambda self: self.env.user.company_id.id)
picking_type_id = fields.Many2one('stock.picking.type', 'Deliver To', states=READONLY_STATES, required=True, default=_default_picking_type,\
help="This will determine picking type of incoming shipment")
help="This will determine operation type of incoming shipment")
default_location_dest_id_usage = fields.Selection(related='picking_type_id.default_location_dest_id.usage', string='Destination Location Type',\
help="Technical field used to display the Drop Ship Address", readonly=True)
group_id = fields.Many2one('procurement.group', string="Procurement Group", copy=False)
@@ -449,7 +449,7 @@ class PurchaseOrder(models.Model):
action = self.env.ref('stock.action_picking_tree')
result = action.read()[0]
#override the context to get rid of the default filtering on picking type
#override the context to get rid of the default filtering on operation type
result.pop('id', None)
result['context'] = {}
pick_ids = sum([order.picking_ids.ids for order in self], [])
@@ -59,7 +59,7 @@ class PurchaseRequisition(models.Model):
'Status', track_visibility='onchange', required=True,
copy=False, default='draft')
account_analytic_id = fields.Many2one('account.analytic.account', 'Analytic Account')
picking_type_id = fields.Many2one('stock.picking.type', 'Picking Type', required=True, default=_get_picking_in)
picking_type_id = fields.Many2one('stock.picking.type', 'Operation Type', required=True, default=_get_picking_in)
@api.multi
@api.depends('purchase_ids')
+1 -1
View File
@@ -414,7 +414,7 @@
</p>
<p>
Lots can be encoded on incoming shipments, internal transfers and
outgoing deliveries according to the settings in the picking type.
outgoing deliveries according to the settings in the operation type.
The tracking can be configured on every product: not any tracing at
all, tracking by lot, or tracking by unique serial number.
</p>
+7 -7
View File
@@ -17,7 +17,7 @@ A stock move is the elementary model in OpenERP that can move stock between 2 lo
In order to make it easy to move multiple products at once and pass that as an assignment to a warehouse operator, we use pickings that group these stock moves.
We want to categorize the pickings in picking types. As a warehouse manager you want to follow up the progress of the operations between the same (kind of) locations. E.g. in the standard warehouse, not configuring anything, you will have 3 picking types: the incoming, internal and outgoing, but it is possible to create a picking type for all the packing operations that need to happen at the packing table. The Warehouse > All Operations dashboard allows to see the progress of the pickings for each picking type.
We want to categorize the pickings in operation types. As a warehouse manager you want to follow up the progress of the operations between the same (kind of) locations. E.g. in the standard warehouse, not configuring anything, you will have 3 picking types: the incoming, internal and outgoing, but it is possible to create a picking type for all the packing operations that need to happen at the packing table. The Warehouse > All Operations dashboard allows to see the progress of the pickings for each picking type.
You might have a weird feeling talking about moving from location A to location B, even for deliveries and incoming shipments. That is because OpenERP uses a double-entry concept similar to double-entry accounting. In OpenERP you do not talk of disappearance, consumption or loss of products: instead you speak only about stock moves from one place to another.
@@ -45,7 +45,7 @@ A warehouse represents the building where we stock our goods. In case of multip
A warehouse corresponds also to a location. As the locations are hierarchical, OpenERP will create one parent location for the warehouse that contains all the different locations in it.
When you create a warehouse, the system will create the necessary picking types and main child locations for this main location in the background.
When you create a warehouse, the system will create the necessary operation types and main child locations for this main location in the background.
===========================================
@@ -127,11 +127,11 @@ Assigning stock moves to pickings
When you want to give an assignment to a warehouse operator manually, you will create a picking and create the moves in it by specifying the different products and quantities. When confirming a sale order however, Odoo will create procurements which will be solved bt creating moves. First, these stock moves will be created without picking. In a second step, they will be attributed to an existing picking or a picking will be created.
In order to assign the move to a picking, Odoo will check if the move was assigned a picking type (e.g. My Company: Delivery Orders) and if it does, it will search for a picking to assign the move to. This picking should be in the correct state, picking type, procurement group (=group of procurements related to e.g. the same sale order) and source and destination locations. If no picking can be found, it will create a new one.
In order to assign the move to a picking, Odoo will check if the move was assigned an operation type (e.g. My Company: Delivery Orders) and if it does, it will search for a picking to assign the move to. This picking should be in the correct state, picking type, procurement group (=group of procurements related to e.g. the same sale order) and source and destination locations. If no picking can be found, it will create a new one.
This mechanism allows for a lot of flexibility when for example some products have to go through the Packing zone for packing and some don't. That way, the packing order will still group the moves that need packing from the sale order and the direct moves will be grouped in a separate picking also. For the delivery order, everything will be together in one picking again.
A picking is almost entirely determined by the moves in it. The state depends on the moves and the picking type, the source and destination location are those of the moves. The scheduled date is calculated as a minimum date for the stock moves.
A picking is almost entirely determined by the moves in it. The state depends on the moves and the operation type, the source and destination location are those of the moves. The scheduled date is calculated as a minimum date for the stock moves.
The state of a picking depends primarily on its moves:
@@ -142,7 +142,7 @@ The other states depend however also on the move type. The move type determines
In case of partial, a special state exists: partial availability. It is possible that a move is in the confirmed / waiting state, but has partially some stock reserved. This move will still be in the waiting/confirmed state, but have a flag partially available. In that case, the picking will not stay in the confirmed/waiting state but go to the partially available state, which makes it possible to deliver the goods partially. A picking is also partially available when some moves are assigned and others have no stock at all reserved.
Sometimes a move does not have a picking type. This means it will not be assigned to a picking. This is the case for inventory corrections and moves in and out of production.
Sometimes a move does not have an operation type. This means it will not be assigned to a picking. This is the case for inventory corrections and moves in and out of production.
================================================================
@@ -356,7 +356,7 @@ For the inter-warehouse configurations, there is also a possibility to put a war
How does the system choose the correct push rule
================================================
Searching for a push rule is quite similar as for the pull rule. It will however just search for the routes in the product and product category, then on those of the warehouse passed to the move or of the picking type of the move and then it will search a rule that is not in a route.
Searching for a push rule is quite similar as for the pull rule. It will however just search for the routes in the product and product category, then on those of the warehouse passed to the move or of the operation type of the move and then it will search a rule that is not in a route.
=======================
@@ -378,7 +378,7 @@ You can choose multiple resupply warehouses. These are selectable on the produc
What happens behind simple warehouse config
===========================================
The wizard will create all the necessary locations and picking types to support the selected settings.
The wizard will create all the necessary locations and operation types to support the selected settings.
The Incoming shipments and Outgoing shipments routes are bundled into routes that are on the warehouse. So, if you choose that warehouse, it will choose the route by default. The incoming routes will also have the push rules associated with them.
+2 -2
View File
@@ -34,9 +34,9 @@ class ProcurementRule(models.Model):
help="""Determines the procurement method of the stock move that will be generated: whether it will need to 'take from the available stock' in its source location or needs to ignore its stock and create a procurement over there.""")
route_sequence = fields.Integer('Route Sequence', related='route_id.sequence', store=True)
picking_type_id = fields.Many2one(
'stock.picking.type', 'Picking Type',
'stock.picking.type', 'Operation Type',
required=True,
help="Picking Type determines the way the picking should be shown in the view, reports, ...")
help="Operation Type determines the way the picking should be shown in the view, reports, ...")
delay = fields.Integer('Number of Days', default=0)
partner_address_id = fields.Many2one('res.partner', 'Partner Address')
propagate = fields.Boolean(
+1 -1
View File
@@ -70,7 +70,7 @@ class StockConfigSettings(models.TransientModel):
@api.multi
def set_group_stock_multi_locations(self):
""" If we are not in multiple locations, we can deactivate the internal
picking types of the warehouses, so they won't appear in the dashboard.
operation types of the warehouses, so they won't appear in the dashboard.
Otherwise, activate them.
"""
for config in self:
+2 -2
View File
@@ -187,8 +187,8 @@ class PushedFlow(models.Model):
help="The new location where the goods need to go")
delay = fields.Integer('Delay (days)', default=0, help="Number of days needed to transfer the goods")
picking_type_id = fields.Many2one(
'stock.picking.type', 'Picking Type', required=True,
help="This is the picking type that will be put on the stock moves")
'stock.picking.type', 'Operation Type', required=True,
help="This is the operation type that will be put on the stock moves")
auto = fields.Selection([
('manual', 'Manual Operation'),
('transparent', 'Automatic No Step Added')], string='Automatic Move',
+1 -1
View File
@@ -133,7 +133,7 @@ class StockMove(models.Model):
propagate = fields.Boolean(
'Propagate cancel and split', default=True,
help='If checked, when this move is cancelled, cancel the linked move too')
picking_type_id = fields.Many2one('stock.picking.type', 'Picking Type')
picking_type_id = fields.Many2one('stock.picking.type', 'Operation Type')
inventory_id = fields.Many2one('stock.inventory', 'Inventory')
lot_ids = fields.Many2many('stock.production.lot', string='Lots/Serial Numbers', compute='_compute_lot_ids')
origin_returned_move_id = fields.Many2one('stock.move', 'Origin return move', copy=False, help='Move that created the return move')
+7 -7
View File
@@ -14,21 +14,21 @@ from odoo.exceptions import UserError
class PickingType(models.Model):
_name = "stock.picking.type"
_description = "The picking type determines the picking view"
_description = "The operation type determines the picking view"
_order = 'sequence, id'
name = fields.Char('Picking Type Name', required=True, translate=True)
name = fields.Char('Operation Types Name', required=True, translate=True)
color = fields.Integer('Color')
sequence = fields.Integer('Sequence', help="Used to order the 'All Operations' kanban view")
sequence_id = fields.Many2one('ir.sequence', 'Reference Sequence', required=True)
default_location_src_id = fields.Many2one(
'stock.location', 'Default Source Location',
help="This is the default source location when you create a picking manually with this picking type. It is possible however to change it or that the routes put another location. If it is empty, it will check for the supplier location on the partner. ")
help="This is the default source location when you create a picking manually with this operation type. It is possible however to change it or that the routes put another location. If it is empty, it will check for the supplier location on the partner. ")
default_location_dest_id = fields.Many2one(
'stock.location', 'Default Destination Location',
help="This is the default destination location when you create a picking manually with this picking type. It is possible however to change it or that the routes put another location. If it is empty, it will check for the customer location on the partner. ")
help="This is the default destination location when you create a picking manually with this operation type. It is possible however to change it or that the routes put another location. If it is empty, it will check for the customer location on the partner. ")
code = fields.Selection([('incoming', 'Vendors'), ('outgoing', 'Customers'), ('internal', 'Internal')], 'Type of Operation', required=True)
return_picking_type_id = fields.Many2one('stock.picking.type', 'Picking Type for Returns')
return_picking_type_id = fields.Many2one('stock.picking.type', 'Operation Type for Returns')
show_entire_packs = fields.Boolean('Allow moving packs', help="If checked, this shows the packs to be moved as a whole in the Operations tab all the time, even if there was no entire pack reserved.")
warehouse_id = fields.Many2one(
'stock.warehouse', 'Warehouse', ondelete='cascade',
@@ -39,7 +39,7 @@ class PickingType(models.Model):
help="If this is checked only, it will suppose you want to create new Lots/Serial Numbers, so you can provide them in a text field. ")
use_existing_lots = fields.Boolean(
'Use Existing Lots/Serial Numbers', default=True,
help="If this is checked, you will be able to choose the Lots/Serial Numbers. You can also decide to not put lots in this picking type. This means it will create stock with no lot or not put a restriction on the lot taken. ")
help="If this is checked, you will be able to choose the Lots/Serial Numbers. You can also decide to not put lots in this operation type. This means it will create stock with no lot or not put a restriction on the lot taken. ")
# Statistics for the kanban view
last_done_picking = fields.Char('Last 10 Done Pickings', compute='_compute_last_done_picking')
@@ -239,7 +239,7 @@ class Picking(models.Model):
has_scrap_move = fields.Boolean(
'Has Scrap Moves', compute='_has_scrap_move')
picking_type_id = fields.Many2one(
'stock.picking.type', 'Picking Type',
'stock.picking.type', 'Operation Type',
required=True,
states={'done': [('readonly', True)], 'cancel': [('readonly', True)]})
picking_type_code = fields.Selection([
+3 -3
View File
@@ -107,7 +107,7 @@ class Warehouse(models.Model):
# actually create WH
warehouse = super(Warehouse, self).create(vals)
# create sequences and picking types
# create sequences and operation types
new_vals = warehouse.create_sequences_and_picking_types()
warehouse.write(new_vals) # TDE FIXME: use super ?
# create routes and push/procurement rules
@@ -186,7 +186,7 @@ class Warehouse(models.Model):
input_loc, output_loc = self._get_input_output_locations(self.reception_steps, self.delivery_steps)
# choose the next available color for the picking types of this warehouse
# choose the next available color for the operation types of this warehouse
all_used_colors = [res['color'] for res in PickingType.search_read([('warehouse_id', '!=', False), ('color', '!=', False)], ['color'], order='color')]
available_colors = [zef for zef in [0, 3, 4, 5, 6, 7, 8, 1, 2] if zef not in all_used_colors]
color = available_colors and available_colors[0] or 0
@@ -553,7 +553,7 @@ class Warehouse(models.Model):
@api.multi
def _update_routes(self):
routes_data = self.get_routes_dict()
# change the default source and destination location and (de)activate picking types
# change the default source and destination location and (de)activate operation types
self._update_picking_type()
# update delivery route and rules: unlink the existing rules of the warehouse delivery route and recreate it
self._create_or_update_delivery_route(routes_data)
+1 -1
View File
@@ -63,7 +63,7 @@
</record>
<record model="ir.rule" id="stock_picking_type_rule">
<field name="name">Stock Picking Type multi-company</field>
<field name="name">Stock Operation Type multi-company</field>
<field name="model_id" search="[('model','=','stock.picking.type')]" model="ir.model"/>
<field name="global" eval="True"/>
<field name="domain_force">['|', ('warehouse_id', '=', False), '|',('warehouse_id.company_id','=',False),('warehouse_id.company_id','child_of',[user.company_id.id])]</field>
+1 -1
View File
@@ -1213,7 +1213,7 @@ class TestStockFlow(TestStockCommon):
def test_30_check_with_no_incoming_lot(self):
""" Picking in without lots and picking out with"""
# Change basic picking type not to get lots
# Change basic operation type not to get lots
# Create product with lot tracking
picking_in = self.env['stock.picking.type'].browse(self.picking_type_in)
picking_in.use_create_lots = False
+6 -6
View File
@@ -4,7 +4,7 @@
<field name="name">stock.picking.type.filter</field>
<field name="model">stock.picking.type</field>
<field name="arch" type="xml">
<search string="Picking Type">
<search string="Operation Type">
<field name="name"/>
<field name="sequence_id"/>
<field name="warehouse_id"/>
@@ -13,7 +13,7 @@
</field>
</record>
<record model="ir.ui.view" id="view_picking_type_tree">
<field name="name">Picking types</field>
<field name="name">Operation types</field>
<field name="model">stock.picking.type</field>
<field name="arch" type="xml">
<tree string="Operation Types">
@@ -72,11 +72,11 @@
<field name="view_mode">kanban,form</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to create a new picking type.
Click to create a new operation type.
</p><p>
The picking type system allows you to assign each stock
The operation type system allows you to assign each stock
operation a specific type which will alter its views accordingly.
On the picking type you could e.g. specify if packing is needed by default,
On the operation type you could e.g. specify if packing is needed by default,
if it should show the customer.
</p>
</field>
@@ -425,7 +425,7 @@
<filter string="Order Date" domain="[]" context="{'group_by':'date'}"/>
<filter string="Expected Date" domain="[]" context="{'group_by':'min_date'}"/>
<filter string="Origin" domain="[]" context="{'group_by':'origin'}"/>
<filter name="picking_type" string="Picking Type" domain="[]" context="{'group_by':'picking_type_id'}"/>
<filter name="picking_type" string="Operation Type" domain="[]" context="{'group_by':'picking_type_id'}"/>
<filter string="Procurement Group" domain="[]" context="{'group_by':'group_id'}"/>
</group>
</search>
+1 -1
View File
@@ -10,7 +10,7 @@
Manage drop shipping orders
===========================
This module adds a pre-configured Drop Shipping picking type
This module adds a pre-configured Drop Shipping operation type
as well as a procurement route that allow configuring Drop
Shipping products and orders.