Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to import customize module in openERP?

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 165
    Comment on it

    If you want to import customize module in OpenERP(Odoo) follow the below mentioned code and paste it in your (Python).py file:

    1. import decimal_precision as dp
    2. from osv import fields, osv, orm
    3. from tools.translate import _
    4. import one2many_sorted
    5.  
    6. class account_invoice(osv.osv):
    7. _inherit = "account.invoice"
    8.  
    9. def _amount_discount(self, cr, uid, ids, name, args, context=None):
    10. res = {}
    11. amount_discount = 0.0
    12. for invoice in self.browse(cr, uid, ids, context=context):
    13. if invoice.invoice_line:
    14. for line in invoice.invoice_line:
    15. amount_discount += line.discount
    16. res[invoice.id] = amount_discount
    17. return res

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Reset Password
Fill out the form below and reset your password: