[FIX] pass 'uom_id' argument to product_id_change() to avoid traceback which is faced when we create invoice from Sale Orders with option 'Percentage' or 'Fixed Price (deposit)': (Maintenance Case: 584499)
bzr revid: rgo@tinyerp.com-20130125063213-2u08rex66cmtt9o1
This commit is contained in:
parent
39951ce27c
commit
6ad3f2c835
|
@ -73,8 +73,8 @@ class account_invoice_line(osv.osv):
|
||||||
_inherit = "account.invoice.line"
|
_inherit = "account.invoice.line"
|
||||||
_description = "Invoice Line"
|
_description = "Invoice Line"
|
||||||
|
|
||||||
def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, currency_id=False, context=None, company_id=None):
|
def product_id_change(self, cr, uid, ids, product, uom_id, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, currency_id=False, context=None, company_id=None):
|
||||||
res_prod = super(account_invoice_line, self).product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, fposition_id, price_unit, currency_id=currency_id, context=context, company_id=company_id)
|
res_prod = super(account_invoice_line, self).product_id_change(cr, uid, ids, product, uom_id, qty, name, type, partner_id, fposition_id, price_unit, currency_id=currency_id, context=context, company_id=company_id)
|
||||||
rec = self.pool.get('account.analytic.default').account_get(cr, uid, product, partner_id, uid, time.strftime('%Y-%m-%d'), context=context)
|
rec = self.pool.get('account.analytic.default').account_get(cr, uid, product, partner_id, uid, time.strftime('%Y-%m-%d'), context=context)
|
||||||
if rec:
|
if rec:
|
||||||
res_prod['value'].update({'account_analytic_id': rec.analytic_id.id})
|
res_prod['value'].update({'account_analytic_id': rec.analytic_id.id})
|
||||||
|
|
|
@ -308,8 +308,8 @@ class account_invoice_line(osv.osv):
|
||||||
res ['analytics_id'] = line.analytics_id and line.analytics_id.id or False
|
res ['analytics_id'] = line.analytics_id and line.analytics_id.id or False
|
||||||
return res
|
return res
|
||||||
|
|
||||||
def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, currency_id=False, context=None, company_id=None):
|
def product_id_change(self, cr, uid, ids, product, uom_id, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, currency_id=False, context=None, company_id=None):
|
||||||
res_prod = super(account_invoice_line, self).product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, fposition_id, price_unit, currency_id, context=context, company_id=company_id)
|
res_prod = super(account_invoice_line, self).product_id_change(cr, uid, ids, product, uom_id, qty, name, type, partner_id, fposition_id, price_unit, currency_id, context=context, company_id=company_id)
|
||||||
rec = self.pool.get('account.analytic.default').account_get(cr, uid, product, partner_id, uid, time.strftime('%Y-%m-%d'), context=context)
|
rec = self.pool.get('account.analytic.default').account_get(cr, uid, product, partner_id, uid, time.strftime('%Y-%m-%d'), context=context)
|
||||||
if rec and rec.analytics_id:
|
if rec and rec.analytics_id:
|
||||||
res_prod['value'].update({'analytics_id': rec.analytics_id.id})
|
res_prod['value'].update({'analytics_id': rec.analytics_id.id})
|
||||||
|
|
|
@ -136,9 +136,9 @@ class account_invoice_line(osv.osv):
|
||||||
res += diff_res
|
res += diff_res
|
||||||
return res
|
return res
|
||||||
|
|
||||||
def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, currency_id=False, context=None, company_id=None):
|
def product_id_change(self, cr, uid, ids, product, uom_id, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, currency_id=False, context=None, company_id=None):
|
||||||
fiscal_pool = self.pool.get('account.fiscal.position')
|
fiscal_pool = self.pool.get('account.fiscal.position')
|
||||||
res = super(account_invoice_line, self).product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, fposition_id, price_unit, currency_id, context, company_id)
|
res = super(account_invoice_line, self).product_id_change(cr, uid, ids, product, uom_id, qty, name, type, partner_id, fposition_id, price_unit, currency_id, context, company_id)
|
||||||
if not product:
|
if not product:
|
||||||
return res
|
return res
|
||||||
if type in ('in_invoice','in_refund'):
|
if type in ('in_invoice','in_refund'):
|
||||||
|
|
|
@ -100,8 +100,8 @@ sale_order_line()
|
||||||
class account_invoice_line(osv.osv):
|
class account_invoice_line(osv.osv):
|
||||||
_inherit = "account.invoice.line"
|
_inherit = "account.invoice.line"
|
||||||
|
|
||||||
def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, currency_id=False, context=None, company_id=None):
|
def product_id_change(self, cr, uid, ids, product, uom_id, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, currency_id=False, context=None, company_id=None):
|
||||||
res = super(account_invoice_line, self).product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, fposition_id, price_unit,currency_id, context=context, company_id=company_id)
|
res = super(account_invoice_line, self).product_id_change(cr, uid, ids, product, uom_id, qty, name, type, partner_id, fposition_id, price_unit,currency_id, context=context, company_id=company_id)
|
||||||
|
|
||||||
def get_real_price(res_dict, product_id, qty, uom, pricelist):
|
def get_real_price(res_dict, product_id, qty, uom, pricelist):
|
||||||
item_obj = self.pool.get('product.pricelist.item')
|
item_obj = self.pool.get('product.pricelist.item')
|
||||||
|
|
Loading…
Reference in New Issue