Odoo Mindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.
Module: Purchase
Entity: purchase.order.line
Compute Method: _compute_amount
| Inputs | Method | Outputs |
|---|---|---|
|
for line in self: - tax_results = self.env['account.tax']._compute_taxes([line._convert_to_tax_base_line_dict()]) - totals = next(iter(tax_results['totals'].values())) - amount_untaxed = totals['amount_untaxed'] - amount_tax = totals['amount_tax'] - - line.update({ - 'price_subtotal': amount_untaxed, - 'price_tax': amount_tax, - 'price_total': amount_untaxed + amount_tax, - }) + base_line = line._prepare_base_line_for_taxes_computation() + self.env['account.tax']._add_tax_details_in_base_line(base_line, line.company_id) + line.price_subtotal = base_line['tax_details']['raw_total_excluded_currency'] + line.price_total = base_line['tax_details']['raw_total_included_currency'] + line.price_tax = line.price_total - line.price_subtotal |
|
