Commit Graph
49 Commits
Author SHA1 Message Date
Daniel Blanco d85a8acdcc [FIX] l10n_cl: modifications needed to create electronic vendor bill document type (46) since it is mandatory for some customers.
Adds new account to withhold vat tax, and new vat tax
Enables document type 46
Allow electronic docs in purchase journals
[FIX] l10n_latam_invoice_document Consider doc type 46 as a vendor document
More information -> https://www.sii.cl/preguntas_frecuentes/catastro/001_012_3665.htm

[RM] l10n_cl: remove _filter_taxes_included method

closes odoo/odoo#79479

X-original-commit: 0c34fe795cee7eb6f0c5678f9e505ccc9b6e57e8
Related: odoo/enterprise#22160
Signed-off-by: Josse Colpaert <jco@openerp.com>
2021-11-08 11:08:06 +00:00
Bruno Zanotti (ADHOC)andJuan Jose Scarafia ee7e20f49d [IMP] l10n_latam_invoice_document: remove fields
Fields removed:
 * l10n_latam_amount_untaxed
 * l10n_latam_tax_ids
 * l10n_latam_price_unit
 * l10n_latam_price_subtotal
 * l10n_latam_price_net

Methods removed:
 * compute_l10n_latam_prices_and_taxes
 * compute_l10n_latam_amount_and_taxes
 * _compute_invoice_taxes_by_group

We move the removed methods to l10n_ar and l10n_cl and now it returns
a dictionary with the removed fields as the keys.

X-original-commit: 667ffb286d27f1e7a834b15d8f61536e530acd6f
Part-of: odoo/odoo#78296
Co-authored-by: Juan Jose Scarafia <jjs@adhoc.com.ar>
2021-10-14 16:16:04 +00:00
oco-odoo 45c4a29e82 [FIX] l10n_latam_invoice_document: fix overridden function's name
It did not correspond to its parent, and hence wasn't called.

closes odoo/odoo#77112

X-original-commit: fe804d0882e0b378449f9c1c02a1e925c5779db8
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2021-09-27 16:56:35 +00:00
oco-odoo d9a3b938fe [IMP] account, sale, purchase, l10n_latam, l10n_ar: add the possibility to use subtotals above tax groups when displaying them
A new field on tax groups makes it now possible for this group to be displayed under a subtotal label. If not set, this defaults instead to "Untaxed Amount", keeping the traditional behavior. This is intended for withholding taxes, which can now be implemented with negative taxes and a tax group with this field set.

To do that, this commit entirely refactors the way amount_by_group worked, and replaces it with a more complete json field called tax_totals_json. It also streamlines the way taxe totals are displayed on invoices, PO and SO and makes it so that a common code is called instead of copy-pasting the same block 3 times as before.

[IMP] purchase: always display tax totals by groups on purchases orders

Before, tax totals on purchase.order's form were not shown by group, and were instead all aggregated in a single "Taxes" category. The same went for the pdf export. The portal view, though, did show the totals by group. We now display the tax groups in the same way all the time.

closes odoo/odoo#74138

Task: 2457374
Related: odoo/enterprise#19802
Related: odoo/upgrade#2670
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2021-09-02 14:15:13 +00:00
Katherine Zaoral 3654addf5c [IMP] l10n_cl, l10n_latam_invoice_document: move field
move l10n_latam_document_type_id_code field definition to latam module
in order to be re used by another latam localizations

closes odoo/odoo#75764

Related: odoo/enterprise#20513
Signed-off-by: Josse Colpaert <jco@openerp.com>
2021-09-01 09:38:51 +00:00
Nikunj Ladava 09f2e91105 [IMP] l10n_latam_invoice_document: remove sequence
- removed unsed l10n_latam_document_type_id from the sequence

task- 2464212
2021-08-03 13:01:39 +00:00
wan 0df91f7ca7 [FIX] l10n_latam_invoice_document: adapt compute method to constraint
The compute method `_compute_l10n_latam_document_type` could give
results that were not satisfied by the constraint
`_check_invoice_type_document_type`.
2021-07-19 10:14:25 +00:00
Josse Colpaert 6ab7290c36 [FIX] l10n_latam_invoice_document: do not restrict the inverse/onchange too much
The onchange/inverse would only be triggered in the case of manual document number (vendor bills)
or not highest_name, but in other localizations there are cases where we want to be more flexible
to when we change it and instead of inheriting the method, we can relax it here.

Also, it should have been avoided before already to change the document number and type in those situations
through the attributes in the view e.g.  This seems to have been more like an extra fail-safe blocking us
elsewhere.

closes odoo/odoo#73397

X-original-commit: a3f8e53deb45034250820ff54ba76288af167b6e
Signed-off-by: William André (wan) <wan@odoo.com>
2021-07-07 17:42:10 +00:00
Bruno Zanotti (ADHOC) b039bd92d5 [FIX] l10n_latam_invoice_document: unit price rounding
For the unit price (field l10n_latam_price_unit), we need the number
rounded based on the product price precision.

To compute it we use the method compute_all that rounds using the
currency accuracy, so to fix this we multiply and divide for
10^(decimal accuracy of product price) to get the price correctly rounded.

Steps to replicate the error:
    1) In a base with l10n_ar localization installed change the decimal
       accuracy of "Product Price" to 5 digits (keeping the currency
       precision in two digits).
    2) Create an invoice with a product with price $10.12345
    3) Print the invoice and check the column price unit.
       Before this commit, the price unit would be $10.12000.

closes odoo/odoo#72579

X-original-commit: 17e19c6bf787fd2bf77476ffcfa1d934058aa7ec
Signed-off-by: William André (wan) <wan@odoo.com>
2021-06-22 18:39:04 +00:00
Bruno Zanotti (ADHOC) 6101a19512 [FIX] l10n_latam_invoice_document: monetary fields
The fields l10n_latam_price_unit and l10n_latam_price_net should be
float instead of monetary in order to show rightly the decimal
accuracy on invoice's reports

closes odoo/odoo#69344

X-original-commit: 59afbc2e34c80516fa412de92f0d3bba2378661e
Signed-off-by: Josse Colpaert <jco@openerp.com>
2021-04-15 18:33:53 +00:00
Bruno Zanotti (ADHOC) e658ca9100 [FIX] l10n_latam_invoice_document: IVA on b2c invoices
For b2c invoices we mustn't show the IVA information on the reports

closes odoo/odoo#68758

X-original-commit: 4e31502f317fabc2004bd6db32883ce357563c57
Signed-off-by: Josse Colpaert <jco@openerp.com>
2021-04-03 10:49:03 +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
Josse Colpaert ca4a25d884 [FIX] l10n_latam_invoice_document: only trigger constraint when partner_id is set
Before, when importing twice the same invoice, or even with the more
theoretical possibility of having the same number for different partners,
the constraint would be triggered, giving unnecessary problems when
importing vendor bills with an uncertain partner_id.

If we check the logic followed in the regular accounting on the ref field,
it only triggers when a partner is set, so we can follow the same logic here.

closes odoo/odoo#68408

X-original-commit: 9cbf63bd644d6d6d629266fe31edc91b44f22aa6
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Josse Colpaert <jco@openerp.com>
2021-03-26 14:39:01 +00:00
Bruno Zanotti (ADHOC) d757c02d8c [FIX] l10n_latam_invoice_document: update of the method _compute_invoice_taxes_by_group
Odoo has made some modifications to the method
_compute_invoice_taxes_by_group from de Account module,
so we need to update the inherited method in the argentinian localization

Improves:
 - Don't depend on price_subtotal to compute amount_by_group
 - Show taxes when they are zero on invoices print

closes odoo/odoo#68178

X-original-commit: 011631a38564bcbdd8625428b9f897aefefce270
Signed-off-by: Josse Colpaert <jco@openerp.com>
2021-03-20 23:47:27 +00:00
Nicolás Mac Rouillon cee7b7cb1f [FIX] l10n_latam_invoice_document: For the latam invoice reporte show the base property in the correct value and currency
The problem that occurs before of this commit, is due the base of the taxes is in the currency of the company not in the invoice currency. For that the value that shows in this cases for the base is not correponding for the symbol of the currency.
After this changes we show the correct value an symbol for the base converting the value when is necessary.

X-original-commit: 4fd4f82ecd1b97f608168baaa780844f68e8a9d7
2021-03-20 23:47:27 +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
wan 072558c43d [FIX] l10n_latam_invoice_document: compute document type multi
Part of task 2124952
2021-02-17 08:39:29 +00:00
Nasreddin (bon) eb0b664349 [FIX] account: Negative fixed taxes on 100% discount
Issue

	- Install 'Accounting' module
	- Create a new 'Tax' X with a fixed price (e.g.: O.O57 $)
	- Create a new 'Customer Invoice'
	- Add a product P and set unit price to 0 $
	- Set tax X to product P

	Total tax amount : - 0.06 $ .

Solution

	The sign must be forced to a negative sign in case the balance is on credit
	to avoid negatif taxes amount.

enterprise PR : https://github.com/odoo/enterprise/pull/15035

opw-2378978

closes odoo/odoo#62758

X-original-commit: 684855529e8aaafa0cb90f958d19c563d6e2a897
Related: odoo/enterprise#15105
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
2020-12-02 15:51:55 +00:00
Nicolás Mac Rouillon 51897a1499 [FIX] l10n_latam_invoice_document: Wrong calculation for the subtotal in the invoice report.
For this case, if the invoice currency is different from the invoice company currency, the tax calculation is considered the value in a different currency, and the subtotal is the sum of the amount untaxed + the taxes (wrongly in company currency) result in an incorrect value. This is verified when printing the invoice report

closes odoo/odoo#62388

X-original-commit: 91f152f479923a1d28dadcb3ded7c0296cc585fc
Signed-off-by: Josse Colpaert <jco@openerp.com>
2020-11-26 11:23:25 +00:00
Denis Ledoux 839c1857fe [FIX] l10n_latam_invoice_document: skip document_type computation on install
Skip the computation of the field `l10n_latam_document_type_id` at the module installation.

The case has been detected during an upgrade from Odoo 12.0 to Odoo 13.0,
but the case could really well happen outside the context of an upgrade,
for instance when you create a new subsidiary in Chile or Argentina
while you already have a lot of accounting entries in your other subsidiaries
(e.g. Odoo S.A. opens a new office in Chile and has to install `l10n_cl`)

Without this, at the module installation,
it would call `_compute_l10n_latam_document_type` on all existing records
which can take quite a while if you already have a lot of moves. It can even fail with a MemoryError.

In addition, it sets `_compute_l10n_latam_document_type = False` on all records
because this field depends on the many2many `l10n_latam_available_document_type_ids`,
which relies on having records for the model `l10n_latam.document.type`
which only happens once the according localization module is loaded.
(e.g. `l10n_cl/data/l10n_latam.document.type.csv`)

The localization module is loaded afterwards, because the localization module depends on this module,
(e.g. `l10n_cl` depends on `l10n_latam_invoice_document`, and therefore `l10n_cl` is loaded after)
and therefore there are no records for the model `l10n_latam.document.type` at the time this fields
gets computed on installation. Hence, all records' `_compute_l10n_latam_document_type` are set to `False`.

In addition, multiple localization module depends on this module (e.g. `l10n_cl`, `l10n_ar`)
So, imagine `l10n_cl` gets installed first, and then `l10n_ar` is installed next,
if `l10n_latam_document_type_id` needed to be computed on install,
the install of `l10n_cl` would call the compute method,
because `l10n_latam_invoice_document` would be installed at the same time,
but then `l10n_ar` would miss it, because `l10n_latam_invoice_document` would already be installed.

Besides, this field is computed only for drafts invoices, as stated in the compute method:
`for rec in self.filtered(lambda x: x.state == 'draft'):`
So, if we want this field to be computed on install, it must be done only on draft invoices, and only once
the localization modules are loaded.

It should be done in a dedicated post init hook,
filtering correctly the invoices for which it must be computed.

Though I don't think this is needed.
In practical, it's very rare to already have invoices (draft, in addition)
for a Chilian or Argentian company (`res.company`) before installing `l10n_cl` or `l10n_ar`.

```
Traceback (most recent call last):
  File "/src/odoo/13.0/odoo/service/server.py", line 1190, in preload_registries
    registry = Registry.new(dbname, update_module=update_module)
  File "/src/odoo/13.0/odoo/modules/registry.py", line 86, in new
    odoo.modules.load_modules(registry._db, force_demo, status, update_module)
  File "/src/odoo/13.0/odoo/modules/loading.py", line 423, in load_modules
    loaded_modules, update_module, models_to_check)
  File "/src/odoo/13.0/odoo/modules/loading.py", line 315, in load_marked_modules
    perform_checks=perform_checks, models_to_check=models_to_check
  File "/src/odoo/13.0/odoo/modules/loading.py", line 202, in load_module_graph
    registry.init_models(cr, model_names, {'module': package.name}, new_install)
  File "/src/odoo/13.0/odoo/modules/registry.py", line 364, in init_models
    env['base'].flush()
  File "/src/odoo/13.0/odoo/models.py", line 5458, in flush
    self.recompute()
  File "/src/odoo/13.0/odoo/models.py", line 5875, in recompute
    process(field)
  File "/src/odoo/13.0/odoo/models.py", line 5859, in process
    recs.mapped(field.name)
  File "/src/odoo/13.0/odoo/models.py", line 5266, in mapped
    recs = recs._mapped_func(operator.itemgetter(name))
  File "/src/odoo/13.0/odoo/models.py", line 5225, in _mapped_func
    vals = [func(rec) for rec in self]
  File "/src/odoo/13.0/odoo/models.py", line 5225, in <listcomp>
    vals = [func(rec) for rec in self]
  File "/src/odoo/13.0/odoo/models.py", line 5690, in __getitem__
    return self._fields[key].__get__(self, type(self))
  File "/src/odoo/13.0/odoo/fields.py", line 2329, in __get__
    return super().__get__(records, owner)
  File "/src/odoo/13.0/odoo/fields.py", line 995, in __get__
    self.compute_value(recs)
  File "/src/odoo/13.0/odoo/fields.py", line 1109, in compute_value
    records._compute_field_value(self)
  File "/src/odoo/13.0/odoo/models.py", line 3968, in _compute_field_value
    field.compute(self)
  File "/src/odoo/13.0/odoo/fields.py", line 579, in _compute_related
    record[self.name] = self._process_related(value[self.related_field.name])
  File "/src/odoo/13.0/odoo/models.py", line 5699, in __setitem__
    return self._fields[key].__set__(self, value)
  File "/src/odoo/13.0/odoo/fields.py", line 1070, in __set__
    self.write(protected_records, value)
  File "/src/odoo/13.0/odoo/fields.py", line 2564, in write
    cache.update(records, self, [cache_value] * len(records))
  File "/src/odoo/13.0/odoo/api.py", line 768, in update
    field_cache.setdefault(record_id, {})[key] = value
MemoryError
```

Upgrade request 49495

closes odoo/odoo#60573

X-original-commit: f2a08faa1e65cb381315cbd5d1a359901e8b7deb
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
2020-10-22 20:49:20 +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
Katherine Zaoral 6b2d2bb18d [IMP] l10n_latam_invoice_document: remove context key
internal_type context key is not used anymore, now use the
debit_origin_id directly to know if the current account.move is a debit note

closes odoo/odoo#56673

X-original-commit: c45edd11a048d4822b1ffd5dcebdb63d0e0e8f45
Signed-off-by: Josse Colpaert <jco@openerp.com>
2020-08-27 14:39:23 +00:00
oco-odoo c07685e362 [IMP] l10n_ar, l10n_cl, l10n_latam_invoice_document: replace l10n_latam_country_code field by newly-introduced country_id
This new field was introduced in master by https://github.com/odoo/odoo/commit/013936261b26c601ce55015dbbbb99a7313a9a39 , making l10n_latam_country_code redundant.

closes odoo/odoo#56181

Related: odoo/upgrade#1666
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2020-08-20 08:00:30 +00:00
Raphael Collet 1f48130d2b [REF] core: _name_search() now returns a list of ids
This provides a better API to search for records by name without the
formatting part (`display_name`).

