Commit Graph
78 Commits
Author SHA1 Message Date
william-andre d8d47f9ff8 [REF] accounting v16. Yeeeeaah
TLDR:
* invoices are implemented using computed methods instead of onchange
* the synchronization only happens when switching tabs in the Form view
  to improve perfs.

_______________________________________________________________________

The whole engine of the synchronization of Invoices to the Journal
Entries has been refactored
* by using computed fields instead of onchange functions
* by synchronizing only from invoice to journal entry in `create` and
  `write`
* by saving when switching tabs on the Invoice form, to synchronize
  before showing the values

This comes with numerous advantages:
* no need to call the onchange methods manually
* no need to use the Form emulator to build invoices (i.e. EDI, OCR,
  intercompany, ...)
* the performance for invoices with many lines improves drastically, going
  from 2 minutes to 4 seconds to create an invoice with 500 lines
* the model is more declarative, we can now see how the values are computed
  instead of having the values being copied from various places.
* remove the hack in `onchange` that disabled the recursivity of it,
  which was unexpected and needed to be managed manually in all the
  onchange methods

This means that:
* Some fields need to be exclusively computed on journal entries values
  or invoice values, more specifically the Tax Summary widget.
  It is now
    - computed from entry lines, when opening the view
    - computed from invoice lines when changing those, because the tax lines
      will need to be recomputed anyways, erasing previously set values
    - set with an inverse function when saving; after the sync has been done
* Some possible operations previously possible have been dropped.
  (i.e. look at the removed test test_in_invoice_line_onchange_accounting_fields_1)
  This is because such a behavior was undefined (how is changing the balance going
  to affect the unit price? How is the amount currency going to affect it?)

_______________________________________________________________________

Implementation Details
----------------------

The "dynamic lines", meaning the payment terms and the tax lines are now
only created in the `create` and `write` functions.
In order to reduce code duplication, it has been implemented using
context managers used in both `account.move` and `account.move.line`
These context managers help comparing the values before/after, acting
like a local `onchange`, but getting benefit from the dirty flags from
the `compute` dependences.
This is relying on computed fields on the move (`needed_terms`) and on
the lines (`compute_all_tax`) which contain the values needed for the
related move.
Depending on the needed values and the existing values (`term_key` and
`tax_key`, respectively) the context manager will determine what needs
to be created/updated/deleted.

Some related changes are to produce a `dict` instead of a `str` for the
`tax_totals` (previously `tax_totals_json`) fields, by simplicity to
reduce the complexity of IO, and simplicity of debugging, because the
logic of the field needed to change (cannot be computed at the same time
anymore since it needed the lines to be synced)

By simplicity, and also because it makes more sense, some boolean fields
have been merged into `display_type`:
* `is_rounding_line`
* `exclude_from_invoice_tab`
* `is_anglo_saxon_line`

The `price_unit`, `quantity` and other "invoice fields" are now not set
anymore on lines that are not product lines since it didn't make any
sense to have it.

Performances
------------

You have to keep in mind that a simple `create` didn't compute a lot of
fields, for instance not taxes were set, no payment terms,...
Now it does.

```python
import random
from timeit import timeit
from odoo import Command
domain = [('company_id', 'in', (False, self.env.company.id))]
products = self.env['product.product'].search(domain).ids
partners = self.env['res.partner'].search(domain).ids
taxes = self.env['account.tax'].search(domain).ids
def create(nmove, nline):
    self.env['account.move'].create([
        {
            'move_type': 'out_invoice',
            'partner_id': random.choice(partners),
            'invoice_line_ids': [
                Command.create({
                    'name': f'line{i}',
                    'product_id': random.choice(products),
                    'tax_ids': [Command.set([random.choice(taxes)])],
                })
                for i in range(nline)
            ]
        }
        for j in range(nmove)
    ])
                                                             # After  | Before
print(timeit("create(1, 1)", globals=globals(), number=1))   # 0.11   | 0.09
print(timeit("create(100, 1)", globals=globals(), number=1)) # 2.76   | 2.50
print(timeit("create(500, 1)", globals=globals(), number=1)) # 14.56  | 12.34
print(timeit("create(1, 100)", globals=globals(), number=1)) # 1.03   | 5.52
print(timeit("create(1, 500)", globals=globals(), number=1)) # 3.99   | 125.02
print(timeit("create(50, 50)", globals=globals(), number=1)) # 19.44  | 79.55
```

Another metric that can be used is running the test suite with
`--test-tags=/account` (only `account` installed)
* before: 404s, 267127 queries (366 tests)
* after: 318s, 232125 queries (362 tests)

Why this commit title?
----------------------

Someone told me that this was the perfect way of naming your commits.
c04065abd8

task-2711317

closes odoo/odoo#96134

Related: odoo/upgrade#3715
Related: odoo/enterprise#29758
Signed-off-by: Laurent Smet <las@odoo.com>
2022-08-03 13:44:49 +02:00
william 0f71c64237 [FIX] account: reduce locking on moves
By trying to avoid concurrency issues while assigning the sequence [1],
we are locking too many operations even when not in the process of
assigning a new number.
* when computing `highest_name`, we don't need to lock as this is mostly
  an information on the form that can possibly change anyway while the
  form view is open (without any lock anymore)
* when computing the accounting date, we don't need to lock, the only
  information we want is the format of the sequence (yearly, monthly, no
  reset), which is not likely to change on a same journal.
* when changing the `journal_id`, it is only a helper for encoding, if
  there is a concurrency error it will be shown during the post anyways.
  Also same argument as for `highest_name`

[1] https://github.com/odoo/odoo/commit/ba6ee0b75d66d6f22a592b1b6a7c5158461bec41

closes odoo/odoo#95480

X-original-commit: 809557cdd02fe6581ed573b58158a927aabe0694
Related: odoo/enterprise#29212
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
Signed-off-by: William André (wan) <wan@odoo.com>
2022-07-07 14:44:25 +02:00
Pablo Montenegro 075152d1a0 [FIX] l10n_ar: Delete “Unified Book” option on sale journals
Before this change, we bringed to the user the posibility to select the option “Unified Book” (boolean) on journals with type “Sales” and Pre-printed Invoice “AFIP POS System”. This allowed all documents with the same letter document to use the same sequence, and it does not matter if they are invoices, credit notes or debit notes for example.
Now that functionality is deleted and all documents will have their own sequence regardless of the letter document of each receipt.

closes odoo/odoo#88129

Signed-off-by: Josse Colpaert <jco@odoo.com>
2022-05-04 11:53:45 +02:00
Juan Jose Scarafia 06f08f770d [FIX] l10n_ar/cl: starting sequence
When getting l10n_ar/l10n_cl starting_squence check with the proper
company (self.company_id) and not self.env.company_id

We do not put a journal_id anymore as it should take the correct one
automatically in v15.

Original commit d6f4fee58edf103c63836ac488be240961fd671a

closes odoo/odoo#87219

X-original-commit: f2f76dfa195226b7604076830412706447c168f2
Signed-off-by: Josse Colpaert <jco@odoo.com>
2022-03-31 17:25:06 +02:00
Katherine Zaoral 39db0eaff4 [FIX] l10n_ar: share sequences compute sequences
Before this change, we have the errors that documents generated on
pre-printed sales journals mark as unified book were wrongly
named using the wrong doc prefix code.

This was visible thanks to the demo data were we notices that the credit
notes were having FA- doc prefix instead of NC-

This was because we are reusing the shared sequence directly, now we
check and fix the doc prefix for those cases and all documents generated
on shared sequences are properly named.

closes odoo/odoo#86612

X-original-commit: df5bfd22c20d3a3bd72b04acbdae63657e025ce3
Signed-off-by: Josse Colpaert <jco@odoo.com>
2022-03-31 17:25:02 +02:00
william-andre beb6e17066 [FIX] account: remove dead code complete_tax_set
This field was used in version 9.0 [1] to allow users to select their
tax rate, but it was removed in version 12 [2]

[1] https://github.com/odoo/odoo/commit/c04065abd8f62c9a211c8fa824f5eecf68e61b73
[2] https://github.com/odoo/odoo/commit/87f0d2eefb77bfc6a9a0fa7f7dcd1475c7c34639

closes odoo/odoo#80185

