[ADD] account_perf_obligation_sale_qty_delivered - #79
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 18.0 #79 +/- ##
==========================================
- Coverage 96.80% 96.76% -0.05%
==========================================
Files 80 85 +5
Lines 3223 3275 +52
Branches 169 174 +5
==========================================
+ Hits 3120 3169 +49
- Misses 71 72 +1
- Partials 32 34 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
f734845 to
115f014
Compare
115f014 to
660b62c
Compare
| return base_line["tax_details"]["raw_total_excluded_currency"] | ||
|
|
||
| @api.constrains("qty_delivered") | ||
| def _check_perf_obligation_over_delivery(self): |
There was a problem hiding this comment.
not the right question. it's a constrains, so the right question is: when is this method called: when qty_delivered changes
There was a problem hiding this comment.
But but, a constraint is not supposed to have side effects.
There was a problem hiding this comment.
that is, if you use them as intended: just to check and raise. as of now, in the account-performance-obligation project, we use them as intended. but we often use them, in other projects, as a shortcut for create and write override
here I could adapt and use the write only I guess
There was a problem hiding this comment.
but we often use them, in other projects, as a shortcut for create and write override
😱
There was a problem hiding this comment.
I adapted with create and write overrides
| self.env["account.tax"]._add_tax_details_in_base_line( | ||
| base_line, self.company_id | ||
| ) | ||
| return base_line["tax_details"]["raw_total_excluded_currency"] |
There was a problem hiding this comment.
In this field name raw_total_excluded_currency, can you confirm that excluded means "tax excluded", and currency means company currency? Because the perf obligation amount is (currently) tax excluded, and in company currency.
There was a problem hiding this comment.
In sale module (sale.order.line._compute_amount), price_subtotal is computed directly using raw_total_excluded_currency:
line.price_subtotal = base_line['tax_details']['raw_total_excluded_currency']
Since _get_perf_obligation_amount() in account_perf_obligation_sale returns self.price_subtotal (which is in the sale order currency), using raw_total_excluded_currency maintains consistency with the account_perf_obligation_sale module.
excluded means "tax excluded" yes
but currency does not mean company currency, it means the record currency
660b62c to
6af3baf
Compare
6af3baf to
b4a3a22
Compare
No description provided.