+ Click to add a pricelist version. +
+ There can be more than one version of a pricelist, each of + these must be valid during a certain period of time. Some + examples of versions: Main Prices, 2010, 2011, Summer Sales, + etc. +
+Here you can track all the product receptions of purchase diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 0d4bda344a5..067f842165e 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -771,7 +771,8 @@ class sale_order(osv.osv): 'default_res_id': ids[0], 'default_use_template': True, 'default_template_id': template_id, - }) + 'mark_so_as_sent': True + }) return { 'view_type': 'form', 'view_mode': 'form', @@ -1476,15 +1477,14 @@ class sale_order_line(osv.osv): sale_order_line() -class mail_message(osv.osv): - _inherit = 'mail.message' - - def _postprocess_sent_message(self, cr, uid, message, context=None): - if message.model == 'sale.order': +class mail_compose_message(osv.osv): + _inherit = 'mail.compose.message' + def send_mail(self, cr, uid, ids, context=None): + context = context or {} + if context.get('mark_so_as_sent', False) and context.get('default_res_id', False): wf_service = netsvc.LocalService("workflow") - wf_service.trg_validate(uid, 'sale.order', message.res_id, 'quotation_sent', cr) - return super(mail_message, self)._postprocess_sent_message(cr, uid, message=message, context=context) - -mail_message() + wf_service.trg_validate(uid, 'sale.order', context.get('default_res_id', False), 'quotation_sent', cr) + return super(mail_compose_message, self).send_mail(cr, uid, ids, context=context) +mail_compose_message() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 041950df281..30bd70b9728 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -673,6 +673,13 @@ class stock_picking(osv.osv): ] def action_process(self, cr, uid, ids, context=None): + if context is None: + context = {} + context.update({ + 'active_model': self._name, + 'active_ids': ids, + 'active_id': len(ids) and ids[0] or False + }) return { 'view_type': 'form', 'view_mode': 'form', diff --git a/addons/stock/wizard/stock_partial_picking.py b/addons/stock/wizard/stock_partial_picking.py index 68e053b9e22..2cf0a743faa 100644 --- a/addons/stock/wizard/stock_partial_picking.py +++ b/addons/stock/wizard/stock_partial_picking.py @@ -107,21 +107,10 @@ class stock_partial_picking(osv.osv_memory): picking_ids = context.get('active_ids', []) active_model = context.get('active_model') - if active_model == 'purchase.order': - for purchase_order in self.pool.get('purchase.order').browse(cr, uid, picking_ids, context=context): - picking_ids = [picking_id.id for picking_id in purchase_order.picking_ids] - elif active_model == 'sale.order': - for sale_order in self.pool.get('sale.order').browse(cr, uid, picking_ids, context=context): - picking_ids = [picking.id for picking in sale_order.picking_ids] - if not picking_ids or len(picking_ids) != 1: # Partial Picking Processing may only be done for one picking at a time return res - # The check about active_model is there in case the client mismatched the context during propagation of it - # (already seen in previous bug where context passed was containing ir.ui.menu as active_model and the menu - # ID as active_id). Though this should be fixed in clients now, this place is sensitive enough to ensure the - # consistancy of the context. - assert active_model in ('stock.picking', 'stock.picking.in', 'stock.picking.out', 'purchase.order', 'sale.order'), 'Bad context propagation' + assert active_model in ('stock.picking', 'stock.picking.in', 'stock.picking.out'), 'Bad context propagation' picking_id, = picking_ids if 'picking_id' in fields: res.update(picking_id=picking_id)