how can i calcualte amount_taxed and amount_taxed in and stock_picking
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Buchhaltung
- Lager
- PoS
- Project
- MRP
Diese Frage wurde gekennzeichnet
Hi,
Try this code
from odoo import models, fields, api
class StockPicking(models.Model):
_inherit = 'stock.picking'
amount_taxed = fields.Monetary(string="Amount Taxed", compute='_compute_amount_taxed', store=True)
@api.depends('move_ids.product_id', 'move_ids.move_line_ids.move_line_tax_ids')
def _compute_amount_taxed(self):
for picking in self:
taxed_amount = 0.0
for move in picking.move_ids:
for move_line in move.move_line_ids:
# Sum up the taxes for each move line
for tax in move_line.move_line_tax_ids:
taxed_amount += tax.amount
picking.amount_taxed = taxed_amount
Hope it helps
i get
ValueError: Field stock.picking.amount_untaxed cannot find dependency 'move_ids' on model 'stock.picking'.
Diskutieren Sie gerne? Treten Sie bei, statt nur zu lesen!
Erstellen Sie heute ein Konto, um exklusive Funktionen zu nutzen und mit unserer tollen Community zu interagieren!
RegistrierenVerknüpfte Beiträge | Antworten | Ansichten | Aktivität | |
---|---|---|---|---|
|
1
Aug. 24
|
2433 | ||
|
1
Apr. 24
|
2277 | ||
|
2
Sept. 24
|
1607 | ||
|
2
Juli 24
|
2246 | ||
|
0
Mai 24
|
993 |