Skip to Content
Menu
This question has been flagged
1830 Views

i have created a custom module which add a new line tax in invoice . I'm using odoo 9. My problem is that when i use print tax_lines it shows values in the console but return super(account_invoice,self).create(cr,uid,values,context) doesn't return any value in my invoice. Please how can 'i modify it to show the tax_lines in invoice . Any help please i'm stuck with this problem for many days now . Here is my code

account_invoice.py

class account_invoice(osv.osv):
_name="account.invoice"
_inherit="account.invoice"
def create(self,cr,uid,values,context=None):

    stamp_account=self.pool.get('res.company').browse(cr,uid,values.get('company_id')).default_stamp_tax_account.id
    tax_value=self.pool.get('res.company').browse(cr,uid,values.get('company_id')).default_stamp_tax_value
    #pos_account=self.pool.get('pos.order').browse(cr, uid, values.get('company_id')).partner_id.property_account_receivable.id
    print stamp_account
    print tax_value
    print "tesssssssssssssssssssssssssssssssssssssssssssssssst"
    #print pos_account

    if stamp_account:
        tax_lines=[]
        tax_lines.append([0, False, {'base_amount': 0, 'amount': tax_value, 'tax_amount': tax_value, 'name': 'Timbre', 'account_id': stamp_account}])
        values.update({
        'tax_line':tax_lines,

        })
        print tax_lines

       # print values

    return super(account_invoice,self).create(cr,uid,values,context)
Avatar
Discard
Related Posts Replies Views Activity
5
Sep 20
6857
1
Oct 19
4741
0
Feb 19
4167
2
Nov 18
5649
1
Apr 24
23779