Related: odoo/enterprise#22441
Related: odoo/upgrade#3057
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2022-03-31 17:24:55 +02:00
Laurent Smet cd6c33575b [IMP] account: Add generic methods to help the taxes computation
Unify taxes computation between 'account', 'sale' and 'purchase' including:
- computation of price_subtotal/price_total.
- computation of business models total (using the json field)

closes odoo/odoo#80231

Task: 2654784
Related: odoo/enterprise#25620
Signed-off-by: Olivier Colson <oco@odoo.com>
2022-03-29 20:20:15 +02:00
Pablo Montenegro f0b90c9fa8 [FW][FIX] l10n_ar: AFIP currency rate.
We have a bug when we were computing the invoice rate that is used to
report to AFIP. The rate we were setting was an old rate that references
the day that the invoice was created and not the rate of the day where
the invoice was validated.  This was happening because the
l10n_ar_currency_rate field that stores this value was computed before
posting the invoice. At that time the date field store the value of the
date where the invoice was created and had not been updated yet with the
accounting date.

Moving the l10n_ar_currency_rate field calculation after the invoice
post solves the problem and now the l10n_ar_currency_rate has the rate
of the accounting date.

Part-of: odoo/odoo#84470

Original commit: aac1165655d31ba3bca4b105e0c905534e91df93

closes odoo/odoo#87163

X-original-commit: ac57ac559d973a1c4c2050fa514668d20bd610f0
Signed-off-by: Josse Colpaert <jco@odoo.com>
2022-03-25 10:23:16 +01:00
Katherine Zaoral 69e31db6ac [IMP] l10n_ar:_sanitize vat number method
* fix traceback when vat is not defined, return directly 0.
* remove api.model
* add ensure_one() to avoid misuse of the method

closes odoo/odoo#84952

X-original-commit: 5cd4df745462fcc12b9d92def9cf903ebd0df143
Related: odoo/enterprise#24565
Signed-off-by: Josse Colpaert <jco@odoo.com>
2022-02-20 20:39:50 +00:00
aliya 47cf4e8066 [FIX] l10n_ar, l10n_ec, l10n_pe: use fiscal country
Currently all latam localizations except Chile use country_id in _localization_use_documents().
account_fiscal_country_id should be used instead in all modules.

closes odoo/odoo#84756

Task: 2761248
X-original-commit: cf61089d9480d7450d2916911b0859cd5f6efcce
Signed-off-by: Olivier Colson <oco@odoo.com>
Signed-off-by: Tastemirova Aliya (alta) <alta@odoo.com>
2022-02-17 09:06:57 +00:00
Katherine Zaoral 90336071a1 [FIX] l10n_ar: sign used in vat book report
closes odoo/odoo#84397

X-original-commit: 597299c191089faaaca5f421634e411a824207d1
Signed-off-by: Josse Colpaert <jco@odoo.com>
2022-02-10 22:53:03 +00:00
Juan Jose Scarafia e450803e63 [FW][ADD] l10n_ar: refunds with liquido docs
Manual forward port of https://github.com/odoo/odoo/pull/78269

X-original-commit: 37989efe71799bd21da00a0fb9045433d7892604
Part-of: odoo/odoo#84397
2022-02-10 22:53:03 +00:00
Augusto Weiss 75c62022da [FIX] l10n_ar: currency rate on post method
The currency rate could be different if the invoice date is different that the accounting date

Steps to reproduce:
1- Install l10n_ar
2- Create two different currency rate for foreign currency (i.e: Dollar) with also different Date
3- Create an invoice setting the currency as foreign currency (i.e: Dollar)

Current behavior before PR:
In page "Journal Items" could see that each account line use the currency rate defined by the accounting date,
however the currency rate filed (which is not visible) is defined by the invoice date.

Desired behavior after PR is merged:
Use always the accounting date to set the currency rate

+ CLA signing Augusto Weiss

closes odoo/odoo#83689

X-original-commit: 21692f28fd1db7097e1d4c23ce7dcbaa76936449
Signed-off-by: Josse Colpaert <jco@odoo.com>
2022-01-31 15:33:41 +00:00
Raphael Collet a1904aa6f6 [IMP] core: field index names
The possible index names have been renamed "btree", "btree_not_null"
(instead of "not null") and "trigram" (instead of "gin").

Task 2742526

