hello ,
# -*- coding: utf-8 -*-
from openerp.osv import osv, fields
class account_line(osv.osv):
_inherit = 'account.invoice.line'
_columns = {
'rem1': fields.float(string='Remise1'),
'rem2': fields.float(string='Remise2'),
'rem3': fields.float(string='Remise3'),
'gratuite_qte': fields.float(string='Gratuite_Qte'),
}
i want to herite a fonction from account.invoice.line module and change the column (price_subtotal = taxes['total'] + rem1) . this is fonction's code :
def _compute_price(self):
price = self.price_unit * (1 - (self.discount or 0.0) / 100.0)
print 'Prix : ',price
taxes = self.invoice_line_tax_id.compute_all(price, self.quantity, product=self.product_id, partner=self.invoice_id.partner_id)
print taxes['total']
self.price_subtotal = taxes['total']
if self.invoice_id:
self.price_subtotal = self.invoice_id.currency_id.round(self.price_subtotal)