Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
3107 มุมมอง

Hi,

I recently developed a module to change the behavior of _compute_amount method of account.invoice class and the view of account.invoice.form. Everything works fine (the model and the view). But I have a problem now, because when I confirm the invoice the amount due is not the same as the total.

Here's what I changed in the _compute_amount method:

self.amount_untaxed = sum(line.price_subtotal for line in self.invoice_line_ids)
self.amount_fodec = self.amount_untaxed * self.fodec_id.amount / 100
amount_untaxed_with_fodec = self.amount_untaxed + self.amount_fodec
self.amount_tva = amount_untaxed_with_fodec * self.tva_id.amount / 100
self.amount_tax = self.amount_fodec + self.amount_tva + self.timbre_fiscal
self.amount_total = self.amount_untaxed + self.amount_tax

 As you can see I added more taxes. _compute_amount is fine but what can I do to correct the amount due, because it just uses the default taxing mechanism (not the one I developed in my new method)?

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ธ.ค. 24
5964
3
ส.ค. 24
6834
how to know the odoo master password? แก้ไขแล้ว
4
ก.ค. 24
41138
Default value in form view แก้ไขแล้ว
5
เม.ย. 23
98800
3
พ.ย. 22
4252