Part-of: odoo/odoo#83274
2022-01-28 14:10:01 +00:00
Merlin (megu) eb8ed07916 [FIX] l10n_ar: use E document types for invoices and bills
E documents cannot be selected for invoices and bills which is a problem for companies in Tierra del Fuego, a fiscal exception of Argentina

Steps to reproduce:
1. Install the l10n_ar module
2. Switch to the company '(AR) Responsable Inscripto'
3. Open the Invoicing app and go to Vendors->Bills
4. Create a new Bill and select '(AR) Responsable Inscripto' as vendor
5. The document type '(19) Facturas de exportacion' is not available

Solution:
Add 'E' as journal letter for AFIP responsibility type 'IVA Responsable Inscripto'

OPW-2713805

closes odoo/odoo#83119

X-original-commit: 27edc28a2c19fad80053e668a8c72e7a629e4c1a
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Guillaume Merlin (megu) <megu@odoo.com>
2022-01-20 17:39:16 +00:00
Fabien Pinckaers eedf37d6e2 [IMP] Better handling of indexes
Three supported types:
- btree (default for index=True)
- btree not null (when >90% of the data are null)
- gin trigram search (for char fields)

Review of indexes on all objects.

closes odoo/odoo#83015

Signed-off-by: Fabien Pinckaers <fp@odoo.com>
2022-01-19 16:52:23 +00:00
Juan Jose Scarafia cbfaa94e8f [FIX] l10n_ar: vat inclusion on invoice report
Prior to this commit the line amounts on the invoice report where including the VAT always. With this change we only include VAT if invoice needs to include it (_l10n_ar_include_vat)

closes odoo/odoo#82740

X-original-commit: 47996fdd4e8c79f876d669f73b18c6046a83c95e
Signed-off-by: Josse Colpaert <jco@odoo.com>
2022-01-14 09:25:46 +00:00
Yannick Tivisse b9194406ec [IMP] account: Avoid multiple rebrowse in get_fiscal_position
+ Make it private, as it is not supposed to be called from the
webclient.
2021-12-02 12:12:01 +01:00
Bruno Zanotti (ADHOC)andJuan Jose Scarafia 33c7f7d437 [IMP] l10n_ar: calculate removed latam fields
Adapt the module to calculate removed fields from latam localization

X-original-commit: c9536ab129c96582a784efe6a5bce133cad0d650
Part-of: odoo/odoo#78296
Co-authored-by: Juan Jose Scarafia <jjs@adhoc.com.ar>
2021-10-14 16:16:04 +00:00
Bruno Zanotti c9fa9803b9 [FIX] l10n_ar: return vat info grouped by tax
In the method _get_vat(), used to inform AFIP about the vat taxes of an
invoice, we were assuming that in the journal items of the invoices
there is always one line per tax group, but if the user enables the
option "Include in Analytic Cost" of the tax, then it could create more
than one line per tax so it will return an error if you try to validate
the invoice in AFIP or upload the vat book.

closes odoo/odoo#77526

X-original-commit: 67f5f0e86f0170f6066579749895e7d1e68d664c
Signed-off-by: Josse Colpaert <jco@openerp.com>
2021-10-06 09:16:42 +00:00
Juan Jose Scarafia 22117b2311 [FIX] l10n_ar: fix l10n_ar_currency_rate
If an invoice is posted, sended back to draft and the rate was change on res.currency, we preserve the value already existing on l10n_ar_currency_rate

closes odoo/odoo#77388

X-original-commit: 820df9eef856d841863306eab1e26d0437a408b0
Signed-off-by: Josse Colpaert <jco@openerp.com>
2021-09-29 11:23:45 +00:00
wan ac09bf94e2 [FIX] l10n_ar: do not touch other countries' document types 2021-07-19 10:14:24 +00:00
Katherine Zaoral 216b07eb46 [ADD] l10n_ar: AFIP RG 5003
Be able to create letter A documents to monotributista AFIP
responsibility types.

closes odoo/odoo#72667

X-original-commit: b204f7d1b0bcaf3984600d94395377c97facf168
Signed-off-by: William André (wan) <wan@odoo.com>
2021-06-25 11:50:32 +00:00
Bruno Zanotti (ADHOC) a83e32151b [IMP] l10n_ar: electronic invoicing of docs 60 and 61
Add mapping rules to enable the electronic invoicing of document types
"CUENTAS DE VENTA Y LIQUIDO PRODUCTO A" (60) and
"CUENTAS DE VENTA Y LIQUIDO PRODUCTO B" (61).