This also simplifies all the overridings of `_name_search` that no
longer need to call `name_get()`.  The call to `name_get()` is done in
method `name_search` in a generic way.
2020-08-18 13:02:41 +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
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 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 e8286ce4d9 [IMP] l10n_latam_invoice_document: adapt to new sequences
* remove logic of sequences in invoices and use new logic to set invoices sequences.
* re add l10n_latam_document_number field to make the sequence set possible.
* replace type field with move_type field in model account.move
* add new field l10n_latam_manual_number to know when the document number should be or not set
* update compute highest_name everytime that the journal and document type change.
* implement how we deal with first number
* for customer invoices only compute the name after they has been posted
* be able to search by document type code
* update translations
2020-04-01 16:48:53 +00:00
Pratima Gupta 2c93b994f2 [IMP] l10n_xx: use country_code field
l10n_latam_country_code field is no more needed for account.move
object thanks to commit 7edb5c11

Also, since country_code field has been defined in view_move_form,
no need to redefine it when it is inherited in l10n_cn module.

closes odoo/odoo#48719

Task: 2228210
Signed-off-by: Josse Colpaert <jco@openerp.com>
2020-04-01 14:23:20 +00:00
Katherine Zaoral 191530059f [IMP] l10n_ar: be able to generate refunds for OTROS COMPROBANTES document type
This document does not have any credit/debit note related documents, so
when a credit/debit not is required then the same document type is used.
This only applies in vendor bills so we are able to create the credit
note with this type of document

closes odoo/odoo#48117

X-original-commit: 7748e0e87fd3f4677a4026ed06516d36e8d52ad5
Signed-off-by: Josse Colpaert <jco@openerp.com>
2020-03-20 13:53:39 +00:00
Xavier Morel ff53bdfb09 [FIX] l10n_latam_invoice_document: check of account_move type
The `type` field was renamed `move_type` in
d675dbaa4c but a forward-port re-added a
use of the old `type` name, which breaks if an account.move is
unlinked while l10n_latam_invoice_document is unlinked (and there are
related moves to update).

Instead of renaming the field, use the proper utility method for the
category (purchase) provided by account.move.

closes odoo/odoo#47301

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2020-03-10 14:54:42 +00:00
Christophe Monniez 952c668b82 [FIX] account, l10n_latam_invoice_document: fix move_type typo
Two typos were introduced with d675dbaa4c.

closes odoo/odoo#45926

Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2020-02-21 12:18:32 +00:00
Ankita Raval d675dbaa4c [IMP] account,* : Change type field to move_type in account.move
task-id: 2028z813
2020-02-19 09:09:20 +00:00
Katherine Zaoral 62516ae5ff [FW][FIX] l10n_latam_invoice_document: proper validate vendor bills
Formerly the vendor bills, customer invoices and regular journal items were
evaluated by the _check_unique_sequence_number method, but this is wrong
and also was overwritten Odoo original constraint error message.

Now the _check_unique_sequence_number evaluate the account.moves that are
not vendor bills that use documents because this kind of bills uniqueness
depends on the vendor: we can have same name of vendor bill from different
partners. This is evaluated in the already existing
_check_unique_vendor_number method

closes odoo/odoo#44813

closes odoo/odoo#45643

Original-signed-off-by: Josse Colpaert <jco@openerp.com>
X-original-commit: beaa3bbacd4bd35ed11962a7466f111e5e85f0d8
Signed-off-by: Josse Colpaert <jco@openerp.com>
2020-02-18 14:09:25 +00:00
fw-bot 7954594d12 [FW][REF] account: new method _prepare_default_reversal
to be able to inherit these methods to make it easier to
add fields in the refund wizard e.g.

closes odoo/odoo#44629

X-original-commit: e814374a20de096fd795aec34ab0e3de4977fc85
Signed-off-by: Josse Colpaert <jco@openerp.com>
2020-02-06 10:02:56 +00:00
wan dfd01b8c5c [IMP] account: rework name sequences
Task 2146469

Rework the name computation:
* It doesn't use ir.sequence anymore
* It is an editable computed field
* Add a renaming tool

This allows the user to tweak the sequences more easily than having to
get through the ir.sequence settings.

The sequence depends on a parameter of the journal: continuous, montly
and yearly restart of the sequence. Everytime a new period is started,
try to make a pattern form another period.

The incrementing is done by taking the previous name, ordered
lexicographically, splitting it by taking the digits at the end, adding
1 and re contstruct with the prefix.

** This means there could be cases where the prefix has a big importance
on the next number. For instance, if you have
INVOICE/2019/0001
INVOICE/2019/0002
and then rename the last one to INV/2019/0002, don't expect the next
number to be INV/2019/0003. It will be INVOICE/2019/0002 (again) because
the highest number was INVOICE/2019/0001.
You will then end up with
INVOICE/2019/0001
INV/2019/0002
INVOICE/2019/0002

