Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[12.0] l10n_it_intrastat_statement: force round to 1 additional_units field only if has a value #2254

Merged
merged 1 commit into from
Apr 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,13 @@ def _prepare_statement_line(self, inv_intra_line, statement_id=None):
statement_id.company_id or company_id,
dp_model.precision_get('Account'))

# check if additional_units has a value
has_additional_units = bool(inv_intra_line.additional_units)
res.update({
'transaction_nature_id': transaction_nature_id.id,
'weight_kg': round(inv_intra_line.weight_kg) or 1,
'additional_units': round(inv_intra_line.additional_units) or 1,
'additional_units': round(inv_intra_line.additional_units) or (
0 if not has_additional_units else 1),
'statistic_amount_euro': statistic_amount,
'delivery_code_id': delivery_code_id.id,
'transport_code_id': transport_code_id.id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,13 @@ def _prepare_statement_line(self, inv_intra_line, statement_id=None):
statement_id.company_id or company_id,
dp_model.precision_get('Account'))

# check if additional_units has a value
has_additional_units = bool(inv_intra_line.additional_units)
res.update({
'transaction_nature_id': transaction_nature_id.id,
'weight_kg': round(inv_intra_line.weight_kg) or 1,
'additional_units': round(inv_intra_line.additional_units) or 1,
'additional_units': round(inv_intra_line.additional_units) or (
0 if not has_additional_units else 1),
'statistic_amount_euro': statistic_amount,
'delivery_code_id': delivery_code_id.id,
'transport_code_id': transport_code_id.id,
Expand Down