+#----------------------------------------------------------
+# "Empty" Classes that are used to vary from the original stock.picking (that are dedicated to the internal pickings)
+# in order to offer a different usability with different views, labels, available reports/wizards...
+#----------------------------------------------------------
+class stock_picking_in(osv.osv):
+ _name = "stock.picking.in"
+ _inherit = "stock.picking"
+ _table = "stock_picking"
+ _description = "Incoming Shipments"
+
+ def check_access_rights(self, cr, uid, operation, raise_exception=True):
+ #override in order to redirect the check of acces rights on the stock.picking object
+ return self.pool.get('stock.picking').check_access_rights(cr, uid, operation, raise_exception=raise_exception)
+
+ def check_access_rule(self, cr, uid, ids, operation, context=None):
+ #override in order to redirect the check of acces rules on the stock.picking object
+ return self.pool.get('stock.picking').check_access_rule(cr, uid, ids, operation, context=context)
+
+ def _workflow_trigger(self, cr, uid, ids, trigger, context=None):
+ #override in order to trigger the workflow of stock.picking at the end of create, write and unlink operation
+ #instead of it's own workflow (which is not existing)
+ return self.pool.get('stock.picking')._workflow_trigger(cr, uid, ids, trigger, context=context)
+
+ def _workflow_signal(self, cr, uid, ids, signal, context=None):
+ #override in order to fire the workflow signal on given stock.picking workflow instance
+ #instead of it's own workflow (which is not existing)
+ return self.pool.get('stock.picking')._workflow_signal(cr, uid, ids, signal, context=context)
+
+ _columns = {
+ 'backorder_id': fields.many2one('stock.picking.in', 'Back Order of', states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}, help="If this shipment was split, then this field links to the shipment which contains the already processed part.", select=True),
+ 'state': fields.selection(
+ [('draft', 'Draft'),
+ ('auto', 'Waiting Another Operation'),
+ ('confirmed', 'Waiting Availability'),
+ ('assigned', 'Ready to Receive'),
+ ('done', 'Received'),
+ ('cancel', 'Cancelled'),],
+ 'Status', readonly=True, select=True,
+ help="""* Draft: not confirmed yet and will not be scheduled until confirmed\n
+ * Waiting Another Operation: waiting for another move to proceed before it becomes automatically available (e.g. in Make-To-Order flows)\n
+ * Waiting Availability: still waiting for the availability of products\n
+ * Ready to Receive: products reserved, simply waiting for confirmation.\n
+ * Received: has been processed, can't be modified or cancelled anymore\n
+ * Cancelled: has been cancelled, can't be confirmed anymore"""),
+ }
+ _defaults = {
+ 'type': 'in',
+ }
+
+class stock_picking_out(osv.osv):
+ _name = "stock.picking.out"
+ _inherit = "stock.picking"
+ _table = "stock_picking"
+ _description = "Delivery Orders"
+
+ def check_access_rights(self, cr, uid, operation, raise_exception=True):
+ #override in order to redirect the check of acces rights on the stock.picking object
+ return self.pool.get('stock.picking').check_access_rights(cr, uid, operation, raise_exception=raise_exception)
+
+ def check_access_rule(self, cr, uid, ids, operation, context=None):
+ #override in order to redirect the check of acces rules on the stock.picking object
+ return self.pool.get('stock.picking').check_access_rule(cr, uid, ids, operation, context=context)
+
+ def _workflow_trigger(self, cr, uid, ids, trigger, context=None):
+ #override in order to trigger the workflow of stock.picking at the end of create, write and unlink operation
+ #instead of it's own workflow (which is not existing)
+ return self.pool.get('stock.picking')._workflow_trigger(cr, uid, ids, trigger, context=context)
+
+ def _workflow_signal(self, cr, uid, ids, signal, context=None):
+ #override in order to fire the workflow signal on given stock.picking workflow instance
+ #instead of it's own workflow (which is not existing)
+ return self.pool.get('stock.picking')._workflow_signal(cr, uid, ids, signal, context=context)
+
+ _columns = {
+ 'backorder_id': fields.many2one('stock.picking.out', 'Back Order of', states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}, help="If this shipment was split, then this field links to the shipment which contains the already processed part.", select=True),
+ 'state': fields.selection(
+ [('draft', 'Draft'),
+ ('auto', 'Waiting Another Operation'),
+ ('confirmed', 'Waiting Availability'),
+ ('assigned', 'Ready to Deliver'),
+ ('done', 'Delivered'),
+ ('cancel', 'Cancelled'),],
+ 'Status', readonly=True, select=True,
+ help="""* Draft: not confirmed yet and will not be scheduled until confirmed\n
+ * Waiting Another Operation: waiting for another move to proceed before it becomes automatically available (e.g. in Make-To-Order flows)\n
+ * Waiting Availability: still waiting for the availability of products\n
+ * Ready to Deliver: products reserved, simply waiting for confirmation.\n
+ * Delivered: has been processed, can't be modified or cancelled anymore\n
+ * Cancelled: has been cancelled, can't be confirmed anymore"""),
+ }
+ _defaults = {
+ 'type': 'out',
+ }
+