Odoo Help
Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM
|
e-Commerce
|
Accounting
|
Inventory
|
PoS
|
Project management
|
MRP
|
etc.
Herite and Change a fonction?
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)
About This Community
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.
RegisterOdoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.
Test it nowQuestion tools
Stats
Asked: 5/22/15, 5:53 AM |
Seen: 914 times |
Last updated: 5/22/15, 10:38 AM |