closes odoo/odoo#72619

X-original-commit: 9fb221459e1137c0622c14a57ec408b3b5f65fe6
Signed-off-by: William André (wan) <wan@odoo.com>
2021-06-23 11:31:21 +00:00
Bruno Zanotti (ADHOC) 9cb959e952 [FIX] l10n_ar: partner with not handled responsibility type
If a partner has a not handled responsibility type return an empty list
as possibles document types instead of raising an error.

closes odoo/odoo#69010

X-original-commit: abcba544043b08de4cffcf5affd12b08afec188f
Signed-off-by: Josse Colpaert <jco@openerp.com>
2021-04-08 19:24:09 +00:00
Bruno Zanotti (ADHOC) 2d8fb8991c [FIX] l10n_ar: Responsibility type "IVA No Alcanzado"
- Add a new responsibility type "IVA No Alcanzado"
 - Update the partner "AFIP" with that responsibility

X-original-commit: e3e20fdccc2ad7bf0015d4c0a67c7ab803a97bd8
2021-04-08 19:24:09 +00:00
oco-odoo 17610e8ca9 [IMP] account, account_edi, l10n_*, purchase, sale: Generalize the use of account_fiscal_country_id
Before, account_fiscal_country_id was only use for tax operations; and country_id was used for all the other accounting stuff. Now, with the new ability to use foreign tax reports (with foreign VAT fiscal positions), we can generalize the fiscal country, sot that it is the one that needs to be used for the whole accounting. Since foreign tax reports were not supported before, account_fiscal_country_id is already set on existing database as the country for the "main" accounting, so the impact of this change is small.

closes odoo/odoo#68349

Related: odoo/upgrade#2322
Related: odoo/enterprise#17299
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2021-04-01 12:09:20 +00:00
Bruno Zanotti (ADHOC) 2d0034689c [IMP] l10n_ar: original amount in VAT Book
Since AFIP requires to keep the original amounts in the txt files
for the digital VAT Book, we deprecate the option
'company_currency = True' in the methods used to prepare the data.

closes odoo/odoo#67927

Signed-off-by: Josse Colpaert <jco@openerp.com>
2021-03-16 11:06:11 +00:00
Josse Colpaert cbae410ee5 [FIX] l10n_ar: wrong fw-port as l10n_latam_country_code does not exist anymore
closes odoo/odoo#68181

X-original-commit: 82788f6b6a2501412b2deff8da70867b67db4d6f
Signed-off-by: William André (wan) <wan@odoo.com>
2021-03-21 10:17:02 +00:00
fw-bot 9fd700c82c [IMP] l10n_latam_invoice_document: Remove l10n_ar constraint on base latam module
Documents with `l10n_latam_document_type_id.code == '99'` just exists on **l10n_ar**
https://github.com/odoo/odoo/blob/13.0/addons/l10n_ar/data/l10n_latam.document.type.csv#L74 making this error arise
on other localizations which don't use it.

This was mistakenly introduced on 7748e0e

This method is inherited inside l10n_ar and we add this additional validation.

Original PR: https://github.com/odoo/odoo/pull/64831

closes odoo/odoo#68066

X-original-commit: 109b4b1aaac4d76ef273fb88d27e2b648331a266
Signed-off-by: Josse Colpaert <jco@openerp.com>
2021-03-18 11:00:33 +00:00
Jorge Pinna Puissant 28560f2cd5 [FIX] l10n_ar: error when opening products on e-commerce
- install e-commerce and l10n_ar;
- as a Public user open a product on the shop.

Before this commit, an 403 error was raised.

Now, the public user can navigate through the products.

opw-2462477

closes odoo/odoo#66839

X-original-commit: 9a047c6a2085eab23865d3d649940f1e71c9234b
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2021-02-25 12:46:35 +00:00
Katherine Zaoral f4cb05e2f9 [ADD] l10n_ar: generic changes to use in QR code
AFIP give us new resolution 4291 that request to print QR code in
printed version of electronic invoices. For that we:

1) update the xml report footer style
2) add generic method to sanitze the identification number we are
sending, the sanitize method is added here in order to be re used for
other functionalities across electronic invoice and reports. If we are
not able to sanitize the number then we show an error to the user
3) update translations to add new raise message translated term

NOTE: Fix pylint errors: This ones pop up when running this PR "Check Style'
in runbot

closes odoo/odoo#65034

Related: odoo/enterprise#15949
Signed-off-by: Josse Colpaert <jco@openerp.com>
2021-02-24 13:20:22 +00:00
wan 00ed98db4d [FIX] l10n_ar: add afip responsability for demo partner
Part of task 2124952

Populate fields that are required and added in dependencies of l10n_ar.

Remove an unused variable too as an act of kindness.
2021-02-17 08:39:29 +00:00
Juan Jose Scarafia d200931080 [FIX] l10n_ar: currency rate digits
AFIP currency rates goes up to 6 digits.
When invoicing exportation of services, AFIP requires to invoice on the exactly same rate. Without this change it was not possible for some currencies with 6 digits as CHF one.

The change takes effect without needing of updating module

closes odoo/odoo#63156

X-original-commit: 150493ca3fff8b44cf890205990dbd72cebdcb36
Signed-off-by: Josse Colpaert <jco@openerp.com>
2020-12-10 12:22:40 +00:00
Victor Feyens 1b67affe7d [FIX] *: avoid direct references to countries
Ensure the code works fine even if countries are deleted.

Also consider "re"-created countries after deletion, by only considering
the country code, not the data reference.

This should reduce support requests related to deleted countries, and
ease the resolution of such problems by the users themselves.

TASK ID - 2368842

closes odoo/odoo#60558

X-original-commit: 037012bc4e2935eb00a7f353529bb7ec55066733
Related: odoo/enterprise#14347
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2020-10-22 16:17:26 +00:00
Bruno Zanotti (ADHOC) 597f379284 [I18N] l10n_ar: add missing translations
closes odoo/odoo#60526

X-original-commit: a4871a7dbbc96399696dc9cd8424a4bcb7814262
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-10-22 11:52:09 +00:00
Nicolás Mac Rouillon f3014587e7 [FIX] l10n_ar: Previous verify for the partner property fpos then use auto_apply.
The problem here is before this changes, the fiscal position only take into account if them has "auto_apply" True, and for the cases that the partner has their property fiscal position configurate for a company this is not taking into account.

After this changes we evaluate for the property fiscal position for the partner and then if non result we seek a fiscal position with the auto apply and the responsability of afip.
So this the same as the original method do.

closes odoo/odoo#59875

X-original-commit: 5ddcad3cb1d6063b7be89e4f0bd35b89885f746b
Signed-off-by: Josse Colpaert <jco@openerp.com>
2020-10-13 14:19:24 +00:00
fw-bot 1c77b833d6 Cherry pick of 2b65a7c111232d31d5113565bb6a114486f0123c failed
stdout:

stderr:

closes odoo/odoo#58605

Error: could not apply 2b65a7c1112... [IMP] l10n_ar: Accounting Tour adaptation
Hint: after resolving the conflicts, mark the corrected paths
Hint: with 'git add <paths>' or 'git rm <paths>'
Hint: and commit the result with 'git commit'
Signed-off-by: Josse Colpaert <jco@openerp.com>
2020-09-29 13:46:59 +00:00
Bruno Zanotti (ADHOC) 9de59048a1 [FIX] l10n_ar: get_fiscal_position inheritance
The method get_fiscal_position was missing the @api.model decorator

closes odoo/odoo#58665

X-original-commit: 7cad8db251b62972b3a0ea8ca970014cd0f1b5c1
Signed-off-by: Josse Colpaert <jco@openerp.com>
2020-09-28 11:59:48 +00:00
Bruno Zanotti (ADHOC) 644234f7a5 [FIX] l10n_ar: number validation of no official document types
If a document type don't have AFIP code, like "FACTURAS Y COMPROBANTES
DEL EXTERIOR" or "NOTAS DE CREDITO Y REEMBOLSOS DEL EXTERIOR",
we don't have to validate the document number

closes odoo/odoo#58043

X-original-commit: 33cf9fdc0bf90a7246f3f67ada274e7a5519ee6b
Signed-off-by: Josse Colpaert <jco@openerp.com>
2020-09-18 14:20:24 +00:00
Bruno Zanotti (ADHOC) 9bfd1752cd [IMP] l10n_ar: "Argentinian" to "Argentinean"
Change all references of "Argentinian" with "Argentinean".

closes odoo/odoo#57670

Related: odoo/enterprise#13210
Signed-off-by: Josse Colpaert <jco@openerp.com>
2020-09-14 14:53:22 +00:00
Katherine Zaoral 1931a22835 [IMP] l10n_ar: Argentinean invoice report
Port foward from 13.0 branch. Also update the _get_name_invoice_report()
method to match the one in account module.

Also update the name of payment field that has been change in master version

* o.invoice_payment_ref is now o.payment_reference
2020-08-17 14:09:18 +00:00
fw-bot 600a1da6c3 [ADD] l10n_ar: add moved methods from l10n_ar_edi
This method will be change to generic and to be use for both
l10n_ar_edi and l10n_ar_reports modules

fw-port of 50882

closes odoo/odoo#55687

Related: odoo/enterprise#12329
Signed-off-by: Josse Colpaert <jco@openerp.com>
2020-08-10 13:48:57 +00:00
william 82dc0cb7b9 [IMP] account: soft post entries in the future
Add an easy way to not post the entries in the future when calling
post() on it, but rather set it to be auto-posted at accounting date.
This is useful when we are creating a lot of entries in batch and some
might be in the future, some in the past, and we don't want to separate
that in two batch every time. (asset, accrual, transfer,... )
2020-08-05 11:57:10 +00:00
Katherine Zaoral c8b2434d61 [FIX] l10n_ar: properly compute l10n_ar_vat field
Only compute l10n_ar_vat when this one is defined, if not then the field
should not be computed.

closes odoo/odoo#55246

X-original-commit: 4e2de8c858c2d55b227b8a2fd3f8226f9da91a9d
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-07-31 09:10:06 +00:00
Benjamin Frantzen (bfr) 6827951451 [FIX] l10_ar: fix constrains
- type has been renamed to move_type
- l10n_latam_use_documents is not writeable

X-original-commit: 048248d4c7b0ebd04652cc82652b2e11bfd1780b
2020-07-22 06:37:26 +00:00
Martin Trigaux 400cc4f14e [FIX] *: correct all or improve code translation lookup
This commit fixes all issues detected by the new pylint
gettext-variable test.
It converts some calls to the new syntax
  _("Foo %s", bar)

to progressively migrate the code to the new syntax.

A few calls were not technically incorrect but still detected by the
linter.

  _("Foo" +
    "Bar")

has been converted to

  _("Foo"
    "Bar")

as it has the same effect and make sure the argument is of type
asteroid.Const instead of BinOp).

closes odoo/odoo#53683

Related: odoo/enterprise#11467
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2020-06-30 10:19:59 +00:00
Martin Trigaux 4a92a183e8 [IMP] *: better construction of translatable content
Do not construct a message by putting together translatable bits, it
makes it hard to translate (out of context) and may not work for some
languages constructing the sentences differently.
Do not try to save bits, be explict.

Clarify constructions for long oneliners.
2020-06-18 13:03:34 +02:00
Martin Trigaux ba244cef01 [IMP] *: replace to new _() syntax
Using a few regex like
\((_\(.*%s.*)(\) % )([\w\[\]][\w .\[\]\(\)'"]*)\)
($1, $3))

Old syntax is still compatible but starts the migration to the new
syntax that catches error.
2020-06-18 13:03:34 +02:00
Katherine Zaoral b7421e5860 [FIX] l10n_ar: support multiple records inside constraint method
Before this change the constraint that check afip configurations has an ensure_one() that was throwing an error when we try to change journals in batch. Now the constraint support mutilple records at once and return the ValidationError message show information of the journal's which constraint aplies.

Also, we remove the print of the list of the invoices in the ValidationError message because this ones could be a really long list and it is not necessary, only knowing the journal is enough.

closes odoo/odoo#52914

X-original-commit: 710bb9f161da4718024c4454ce14a7dbc2d24c93
Signed-off-by: Josse Colpaert <jco@openerp.com>
2020-06-12 10:43:58 +00:00