odoo-addon-l10n-br-fiscal 16.0.8.0.2__py3-none-any.whl → 16.0.19.4.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. odoo/addons/l10n_br_fiscal/README.rst +1 -1
  2. odoo/addons/l10n_br_fiscal/__manifest__.py +10 -3
  3. odoo/addons/l10n_br_fiscal/constants/fiscal.py +64 -18
  4. odoo/addons/l10n_br_fiscal/data/l10n_br_fiscal.cest.csv +1043 -983
  5. odoo/addons/l10n_br_fiscal/data/l10n_br_fiscal.cst.csv +58 -0
  6. odoo/addons/l10n_br_fiscal/data/l10n_br_fiscal.document.type.csv +1 -0
  7. odoo/addons/l10n_br_fiscal/data/l10n_br_fiscal.operation.indicator.csv +27 -0
  8. odoo/addons/l10n_br_fiscal/data/l10n_br_fiscal.tax.classification.csv +163 -0
  9. odoo/addons/l10n_br_fiscal/data/l10n_br_fiscal.tax.csv +31 -0
  10. odoo/addons/l10n_br_fiscal/data/l10n_br_fiscal.tax.group.csv +3 -0
  11. odoo/addons/l10n_br_fiscal/data/operation_data.xml +1 -1
  12. odoo/addons/l10n_br_fiscal/data/uom_data.xml +186 -33
  13. odoo/addons/l10n_br_fiscal/demo/fiscal_document_demo.xml +3 -377
  14. odoo/addons/l10n_br_fiscal/demo/fiscal_document_nfse_demo.xml +0 -12
  15. odoo/addons/l10n_br_fiscal/demo/fiscal_operation_demo.xml +2 -2
  16. odoo/addons/l10n_br_fiscal/i18n/l10n_br_fiscal.pot +902 -304
  17. odoo/addons/l10n_br_fiscal/i18n/pt_BR.po +22 -22
  18. odoo/addons/l10n_br_fiscal/migrations/16.0.13.0.0/pre-migration.py +25 -0
  19. odoo/addons/l10n_br_fiscal/migrations/16.0.14.0.0/pre-migration.py +30 -0
  20. odoo/addons/l10n_br_fiscal/migrations/16.0.14.0.5/pre-migration.py +15 -0
  21. odoo/addons/l10n_br_fiscal/models/__init__.py +3 -2
  22. odoo/addons/l10n_br_fiscal/models/comment.py +2 -2
  23. odoo/addons/l10n_br_fiscal/models/data_ncm_nbs_abstract.py +1 -1
  24. odoo/addons/l10n_br_fiscal/models/document.py +83 -226
  25. odoo/addons/l10n_br_fiscal/models/document_line.py +67 -5
  26. odoo/addons/l10n_br_fiscal/models/document_line_mixin.py +1932 -136
  27. odoo/addons/l10n_br_fiscal/models/document_mixin.py +248 -17
  28. odoo/addons/l10n_br_fiscal/models/document_related.py +11 -8
  29. odoo/addons/l10n_br_fiscal/models/document_serie.py +33 -0
  30. odoo/addons/l10n_br_fiscal/models/ibpt.py +1 -1
  31. odoo/addons/l10n_br_fiscal/models/icms_regulation.py +1 -1
  32. odoo/addons/l10n_br_fiscal/models/invalidate_number.py +4 -5
  33. odoo/addons/l10n_br_fiscal/models/operation_dashboard.py +3 -2
  34. odoo/addons/l10n_br_fiscal/models/operation_indicator.py +58 -0
  35. odoo/addons/l10n_br_fiscal/models/operation_line.py +28 -0
  36. odoo/addons/l10n_br_fiscal/models/partner_profile.py +6 -0
  37. odoo/addons/l10n_br_fiscal/models/product_template.py +5 -1
  38. odoo/addons/l10n_br_fiscal/models/res_company.py +18 -0
  39. odoo/addons/l10n_br_fiscal/models/res_partner.py +27 -6
  40. odoo/addons/l10n_br_fiscal/models/simplified_tax_range.py +8 -0
  41. odoo/addons/l10n_br_fiscal/models/tax.py +7 -3
  42. odoo/addons/l10n_br_fiscal/models/tax_classification.py +81 -0
  43. odoo/addons/l10n_br_fiscal/models/tax_pis_cofins_base.py +1 -1
  44. odoo/addons/l10n_br_fiscal/models/tax_pis_cofins_credit.py +1 -1
  45. odoo/addons/l10n_br_fiscal/models/uom_uom.py +24 -0
  46. odoo/addons/l10n_br_fiscal/security/fiscal_security.xml +6 -16
  47. odoo/addons/l10n_br_fiscal/security/ir.model.access.csv +8 -2
  48. odoo/addons/l10n_br_fiscal/static/description/index.html +1 -1
  49. odoo/addons/l10n_br_fiscal/tests/__init__.py +3 -0
  50. odoo/addons/l10n_br_fiscal/tests/test_document_edition.py +308 -0
  51. odoo/addons/l10n_br_fiscal/tests/test_fiscal_document_generic.py +23 -111
  52. odoo/addons/l10n_br_fiscal/tests/test_fiscal_document_nfse.py +5 -13
  53. odoo/addons/l10n_br_fiscal/tests/test_fiscal_document_serie.py +60 -0
  54. odoo/addons/l10n_br_fiscal/tests/test_ibpt.py +2 -2
  55. odoo/addons/l10n_br_fiscal/tests/test_icms_regulation.py +2 -2
  56. odoo/addons/l10n_br_fiscal/tests/test_tax_benefit.py +14 -20
  57. odoo/addons/l10n_br_fiscal/tests/test_tax_classification.py +110 -0
  58. odoo/addons/l10n_br_fiscal/tools.py +1 -1
  59. odoo/addons/l10n_br_fiscal/views/cest_view.xml +2 -4
  60. odoo/addons/l10n_br_fiscal/views/cfop_view.xml +3 -5
  61. odoo/addons/l10n_br_fiscal/views/city_taxation_code.xml +1 -4
  62. odoo/addons/l10n_br_fiscal/views/cnae_view.xml +2 -4
  63. odoo/addons/l10n_br_fiscal/views/comment_view.xml +2 -4
  64. odoo/addons/l10n_br_fiscal/views/cst_view.xml +6 -8
  65. odoo/addons/l10n_br_fiscal/views/{document_fiscal_line_mixin_view.xml → document_line_mixin_view.xml} +525 -388
  66. odoo/addons/l10n_br_fiscal/views/document_line_view.xml +101 -82
  67. odoo/addons/l10n_br_fiscal/views/document_related_view.xml +44 -46
  68. odoo/addons/l10n_br_fiscal/views/document_serie_view.xml +2 -6
  69. odoo/addons/l10n_br_fiscal/views/document_type_view.xml +0 -2
  70. odoo/addons/l10n_br_fiscal/views/document_view.xml +304 -346
  71. odoo/addons/l10n_br_fiscal/views/icms_regulation_view.xml +14 -16
  72. odoo/addons/l10n_br_fiscal/views/icms_relief_view.xml +8 -10
  73. odoo/addons/l10n_br_fiscal/views/invalidate_number_view.xml +46 -48
  74. odoo/addons/l10n_br_fiscal/views/l10n_br_fiscal_action.xml +162 -244
  75. odoo/addons/l10n_br_fiscal/views/l10n_br_fiscal_menu.xml +16 -72
  76. odoo/addons/l10n_br_fiscal/views/legal_nature_view.xml +0 -2
  77. odoo/addons/l10n_br_fiscal/views/nbm_view.xml +5 -6
  78. odoo/addons/l10n_br_fiscal/views/nbs_view.xml +5 -6
  79. odoo/addons/l10n_br_fiscal/views/ncm_view.xml +12 -15
  80. odoo/addons/l10n_br_fiscal/views/operation_dashboard_view.xml +13 -12
  81. odoo/addons/l10n_br_fiscal/views/operation_indicator_view.xml +75 -0
  82. odoo/addons/l10n_br_fiscal/views/operation_line_view.xml +22 -21
  83. odoo/addons/l10n_br_fiscal/views/operation_view.xml +3 -6
  84. odoo/addons/l10n_br_fiscal/views/partner_profile_view.xml +3 -6
  85. odoo/addons/l10n_br_fiscal/views/product_genre_view.xml +7 -9
  86. odoo/addons/l10n_br_fiscal/views/product_product_view.xml +37 -14
  87. odoo/addons/l10n_br_fiscal/views/product_template_view.xml +34 -14
  88. odoo/addons/l10n_br_fiscal/views/res_company_view.xml +40 -38
  89. odoo/addons/l10n_br_fiscal/views/res_config_settings_view.xml +23 -28
  90. odoo/addons/l10n_br_fiscal/views/res_partner_view.xml +13 -2
  91. odoo/addons/l10n_br_fiscal/views/service_type_view.xml +7 -8
  92. odoo/addons/l10n_br_fiscal/views/simplified_tax_range_view.xml +0 -2
  93. odoo/addons/l10n_br_fiscal/views/simplified_tax_view.xml +0 -2
  94. odoo/addons/l10n_br_fiscal/views/tax_classification.xml +110 -0
  95. odoo/addons/l10n_br_fiscal/views/tax_definition_view.xml +157 -129
  96. odoo/addons/l10n_br_fiscal/views/tax_estimate_view.xml +0 -2
  97. odoo/addons/l10n_br_fiscal/views/tax_group_view.xml +3 -6
  98. odoo/addons/l10n_br_fiscal/views/tax_ipi_control_seal_view.xml +0 -2
  99. odoo/addons/l10n_br_fiscal/views/tax_ipi_guideline_class_view.xml +0 -2
  100. odoo/addons/l10n_br_fiscal/views/tax_ipi_guideline_view.xml +2 -4
  101. odoo/addons/l10n_br_fiscal/views/tax_pis_cofins_base_view.xml +2 -4
  102. odoo/addons/l10n_br_fiscal/views/tax_pis_cofins_credit_view.xml +2 -4
  103. odoo/addons/l10n_br_fiscal/views/tax_pis_cofins_view.xml +5 -7
  104. odoo/addons/l10n_br_fiscal/views/tax_view.xml +5 -7
  105. odoo/addons/l10n_br_fiscal/views/uom_uom.xml +52 -0
  106. odoo/addons/l10n_br_fiscal/wizards/__init__.py +1 -0
  107. odoo/addons/l10n_br_fiscal/wizards/base_wizard_mixin.py +1 -1
  108. odoo/addons/l10n_br_fiscal/wizards/document_import_wizard_mixin.py +129 -0
  109. odoo/addons/l10n_br_fiscal/wizards/document_import_wizard_mixin.xml +41 -0
  110. {odoo_addon_l10n_br_fiscal-16.0.8.0.2.dist-info → odoo_addon_l10n_br_fiscal-16.0.19.4.0.dist-info}/METADATA +3 -3
  111. {odoo_addon_l10n_br_fiscal-16.0.8.0.2.dist-info → odoo_addon_l10n_br_fiscal-16.0.19.4.0.dist-info}/RECORD +113 -99
  112. {odoo_addon_l10n_br_fiscal-16.0.8.0.2.dist-info → odoo_addon_l10n_br_fiscal-16.0.19.4.0.dist-info}/WHEEL +1 -1
  113. odoo/addons/l10n_br_fiscal/models/document_line_mixin_methods.py +0 -814
  114. odoo/addons/l10n_br_fiscal/models/document_mixin_methods.py +0 -363
  115. {odoo_addon_l10n_br_fiscal-16.0.8.0.2.dist-info → odoo_addon_l10n_br_fiscal-16.0.19.4.0.dist-info}/top_level.txt +0 -0