closes odoo/odoo#41485

Related: odoo/enterprise#7189
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2020-02-05 13:59:43 +00:00
Juan Jose Scarafia 58732e4dc8 [FIX] l10n_latam_invoice_document: bill unlink
closes odoo/odoo#44415

X-original-commit: fd8af7976b83656256edb563552edb7d4d324650
Signed-off-by: Josse Colpaert <jco@openerp.com>
2020-01-31 16:29:29 +00:00
Carlos Lopez f9e5f58b7d [FIX] l10n_latam_invoice_document: value by default in compute one2many field should not be []
closes odoo/odoo#43983

X-original-commit: 1940796daf5302c889dc14e187d178541120554e
Signed-off-by: Josse Colpaert <jco@openerp.com>
2020-01-27 09:06:02 +00:00
Katherine Zaoral 07f6479101 [FIX] l10n_ar: Proper filtered document types for foreign partners
When create an invoice for a foreign customer, the document types are not showed and filtered. This is happening because there is not journal defined for exportation operations. Once this one is created all the proper filters for the document types and journals are working ok.

This PR add a redirect warning when trying to create an invoice for a foreign partner when we do not have defined the expo sale journal. This also alert the user that is a missing configuration that is affecting to the compute of the available document types. I applied the same for the local/intern case

closes odoo/odoo#43913

X-original-commit: c7bd13bbd2879dded677bb223ff857fb9c959c60
Signed-off-by: Josse Colpaert <jco@openerp.com>
2020-01-24 11:43:30 +00:00
Katherine Zaoral 5171a8c45d [FIX] l10n_ar, l10n_latam_invoice_document: make reference to old open and paid states on invoice
Now use direclty the posted state from account move.

* This was changed in a constraint in l10n_latam_invoice_document module, also extend the constraint docstring
* This old states where also in a view domain in l10n_ar module for account.move view. We remove the field for the view (AFIP Responsibility) instead of fix the state name.

closes odoo/odoo#42982

X-original-commit: 33a5cfe068323f7fc4c92f42fadb8e236954d93a
Signed-off-by: Josse Colpaert <jco@openerp.com>
2020-01-08 17:05:57 +00:00
Katherine Zaoral 466203311e [FIX] l10n_latam_invoice_document: manual taxes widget
Before this change the manual taxes widget in the invoice form view was
broken for Argentinian invoices, with this change now the widget is
working.

It was broke because this method is used for the report/portal and
manual taxes in widget in the form view, and for Argentinian case
report/portal invoice should not discriminate some of the taxes depending og
the responsibility of the customer/issuer and the type of document
(example: Factura A, Factura B).

Also update the method in order to match the original one in odoo
account module and add missing group_id

closes odoo/odoo#40400

X-original-commit: 6260da7604b2a831668be42bf8745c53a09e8d16
Signed-off-by: Josse Colpaert <jco@openerp.com>
2019-11-18 09:40:26 +00:00
Carlos Lopez 1a2c9f5b17 [FIX] l10n_ar: avoid to read all records with a limit 1
closes odoo/odoo#39268

X-original-commit: c4f5007537bb6d6a0d0d4d3d719d79a972728243
Signed-off-by: Josse Colpaert <jco@openerp.com>
2019-10-30 16:51:36 +00:00
Katherine Zaoral 2b221edb49 [IMP] l10n_latam_invoice_document: remove include recipts
Since we are not using document only in invoice by now we remove the
option to incoude receipts.

closes odoo/odoo#38842

X-original-commit: af0703f959357120ec9a8ea674e02faaddfefb85
Signed-off-by: Josse Colpaert <jco@openerp.com>
2019-10-15 21:42:12 +00:00
Juan Jose Scarafia c96aad0cb1 [FIX] l10n_latam_invoice_document: document_type default value
The detected errors is about a normal field
(l10n_latam_document_type_id) which is written by a computed method
(_compute_l10n_latam_documents) making that the normal field value be
overwritten the value given by the user everytime the compute field is
re computed with the default value given by the compute.

We remove this write n the compute method and now we use and onchange
instead.

IMPORTANT: the l10n_latam_available_document_type_ids computed field is
changed from a m2m to a o2m to be able to use it on the new onchange

closes odoo/odoo#38973

X-original-commit: 96c70bb1eb34198b03eb21f00b57f819367677c4
Signed-off-by: Josse Colpaert <jco@openerp.com>
2019-10-17 16:24:04 +00:00
Juan Jose Scarafia a3a5625c6a [IMP] l10n_latam_invoice_document: refund sequence on journals
On l10n_latam_invoice_document, if a sales/purchase journal use documents, then the journal sequences are not used, with this improvement the user don't see fields that are no needed (Credit Notes Next Number) and also it avoids the creation of the refunds sequences that is not going to be used

closes odoo/odoo#38335

X-original-commit: 1b647b8ead1fc70c18223914c96619c7f9a21b6e
Signed-off-by: Josse Colpaert <jco@openerp.com>
2019-10-10 06:34:31 +00:00
Katherine Zaoral 45719f7d83 [FIX] l10n_latam_invoice_document: properly compute l10n_latam_price_subtotal
Take into account the line discount in the price.

closes odoo/odoo#37171

Signed-off-by: Josse Colpaert <jco@openerp.com>
2019-09-19 19:45:43 +00:00
Katherine Zaoral a9b7628706 [REF] l10n_ar, l10n_latam_base, l10n_latam_invoice_document: adjustments
l10n_latam_base:

* update translations
* extend manifest
* update manifest, delete new menus/fields/models from manifest

l10n_latam_invoice_document:

* update translations
* remove filter journals for recipts
* make method private
* extend manifest
* update manifest, delete new menus/fields/models from manifest
* misspelling error in ValidationError
* fixup missing change apply before merge/rebase

l10n_ar:

* make method private
* update translations
* catch error when stdnum.ar.format
* fiscal position with criteria diff from Responsibility
* Install AR CoA now set properly the company values.
* add meaning of CUIT when mentioned in code.
* unse a simplier elif and less conditions to evaluate
* only get concept for invoice lines that are not section/note
* remove TODO comments, this will be not implemented in this version
* update to sincular al the AFIP POS System options
* return match responsability type directly
* improve of manifest
* reference to tax group
* remove old not used file fot tax report
* update comments from spanish to english
* only set afip serive date when post the account.move
* unused file
* sum recordsets instead of union
* method name and remove log
* update manifest, delete new menus/fields/models from manifest
* Simply extra steps when loading AR COA: check directly
  get_ar_responsibility_match in order to apply the extra verifications
  and the extra configs in the company
* update demo refences to new demo for odoo
* return missing fix about _l10n_ar_create_document_sequences
* fixup missing change apply before merge/rebase
* set journal data as no update data.

closes odoo/odoo#36137

Signed-off-by: Josse Colpaert <jco@openerp.com>
2019-09-13 15:22:13 +00:00
Katherine Zaoral af0d0dcf61 [FIX] l10n_latam_invoice_document: invoice report
* remove l10n_latam_amount_tax field: This one is not really neccesary since was used for CITI reports and this ones were deprecated.
* improve invoice report view inherit: Improve way to make inherit for report invoice using position attribute
instead of position replace.
* Report amounts:

  * for excluded reports get price unit computing (and not price_unit) to get the untaxed price if the line has taxes with price included (as in sales)
  * fix l10n_latam_price_subtotal for report with taxes included and tax included on the price

closes odoo/odoo#36716

Signed-off-by: Josse Colpaert <jco@openerp.com>
2019-09-13 15:26:32 +00:00
Katherine Zaoral 895f89ff2d [ADD] l10n_latam_invoice_document: new module to manage documents types
This module special for Chile and Argentina, although e.g.
Brasil and the Domenican Republic could use it too in the
future.

The number of an invoice does not just depend on the journal, but
also on the document type which depends on the type of client you
will send your invoice to.  So, each of these needs their own sequence.

For the vendor bills, LATAM countries are really not used to an internal
reference number, so the internal number is immediately the one of
the vendor.

A special case is also that on certain documents, certain taxes need to be
included in the backend, but should not appear on the ticket (hidden,
but still included in the net price)
2019-08-22 16:18:40 +00:00