parent
5a52e73d16
commit
dc9a96d941
|
@ -98,8 +98,8 @@ account_analytic_default()
|
|||
class account_invoice_line(osv.osv):
|
||||
_inherit = 'account.invoice.line'
|
||||
_description = 'account invoice line'
|
||||
def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, price_unit=False, address_invoice_id=False, context={}):
|
||||
res_prod = super(account_invoice_line,self).product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, price_unit, address_invoice_id, context)
|
||||
def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition=False, price_unit=False, address_invoice_id=False, context={}):
|
||||
res_prod = super(account_invoice_line,self).product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, fposition, price_unit, address_invoice_id, context)
|
||||
rec = self.pool.get('account.analytic.default').account_get(cr, uid, product, partner_id, uid, time.strftime('%Y-%m-%d'), context)
|
||||
if rec:
|
||||
res_prod['value'].update({'account_analytic_id':rec.analytic_id.id})
|
||||
|
|
|
@ -258,8 +258,8 @@ class account_invoice_line(osv.osv):
|
|||
res ['analytics_id']=line.analytics_id and line.analytics_id.id or False
|
||||
return res
|
||||
|
||||
def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, price_unit=False, address_invoice_id=False, context={}):
|
||||
res_prod = super(account_invoice_line,self).product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, price_unit, address_invoice_id, context)
|
||||
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, address_invoice_id=False, context={}):
|
||||
res_prod = super(account_invoice_line,self).product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, fposition, price_unit, address_invoice_id, context)
|
||||
rec = self.pool.get('account.analytic.default').account_get(cr, uid, product, partner_id, uid, time.strftime('%Y-%m-%d'), context)
|
||||
if rec and rec.analytics_id:
|
||||
res_prod['value'].update({'analytics_id':rec.analytics_id.id})
|
||||
|
|
|
@ -140,12 +140,12 @@ class account_invoice_line(osv.osv):
|
|||
else:
|
||||
return super(account_invoice_line, self).product_id_change_unit_price_inv(cr, uid, tax_id, price_unit, qty, address_invoice_id, product, partner_id, context=context)
|
||||
|
||||
def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, price_unit=False, address_invoice_id=False, price_type='tax_excluded', context=None):
|
||||
def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition=False, price_unit=False, address_invoice_id=False, price_type='tax_excluded', context=None):
|
||||
# note: will call product_id_change_unit_price_inv with context...
|
||||
if context is None:
|
||||
context = {}
|
||||
context.update({'price_type': price_type})
|
||||
return super(account_invoice_line, self).product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, price_unit, address_invoice_id, context=context)
|
||||
return super(account_invoice_line, self).product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, fposition, price_unit, address_invoice_id, context=context)
|
||||
account_invoice_line()
|
||||
|
||||
class account_invoice_tax(osv.osv):
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
<field name="inherit_id" ref="account.invoice_supplier_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="product_id" position="replace">
|
||||
<field name="product_id" on_change="product_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, price_unit, parent.address_invoice_id, parent.price_type)"/>
|
||||
<field name="product_id" on_change="product_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.address_invoice_id, parent.price_type)"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
|
|
@ -136,7 +136,8 @@ class sale_order_line(osv.osv):
|
|||
_inherit = 'sale.order.line'
|
||||
def product_id_change(self, cr, uid, ids, pricelist, product, qty=0,
|
||||
uom=False, qty_uos=0, uos=False, name='', partner_id=False,
|
||||
lang=False, update_tax=True, date_order=False, packaging=False):
|
||||
lang=False, update_tax=True, date_order=False, packaging=False,
|
||||
fiscal_position=False):
|
||||
warning = {}
|
||||
if not product:
|
||||
return {'value': {'th_weight' : 0, 'product_packaging': False,
|
||||
|
@ -151,7 +152,7 @@ class sale_order_line(osv.osv):
|
|||
message= product_info.sale_line_warn_msg
|
||||
result = super(sale_order_line, self).product_id_change( cr, uid, ids, pricelist, product, qty,
|
||||
uom, qty_uos, uos, name, partner_id,
|
||||
lang, update_tax, date_order, packaging)
|
||||
lang, update_tax, date_order, packaging, fiscal_position)
|
||||
if title and message:
|
||||
warning['title']=title[0]
|
||||
warning['message']=message
|
||||
|
@ -165,7 +166,7 @@ sale_order_line()
|
|||
class purchase_order_line(osv.osv):
|
||||
_inherit = 'purchase.order.line'
|
||||
def product_id_change(self,cr, uid, ids, pricelist, product, qty, uom,
|
||||
partner_id, date_order=False):
|
||||
partner_id, date_order=False, fiscal_position=False):
|
||||
warning = {}
|
||||
if not product:
|
||||
return {'value': {'price_unit': 0.0, 'name':'','notes':'', 'product_uom' : False}, 'domain':{'product_uom':[]}}
|
||||
|
@ -178,7 +179,7 @@ class purchase_order_line(osv.osv):
|
|||
message = product_info.purchase_line_warn_msg
|
||||
|
||||
result = super(purchase_order_line, self).product_id_change(cr, uid, ids, pricelist, product, qty, uom,
|
||||
partner_id, date_order)
|
||||
partner_id, date_order, fiscal_position)
|
||||
if title and message:
|
||||
warning['title']=title[0]
|
||||
warning['message']=message
|
||||
|
|
Loading…
Reference in New Issue