hello i want to crreat function that calculate amount_taxed and amount_untaxed
i did this function but i cant get tax add to function any solution
class StockPicking(models.Model):
_inherit = 'stock.picking'
amount_untaxed = fields.Float(string='Untaxed Amount', compute='_compute_amounts', store=True)
amount_tax = fields.Float(string='Taxes')
amount_total = fields.Float(string='Total', compute='_compute_amounts', store=True)
@api.depends('move_lines.price_unit', 'move_lines.product_uom_qty')
def _compute_amounts(self):
for picking in self:
amount_untaxed = 0.0
amount_tax = 0.0
amount_total = 0.0
for move in picking.move_lines:
price_unit = move.price_unit
quantity = move.product_uom_qty
amount_total += price_unit * quantity
picking.amount_total = amount_total