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
    • 153
    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:

    import decimal_precision as dp
    from osv import fields, osv, orm
    from tools.translate import _
    import one2many_sorted
    
    class account_invoice(osv.osv):
        _inherit = "account.invoice"
    
        def _amount_discount(self, cr, uid, ids, name, args, context=None):
            res = {}
            amount_discount = 0.0
            for invoice in self.browse(cr, uid, ids, context=context):
              if invoice.invoice_line:
                for line in invoice.invoice_line:
                    amount_discount += line.discount
              res[invoice.id] =  amount_discount     
            return res

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: