Odoo Help

0

Residual field with a wrong value

By
Jihen BEN ALI
on 4/19/16, 4:42 AM 339 views

Hi everyone,

I had inherit the function compute_amount in the account_invoice depending to another field in the partner profil everything is right but when I validate the invoice the residual field doesn't take into consideration the new change.

How to solve it any help please???

this is my new finction def compute_amount

@api.one

@api.depends('invoice_line.price_subtotal', 'tax_line.amount','timbre','partner_id')

def _compute_amount(self):

if self.type == 'out_invoice':

if self.partner_id.rs == True:

print'rs',self.partner_id.rs

self.amount_untaxed = sum(line.price_subtotal for line in self.invoice_line)

self.amount_tax = sum(line.amount for line in self.tax_line)

self.amount_rs = (self.amount_untaxed + self.amount_tax) * 0.01

self.amount_total = self.amount_untaxed + self.amount_tax + self.amount_rs + self.timbre

else :

self.amount_untaxed = sum(line.price_subtotal for line in self.invoice_line)

self.amount_tax = sum(line.amount for line in self.tax_line)

self.amount_total = self.amount_untaxed + self.amount_tax + self.timbre

else :

self.amount_untaxed = sum(line.price_subtotal for line in self.invoice_line)

self.amount_tax = sum(line.amount for line in self.tax_line)

self.amount_total = self.amount_untaxed + self.amount_tax

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.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 4/19/16, 4:42 AM
Seen: 339 times
Last updated: 4/19/16, 5:40 AM