diff --git a/addons/purchase/stock_view.xml b/addons/purchase/stock_view.xml
index 7afcc96767f..c25addd1513 100644
--- a/addons/purchase/stock_view.xml
+++ b/addons/purchase/stock_view.xml
@@ -19,7 +19,7 @@
-
+
@@ -31,7 +31,7 @@
res_model="stock.picking"
groups="base.group_extended"
src_model="purchase.order"
- context="{'default_purchase_id': active_id, 'contact_display': 'partner'}" />
+ context="{'default_purchase_id': active_id, 'contact_display': 'partner', 'default_type': 'in'}" />
@@ -52,9 +52,9 @@
form
-
+
-
+
@@ -115,6 +115,19 @@
If you set the Invoicing Control on a purchase order as "Based on receptions", you can track here all the product receptions and create invoices for those receptions.
+
+
+ tree
+
+
+
+
+
+ form
+
+
+
+
diff --git a/addons/sale/sale_view.xml b/addons/sale/sale_view.xml
index c34f17b3085..5315357aa22 100644
--- a/addons/sale/sale_view.xml
+++ b/addons/sale/sale_view.xml
@@ -246,7 +246,21 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/sale/stock_view.xml b/addons/sale/stock_view.xml
index 7b9e90f6f0a..a71fe4f8134 100644
--- a/addons/sale/stock_view.xml
+++ b/addons/sale/stock_view.xml
@@ -8,7 +8,7 @@
-
+
@@ -57,9 +57,9 @@
form
-
+
-
+
@@ -74,6 +74,21 @@
{'default_type': 'out', 'contact_display': 'partner_address', 'search_default_to_invoice': 1, 'search_default_done': 1}
+
+
+
+ tree
+
+
+
+
+
+
+ form
+
+
+
+
diff --git a/addons/stock/stock.py b/addons/stock/stock.py
index 2e54365dadf..6da517803c1 100644
--- a/addons/stock/stock.py
+++ b/addons/stock/stock.py
@@ -541,7 +541,7 @@ PICK_STATE = [
('assigned', 'Ready to Process'),
('done', 'Done'),
('cancel', 'Cancelled'),
- ]
+]
class stock_picking(osv.osv):
_name = "stock.picking"
_description = "Picking List"
@@ -621,25 +621,18 @@ class stock_picking(osv.osv):
return new_id
_columns = {
- 'name': fields.char('Reference', size=64, select=True, states={'done': [('readonly', True)], 'cancel':[('readonly',True)]}),
- 'origin': fields.char('Origin', size=64, states={'done': [('readonly', True)], 'cancel':[('readonly',True)]}, help="Reference of the document that produced this picking.", select=True),
- 'backorder_id': fields.many2one('stock.picking', 'Back Order of', states={'done': [('readonly', True)], 'cancel':[('readonly',True)]}, help="If this picking was split this field links to the picking that contains the other part that has been processed already.", select=True),
- 'type': fields.selection([('out', 'Sending Goods'), ('in', 'Getting Goods'), ('internal', 'Internal')], 'Shipping Type', required=True, select=True, states={'done': [('readonly', True)], 'cancel':[('readonly',True)]}, help="Shipping type specify, goods coming in or going out."),
- 'note': fields.text('Notes', states={'done': [('readonly', True)], 'cancel':[('readonly',True)]}),
- 'stock_journal_id': fields.many2one('stock.journal','Stock Journal', select=True, states={'done': [('readonly', True)], 'cancel':[('readonly',True)]}),
- 'location_id': fields.many2one('stock.location', 'Location', states={'done': [('readonly', True)], 'cancel':[('readonly',True)]}, help="Keep empty if you produce at the location where the finished products are needed." \
+ 'name': fields.char('Reference', size=64, select=True, states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}),
+ 'origin': fields.char('Origin', size=64, states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}, help="Reference of the document that produced this picking.", select=True),
+ 'backorder_id': fields.many2one('stock.picking', 'Back Order of', states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}, help="If this picking was split this field links to the picking that contains the other part that has been processed already.", select=True),
+ 'type': fields.selection([('out', 'Sending Goods'), ('in', 'Getting Goods'), ('internal', 'Internal')], 'Shipping Type', required=True, select=True, states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}, help="Shipping type specify, goods coming in or going out."),
+ 'note': fields.text('Notes', states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}),
+ 'stock_journal_id': fields.many2one('stock.journal','Stock Journal', select=True, states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}),
+ 'location_id': fields.many2one('stock.location', 'Location', states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}, help="Keep empty if you produce at the location where the finished products are needed." \
"Set a location if you produce at a fixed location. This can be a partner location " \
"if you subcontract the manufacturing operations.", select=True),
- 'location_dest_id': fields.many2one('stock.location', 'Dest. Location', states={'done': [('readonly', True)], 'cancel':[('readonly',True)]}, help="Location where the system will stock the finished products.", select=True),
- 'move_type': fields.selection([('direct', 'Partial Delivery'), ('one', 'All at once')], 'Delivery Method', required=True, states={'done': [('readonly', True)], 'cancel':[('readonly',True)]}, help="It specifies goods to be delivered all at once or by direct delivery"),
- 'state': fields.selection([
- ('draft', 'New'),
- ('auto', 'Waiting Another Operation'),
- ('confirmed', 'Waiting Availability'),
- ('assigned', 'Ready to Process'),
- ('done', 'Done'),
- ('cancel', 'Cancelled'),
- ], 'State', readonly=True, select=True,
+ 'location_dest_id': fields.many2one('stock.location', 'Dest. Location', states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}, help="Location where the system will stock the finished products.", select=True),
+ 'move_type': fields.selection([('direct', 'Partial Delivery'), ('one', 'All at once')], 'Delivery Method', required=True, states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}, help="It specifies goods to be delivered all at once or by direct delivery"),
+ 'state': fields.selection(PICK_STATE, 'State', readonly=True, select=True,
help="* Draft: not confirmed yet and will not be scheduled until confirmed\n"\
"* Confirmed: still waiting for the availability of products\n"\
"* Available: products reserved, simply waiting for confirmation.\n"\
@@ -647,21 +640,21 @@ class stock_picking(osv.osv):
"* Done: has been processed, can't be modified or cancelled anymore\n"\
"* Cancelled: has been cancelled, can't be confirmed anymore"),
'min_date': fields.function(get_min_max_date, fnct_inv=_set_minimum_date, multi="min_max_date",
- store=True, type='datetime', string='Expected Date', select=1, help="Expected date for the picking to be processed"),
- 'date': fields.datetime('Order Date', help="Date of Order", select=True, states={'done': [('readonly', True)], 'cancel':[('readonly',True)]}),
- 'date_done': fields.datetime('Date Done', help="Date of Completion", states={'done': [('readonly', True)], 'cancel':[('readonly',True)]}),
+ store=True, type='datetime', string='Scheduled Date', select=1, help="Expected date for the picking to be processed"),
+ 'date': fields.datetime('Order Date', help="Date of Order", select=True, states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}),
+ 'date_done': fields.datetime('Date Done', help="Date of Completion", states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}),
'max_date': fields.function(get_min_max_date, fnct_inv=_set_maximum_date, multi="min_max_date",
store=True, type='datetime', string='Max. Expected Date', select=2),
- 'move_lines': fields.one2many('stock.move', 'picking_id', 'Internal Moves', states={'done': [('readonly', True)], 'cancel': [('readonly', True)]}),
- 'auto_picking': fields.boolean('Auto-Picking', states={'done': [('readonly', True)], 'cancel':[('readonly',True)]}),
- 'address_id': fields.many2one('res.partner.address', 'Address', states={'done': [('readonly', True)], 'cancel':[('readonly',True)]}, help="Address of partner"),
+ 'move_lines': fields.one2many('stock.move', 'picking_id', 'Internal Moves', states={'done':[('readonly', True)], 'cancel': [('readonly', True)]}),
+ 'auto_picking': fields.boolean('Auto-Picking', states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}),
+ 'address_id': fields.many2one('res.partner.address', 'Address', states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}, help="Address of partner"),
'partner_id': fields.related('address_id','partner_id',type='many2one',relation='res.partner',string='Partner',store=True),
'invoice_state': fields.selection([
("invoiced", "Invoiced"),
("2binvoiced", "To Be Invoiced"),
("none", "Not Applicable")], "Invoice Control",
select=True, required=True, readonly=True, states={'draft': [('readonly', False)]}),
- 'company_id': fields.many2one('res.company', 'Company', required=True, select=True, states={'done': [('readonly', True)], 'cancel':[('readonly',True)]}),
+ 'company_id': fields.many2one('res.company', 'Company', required=True, select=True, states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}),
}
_defaults = {
'name': lambda self, cr, uid, context: '/',
@@ -718,22 +711,23 @@ class stock_picking(osv.osv):
return res
def action_process(self, cr, uid, ids, context=None):
- if context is None: context = {}
- context = dict(context, active_ids=ids, active_model=self._name)
- partial_id = self.pool.get("stock.partial.picking").create(cr, uid, {}, context=context)
- return {
- 'name':_("Products to Process"),
- 'view_mode': 'form',
- 'view_id': False,
- 'view_type': 'form',
- 'res_model': 'stock.partial.picking',
- 'res_id': partial_id,
- 'type': 'ir.actions.act_window',
- 'nodestroy': True,
- 'target': 'new',
- 'domain': '[]',
- 'context': context,
- }
+ if context is None: context = {}
+ mod_obj = self.pool.get('ir.model.data')
+ model_data_ids = mod_obj.search(cr, uid, [('model','=','ir.ui.view'),('name','=','stock_partial_picking_form')], context=context)
+ resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id']
+ ctx = context.copy()
+ ctx.update({'active_model': 'stock.picking', 'active_ids': ids })
+ return {
+ 'view_type': 'form',
+ 'view_mode': 'form',
+ 'res_model': 'stock.partial.picking',
+ 'views': [(resource_id,'form')],
+ 'view_id': resource_id,
+ 'type': 'ir.actions.act_window',
+ 'target': 'new',
+ 'context': ctx,
+ 'nodestroy': True,
+ }
def copy(self, cr, uid, id, default=None, context=None):
if default is None:
@@ -790,7 +784,7 @@ class stock_picking(osv.osv):
wf_service = netsvc.LocalService("workflow")
for pick in self.browse(cr, uid, ids):
if pick.state == 'draft':
- wf_service.trg_validate(uid, 'stock.picking', pick.id,'button_confirm', cr)
+ wf_service.trg_validate(uid, 'stock.picking', pick.id, 'button_confirm', cr)
move_ids = [x.id for x in pick.move_lines if x.state == 'confirmed']
if not move_ids:
raise osv.except_osv(_('Warning !'),_('Not enough stock, unable to reserve the products.'))
diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml
index 46eeff8a39c..99afacb624a 100644
--- a/addons/stock/stock_view.xml
+++ b/addons/stock/stock_view.xml
@@ -696,14 +696,12 @@
-
+
-
-
+
-
@@ -737,8 +735,9 @@
groups="base.group_extended"
icon="terp-stock_effects-object-colorize"
states="draft,assigned,confirmed"/>
+
-
+