return osv.osv.unlink(self, cr, uid, unlink_ids, context=context)
+ def copy_quotation(self, cr, uid, ids, context=None):
+ id = self.copy(cr, uid, ids[0], context=None)
+ view_ref = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'sale', 'view_order_form')
+ view_id = view_ref and view_ref[1] or False,
+ return {
+ 'type': 'ir.actions.act_window',
+ 'name': _('Sales Order'),
+ 'res_model': 'sale.order',
+ 'res_id': id,
+ 'view_type': 'form',
+ 'view_mode': 'form',
+ 'view_id': view_id,
+ 'target': 'current',
+ 'nodestroy': True,
+ }
+
def onchange_pricelist_id(self, cr, uid, ids, pricelist_id, order_lines, context=None):
- if context is None:
- context = {}
- context.update({'lang': self.pool.get('res.users').context_get(cr, uid, context)['lang']})
++ context = context or {}
if not pricelist_id:
return {}
value = {
}
def action_wait(self, cr, uid, ids, context=None):
- if context is None:
- context = {}
- context.update({'lang': self.pool.get('res.users').context_get(cr, uid, context)['lang']})
++ context = context or {}
for o in self.browse(cr, uid, ids):
if not o.order_line:
raise osv.except_osv(_('Error!'),_('You cannot confirm a sale order which has no line.'))