@@ -1,363 +0,0 @@
1
- # Copyright (C) 2019 Renato Lima - Akretion <renato.lima@akretion.com.br>
2
- # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
3
-
4
- from odoo import api, models
5
-
6
- from ..constants.fiscal import (
7
- COMMENT_TYPE_COMMERCIAL,
8
- COMMENT_TYPE_FISCAL,
9
- DOCUMENT_ISSUER_COMPANY,
10
- )
11
-
12
-
13
- class FiscalDocumentMixinMethods(models.AbstractModel):
14
- """
15
- Provides the method implementations for l10n_br_fiscal.document.mixin.
16
-
17
- These methods are extracted into this separate mixin due to the way
18
- l10n_br_fiscal.document.line is incorporated into account.move
19
- by the l10n_br_account module (decorator pattern).
20
-
21
- Specifically:
22
- - In l10n_br_account, fields from l10n_br_fiscal.document
23
- are added to account.move using Odoo's `_inherits` (composition)
24
- mechanism.
25
- - The methods in *this* mixin, however, are intended to be inherited
26
- using the standard `_inherit` mechanism.
27
-
28
- This separation is crucial because `_inherits` handles field composition
29
- but does not inherit methods. Thus, `_inherit` is used to bring in
30
- these methods. If these methods were defined in the same class as the
31
- fields of l10n_br_fiscal.document.mixin (which are subject to
32
- `_inherits`), and account.move.line also used `_inherit` on that
33
- single class, the fields would be duplicated.
34
- """
35
-
36
- _name = "l10n_br_fiscal.document.mixin.methods"
37
- _description = "Fiscal Document Mixin Methods"
38
-
39
- def _prepare_br_fiscal_dict(self, default=False):
40
- self.ensure_one()
41
- fields = self.env["l10n_br_fiscal.document.mixin"]._fields.keys()
42
-
43
- # we now read the record fiscal fields except the m2m tax:
44
- vals = self._convert_to_write(self.read(fields)[0])
45
-
46
- # remove id field to avoid conflicts
47
- vals.pop("id", None)
48
-
49
- if default: # in case you want to use new rather than write later
50
- return {f"default_{k}": vals[k] for k in vals.keys()}
51
- return vals
52
-
53
- @api.onchange("document_type_id")
54
- def _onchange_document_type_id(self):
55
- if self.document_type_id and self.issuer == DOCUMENT_ISSUER_COMPANY:
56
- self.document_serie_id = self.document_type_id.get_document_serie(
57
- self.company_id, self.fiscal_operation_id
58
- )
59
-
60
- @api.onchange("fiscal_operation_id")
61
- def _onchange_fiscal_operation_id(self):
62
- if self.fiscal_operation_id:
63
- self.fiscal_operation_type = self.fiscal_operation_id.fiscal_operation_type
64
-
65
- if self.issuer == DOCUMENT_ISSUER_COMPANY and not self.document_type_id:
66
- self.document_type_id = self.company_id.document_type_id
67
-
68
- def _get_amount_lines(self):
69
- """
70
- Hook method to retrieve the document lines used for amount calculations.
71
-
72
- This method should be overridden by models that inherit this mixin
73
- if their fiscal document lines are stored in a field other than
74
- `fiscal_line_ids`. The returned recordset should contain line objects
75
- that have the fiscal amount fields to be summed.
76
-
77
- :return: A recordset of fiscal document line objects.
78
- """
79
- return self.mapped("fiscal_line_ids")
80
-
81
- def _get_product_amount_lines(self):
82
- """Get object lines instaces used to compute fields"""
83
- fiscal_line_ids = self._get_amount_lines()
84
- return fiscal_line_ids.filtered(lambda line: line.product_id.type != "service")
85
-
86
- @api.model
87
- def _get_amount_fields(self):
88
- """Get all fields with 'amount_' prefix"""
89
- fields = self.env["l10n_br_fiscal.document.mixin"]._fields.keys()
90
- amount_fields = [f for f in fields if f.startswith("amount_")]
91
- return amount_fields
92
-
93
- @api.depends("document_serie_id", "issuer")
94
- def _compute_document_serie(self):
95
- for doc in self:
96
- if doc.document_serie_id and doc.issuer == DOCUMENT_ISSUER_COMPANY:
97
- doc.document_serie = doc.document_serie_id.code
98
- elif doc.document_serie is None:
99
- doc.document_serie = False
100
-
101
- @api.depends("document_type_id", "issuer")
102
- def _compute_document_serie_id(self):
103
- for doc in self:
104
- if doc.document_type_id and doc.issuer == DOCUMENT_ISSUER_COMPANY:
105
- doc.document_serie_id = doc.document_type_id.get_document_serie(
106
- doc.company_id, doc.fiscal_operation_id
107
- )
108
- elif doc.document_serie_id is None:
109
- doc.document_serie_id = False
110
-
111
- def _compute_fiscal_amount(self):
112
- """
113
- Compute and sum various fiscal amounts from the document lines.
114
-
115
- This method iterates over fields prefixed with 'amount_' (as determined
116
- by `_get_amount_fields`) and sums corresponding values from the lines
117
- retrieved by `_get_amount_lines`.
118
-
119
- It handles cases where delivery costs (freight, insurance, other) are
120
- defined at the document total level rather than per line.
121
- """
122
-
123
- fields = self._get_amount_fields()
124
- for doc in self:
125
- values = {key: 0.0 for key in fields}
126
- for line in doc._get_amount_lines():
127
- for field in fields:
128
- if field in line._fields.keys():
129
- values[field] += line[field]
130
- if field.replace("amount_", "") in line._fields.keys():
131
- # FIXME this field creates an error in invoice form
132
- if field == "amount_financial_discount_value":
133
- values[
134
- "amount_financial_discount_value"
135
- ] += 0 # line.financial_discount_value
136
- else:
137
- values[field] += line[field.replace("amount_", "")]
138
-
139
- # Valores definidos pelo Total e não pela Linha
140
- if (
141
- doc.company_id.delivery_costs == "total"
142
- or doc.force_compute_delivery_costs_by_total
143
- ):
144
- values["amount_freight_value"] = doc.amount_freight_value
145
- values["amount_insurance_value"] = doc.amount_insurance_value
146
- values["amount_other_value"] = doc.amount_other_value
147
-
148
- doc.update(values)
149
-
150
- def __document_comment_vals(self):
151
- return {
152
- "user": self.env.user,
153
- "ctx": self._context,
154
- "doc": self,
155
- }
156
-
157
- def _document_comment(self):
158
- for d in self:
159
- # Fiscal Comments
160
- d.fiscal_additional_data = d.comment_ids.filtered(
161
- lambda c: c.comment_type == COMMENT_TYPE_FISCAL
162
- ).compute_message(
163
- d.__document_comment_vals(), d.manual_fiscal_additional_data
164
- )
165
-
166
- # Commercial Comments
167
- d.customer_additional_data = d.comment_ids.filtered(
168
- lambda c: c.comment_type == COMMENT_TYPE_COMMERCIAL
169
- ).compute_message(
170
- d.__document_comment_vals(), d.manual_customer_additional_data
171
- )
172
- d.fiscal_line_ids._document_comment()
173
-
174
- def _get_fiscal_partner(self):
175
- """
176
- Hook method to determine the fiscal partner for the document.
177
-
178
- This method is designed to be overridden in implementing models if the
179
- partner relevant for fiscal purposes (e.g., for tax calculations,
180
- final consumer status) is different from the main `partner_id`
181
- of the document record. For instance, an invoice might use a specific
182
- invoicing contact derived from the main partner.
183
-
184
- :return: A `res.partner` recordset representing the fiscal partner.
185
- """
186
-
187
- self.ensure_one()
188
- return self.partner_id
189
-
190
- @api.onchange("partner_id")
191
- def _onchange_partner_id_fiscal(self):
192
- partner = self._get_fiscal_partner()
193
- if partner:
194
- self.ind_final = partner.ind_final
195
- for line in self._get_amount_lines():
196
- # reload fiscal data, operation line, cfop, taxes, etc.
197
- line._onchange_fiscal_operation_id()
198
-
199
- @api.depends("fiscal_operation_id")
200
- def _compute_operation_name(self):
201
- for doc in self:
202
- if doc.fiscal_operation_id:
203
- doc.operation_name = doc.fiscal_operation_id.name
204
- else:
205
- doc.operation_name = False
206
-
207
- @api.depends("fiscal_operation_id")
208
- def _compute_comment_ids(self):
209
- for doc in self:
210
- if doc.fiscal_operation_id:
211
- doc.comment_ids = doc.fiscal_operation_id.comment_ids
212
- elif doc.comment_ids is None:
213
- doc.comment_ids = []
214
-
215
- def _inverse_amount_freight(self):
216
- for record in self.filtered(lambda doc: doc._get_product_amount_lines()):
217
- if (
218
- record.delivery_costs == "total"
219
- or record.force_compute_delivery_costs_by_total
220
- ):
221
- amount_freight_value = record.amount_freight_value
222
- if all(record._get_product_amount_lines().mapped("freight_value")):
223
- amount_freight_old = sum(
224
- record._get_product_amount_lines().mapped("freight_value")
225
- )
226
- for line in record._get_product_amount_lines()[:-1]:
227
- line.freight_value = amount_freight_value * (
228
- line.freight_value / amount_freight_old
229
- )
230
- record._get_product_amount_lines()[-1].freight_value = (
231
- amount_freight_value
232
- - sum(
233
- line.freight_value
234
- for line in record._get_product_amount_lines()[:-1]
235
- )
236
- )
237
- else:
238
- amount_total = sum(
239
- record._get_product_amount_lines().mapped("price_gross")
240
- )
241
- for line in record._get_product_amount_lines()[:-1]:
242
- if line.price_gross and amount_total:
243
- line.freight_value = amount_freight_value * (
244
- line.price_gross / amount_total
245
- )
246
- record._get_product_amount_lines()[-1].freight_value = (
247
- amount_freight_value
248
- - sum(
249
- line.freight_value
250
- for line in record._get_product_amount_lines()[:-1]
251
- )
252
- )
253
- for line in record._get_product_amount_lines():
254
- line._onchange_fiscal_taxes()
255
- record._fields["amount_total"].compute_value(record)
256
- record.write(
257
- {
258
- name: value
259
- for name, value in record._cache.items()
260
- if record._fields[name].compute == "_amount_all"
261
- and not record._fields[name].inverse
262
- }
263
- )
264
-
265
- def _inverse_amount_insurance(self):
266
- for record in self.filtered(lambda doc: doc._get_product_amount_lines()):
267
- if (
268
- record.delivery_costs == "total"
269
- or record.force_compute_delivery_costs_by_total
270
- ):
271
- amount_insurance_value = record.amount_insurance_value
272
- if all(record._get_product_amount_lines().mapped("insurance_value")):
273
- amount_insurance_old = sum(
274
- record._get_product_amount_lines().mapped("insurance_value")
275
- )
276
- for line in record._get_product_amount_lines()[:-1]:
277
- line.insurance_value = amount_insurance_value * (
278
- line.insurance_value / amount_insurance_old
279
- )
280
- record._get_product_amount_lines()[-1].insurance_value = (
281
- amount_insurance_value
282
- - sum(
283
- line.insurance_value
284
- for line in record._get_product_amount_lines()[:-1]
285
- )
286
- )
287
- else:
288
- amount_total = sum(
289
- record._get_product_amount_lines().mapped("price_gross")
290
- )
291
- for line in record._get_product_amount_lines()[:-1]:
292
- if line.price_gross and amount_total:
293
- line.insurance_value = amount_insurance_value * (
294
- line.price_gross / amount_total
295
- )
296
- record._get_product_amount_lines()[-1].insurance_value = (
297
- amount_insurance_value
298
- - sum(
299
- line.insurance_value
300
- for line in record._get_product_amount_lines()[:-1]
301
- )
302
- )
303
- for line in record._get_product_amount_lines():
304
- line._onchange_fiscal_taxes()
305
- record._fields["amount_total"].compute_value(record)
306
- record.write(
307
- {
308
- name: value
309
- for name, value in record._cache.items()
310
- if record._fields[name].compute == "_amount_all"
311
- and not record._fields[name].inverse
312
- }
313
- )
314
-
315
- def _inverse_amount_other(self):
316
- for record in self.filtered(lambda doc: doc._get_product_amount_lines()):
317
- if (
318
- record.delivery_costs == "total"
319
- or record.force_compute_delivery_costs_by_total
320
- ):
321
- amount_other_value = record.amount_other_value
322
- if all(record._get_product_amount_lines().mapped("other_value")):
323
- amount_other_old = sum(
324
- record._get_product_amount_lines().mapped("other_value")
325
- )
326
- for line in record._get_product_amount_lines()[:-1]:
327
- line.other_value = amount_other_value * (
328
- line.other_value / amount_other_old
329
- )
330
- record._get_product_amount_lines()[-1].other_value = (
331
- amount_other_value
332
- - sum(
333
- line.other_value
334
- for line in record._get_product_amount_lines()[:-1]
335
- )
336
- )
337
- else:
338
- amount_total = sum(
339
- record._get_product_amount_lines().mapped("price_gross")
340
- )
341
- for line in record._get_product_amount_lines()[:-1]:
342
- if line.price_gross and amount_total:
343
- line.other_value = amount_other_value * (
344
- line.price_gross / amount_total
345
- )
346
- record._get_product_amount_lines()[-1].other_value = (
347
- amount_other_value
348
- - sum(
349
- line.other_value
350
- for line in record._get_product_amount_lines()[:-1]
351
- )
352
- )
353
- for line in record._get_product_amount_lines():
354
- line._onchange_fiscal_taxes()
355
- record._fields["amount_total"].compute_value(record)
356
- record.write(
357
- {
358
- name: value
359
- for name, value in record._cache.items()
360
- if record._fields[name].compute == "_amount_all"
361
- and not record._fields[name].inverse
362
- }
363
- )