The compute method of the `counterpart` field only keeps a maximum of 2
account codes. However, it attempts to do [0:2] on a set, which is not
syntactically correct in Python.
opw-682373
The "else" has to be removed because if a tax group named "X" is
the group of tax "A" and "B", the journal item corresponding to the invoice line
has the taxes "A", "B", and "X" set.
Introduced by 5a5ac1d7a5
in details:
[FIX] added analytic account in grouping key of because we need to create different journal items for each of the lines having a different analytic account.
[REF] added a function on account.tax that returns the grouping key and that could be inherited in another (community) module
When an account move line(aml) is created for an include base amount tax,
all the other taxes are impacted with this tax then the field tax_ids of
the created aml must contain the other taxes.
Example:
Considering an invoice line with:
-A price=90
-A fixed include base amount tax=10(incl_tax)
-A 21% tax(called tax)
The base amount for the 21% tax is equal to:
100 = 90 + 10(incl_tax)
When the invoice is validated, three amls are created:
One for the product with:
-Debit=90
-Credit=0
-Tax_ids=(incl_tax, tax)
-Tax_line_id=()
One for the incl_tax with:
-Debit=10
-Credit=0
-Tax_ids=(tax)
-Tax_line_id=(incl_tax)
One for the tax with:
-Debit=21
-Credit=0
-Tax_ids=()
-Tax_line_id=(tax)
In this way, the base amount of 21% in the "Declaration periodique TVA"
report is the sum of all the amls balance(credit-debit) linked to tax with
the field Tax_ids.
opw:681102
The previous wording was inaccurate and made users think it
was impossible to setup "Net EOM" payment terms.
Updated POT file accordingly, but not PO files because this
requires a proper new translation.
- add a new checkbox on fiscal position: TaxCloud API
- when computing this fiscal position, it will:
- return an existing tax if one exists for the same tax
percentage, state, zip and TIC Category
- or create and return this tax if it does not exists yet
- Create a data fiscal position: country U.S., tax cloud API
- In l10n_us, add a settings in accounting: compute tax automatically using tax cloud.
NB:
- The signature of map_tax has been modified to optionally specify the product
and the partner on which the tax is applied
- The avoid the validationerrors that may occur while evaluation the tax with Taxcloud
when a public user is on the frontend shop (website_sale), we have to execute the
error silently by logging it.
The computation of the total_invoiced field did not work in batch mode.
When displaying a company in a form view (field invoice_total comptued), the
children of this company are present in the cache and the value of the field
invoice_total will be prefetched for these children as well (at least in 9.0).
Most of the time this is redudant information and the same value is computed
for each child while most of the invoices are on the parent.
Batching the computation per partner allows to make one global query for all
partners.
Add test to make sure the total increase correctly after a test invoice
confirmation.
float_is_zero(value1-value2) is not equivalent to
float_compare(value1,value2) == 0, as the former will round after
computing the difference, while the latter will round before
opw:678588
Introduces two new options:
- confirm_so: to confirm the sale order on acquirer confirmation
- generate_and_pay_invoice: confirm_so + generation of invoice and
payment registration
Use case:
-enable multi currency (use UDS as company currency and EUR as secondary currency)
-create account account in a different currency (EUR)
-create journal for the bank account in EUR
-create a new tax included tax
-create a new bank statement in EUR journal and add one line
-reconcile
-Choose a counterpart with the included tax and click on reconcile
Before the fix:
After reconciliation the amount_currency for tax and expense were wrong.
You could check this in the journal items linked to the bank statement.
Video:https://youtu.be/678rFb4OE2Q
opw:680693
Before this revision, this was not possible to write
`statment_id` on multiple journal items at a time,
as the condition:
`if 'statement_id' in vals and self.payment_id:`
required `self` to contains only one record
On the cancelation of a bank statement line
reconciled with journal items created
by the registering a payment, in addition to unbind
the move with the statement line, the statement must be
unbind from the move, and the payment must be reset
to posted.
opw-680128
Cancelling a statement line should not remove the
according journal items if they are associated
to an `account.payment`.
In this case, this should simply remove
the `statement_id` of the move lines,
and unmark the `account.payment` as
reconciled.
opw-674896
When the report `account.report_invoice` was being deleted,
it was no longer possible to reset an invoice to draft.
This is related to revision
291561a197
In a batch reconciliation of journal items,
it could happen that multiple journal items
in a foreign currency required the creation
of an exchange entry
`aml_to_balance_currency |= aml`
But the statement `aml.matched_debit_ids[0] or aml.matched_credit_ids[0]`
requires a single browse record (singleton) to work
The partial reconciliation is supposed to be the same for all
the journal items to fix, we can therefore safely do
`aml = aml_to_balance_currency[0]` to overcome this issue.
In addition, in this condition, the full reconcile must be
skipped to avoid passing multiple times in the `create_exchange_rate_entry`
method (which is called in the method `create` of `account.partial.reconcile`
This has been reviewed by qdp.
opw-680044
When a chart of account is created, ir.values for the fields taxes_id
and supplier_taxes_id in the model 'product.template' are created.
But if one of this two taxes are deleted, there was a crash when
creating a new product template because the default tax was missing.
opw:680576