[MERGE] Merged PNA's branch to write new currency into demo pricelist
bzr revid: pso@tinyerp.com-20120829132209-v17f20ffvvyoesly
This commit is contained in:
@@ -436,7 +436,18 @@ class product_pricelist_item(osv.osv):
|
||||
return {}
|
||||
product_pricelist_item()
|
||||
|
||||
class res_company(osv.osv):
|
||||
_inherit = 'res.company'
|
||||
|
||||
def write(self, cr, uid, ids, vals, context=None):
|
||||
res = super(res_company, self).write(cr, uid, ids, vals, context)
|
||||
product_pricelist_obj = self.pool.get('product.pricelist')
|
||||
currency = product_pricelist_obj._get_currency(cr, uid, context)
|
||||
pricelist = self.pool.get('ir.model.data').get_object(cr, uid, 'product', 'list0')
|
||||
product_pricelist_obj.write(cr, uid, pricelist.id, {'currency_id': currency}, context=context)
|
||||
return res
|
||||
|
||||
res_company()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
||||
@@ -30,6 +30,15 @@ class company(osv.osv):
|
||||
_defaults = {
|
||||
'po_lead': lambda *a: 1.0,
|
||||
}
|
||||
|
||||
def write(self, cr, uid, ids, vals, context=None):
|
||||
res = super(company, self).write(cr, uid, ids, vals, context)
|
||||
product_pricelist_obj = self.pool.get('product.pricelist')
|
||||
currency = product_pricelist_obj._get_currency(cr, uid, context)
|
||||
pricelist = self.pool.get('ir.model.data').get_object(cr, uid, 'purchase', 'list0')
|
||||
product_pricelist_obj.write(cr, uid, pricelist.id, {'currency_id': currency}, context=context)
|
||||
return res
|
||||
|
||||
company()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user