Commit Graph

65 Commits

Author SHA1 Message Date
Alexis de Lattre
ce597129ec [IMP] intrastat_product: if module product_net_weight is installed, use it
If the OCA module product_net_weight from
https://github.com/OCA/product-attribute is installed, use the field
net_weight added by this module instead of the native weight field
2024-09-30 17:57:00 +02:00
Daniel Reis
4f1734aa04 [REF] intrastat_product: fix lint 2024-09-12 08:53:33 +01:00
Alexis de Lattre
bd2eedc6ea [MIG] intrastat_product to v17 2024-03-26 17:07:51 +01:00
Alexis de Lattre
ef41f027bb intrastat_product: auto reformatting to prepare v17 migration 2024-03-26 17:07:51 +01:00
Alexis de Lattre
6ad0bf6546 intrastat_product: add confirmed state
Add a third step "confirmed" between "draft" and "done". It is necessary
to have error messages of XML file generation that refer to declaration
lines.

Add line_number on declaration line, to be used in error message when
generating XML file.

note field moved from fields.Text to fields.Html

Improve display_name of intrastat.product.declaration

Add store=True on 3 computed fields (reporting_level on
declaration, src_dest_country_code and product_origin_country_code on
computation lines). It fixes a bug on src_dest_country_code and
product_origin_country_code on computation lines, when you could not set
manually a country code while leaving the m2o field empty.
2024-03-26 17:07:51 +01:00
Aritz Olea
c3e1d21967 [FIX] intrastat_product: Do not display missing VAT number error when fiscal position is B2C 2024-03-26 17:07:51 +01:00
Alexis de Lattre
c3888b72ba [IMP] intrastat_product: method for XLSX filename 2024-03-26 17:07:51 +01:00
Jérémy Didderen
defaadfe5d [FIX] intrastat_product - set region_code based on code or the region 2024-03-26 17:07:51 +01:00
Alexis de Lattre
60345345a9 intrastat_product: suppl_unit_qty rounded to 1 if between 0 and 0.5
Improve comment in the code about rounding
2024-03-26 17:07:51 +01:00
Alexis de Lattre
938f592365 intrastat_product: use shipping partner instead of invoicing partner if any
Replace @api.onchange by compute methods with store=True, precompute=True and readonly=False for vat and region_code fields of computation lines
2024-03-26 17:07:51 +01:00
Alexis de Lattre
1630ba6e19 intrastat_product: fix strings 2024-03-26 17:07:51 +01:00
Alexis de Lattre
4c08be7bde intrastat_product: single XLSX export
There is now a single XLSX export that has 2 tabs:
1) computation lines
2) declaration lines
The declaration type is now mentionned in the XLSX export.
Ability to export several declarations in 1 XLSX file.
2024-03-26 17:07:51 +01:00
Alexis de Lattre
c6fe5c7611 [MIG] intrastat_product to v16
This migration has been made from the v14 branch akretion/14-brexit-simplification-and-type-on-fp and the changes of v15 has been re-integrated.

As discussed on https://github.com/OCA/intrastat-extrastat/issues/194
the intrastat transaction codes are now integrated in the module intrastat_product

The default value for transaction_id depending on the move_type of the
invoice have been dropped on fiscal position and company: Odoo sets 11
when fiscal position is B2B and 12 when fiscal position is B2C.
As a consequence: intrastat.transaction: company_id = False by default

Use textwrap for name_get() of intrastat.transaction

partner_id on computation line is not a related field any more: it allows
to auto-fill VAT from partner_id when creating a line manually.

computation and declaration line tree view: display transaction code
instead of transaction_id to save space
2024-03-26 17:07:51 +01:00
Alexis de Lattre
f15ec4ed44 intrastat_product: Backport updates from v15
Make tests work
2024-03-26 17:07:51 +01:00
Alexis de Lattre
6c201298fa intrastat_product: re-write the generation of the messages in the warning pop-up
This is completely new implementation of the messages that are displayed
in the warning pop-up:
- no double messages
- messages are grouped by section and record
- nice HTML display insead of raw text
2024-03-26 17:07:51 +01:00
Alexis de Lattre
82ea30d1bd intrastat_product: Improve warning message on intrastat transaction 2024-03-26 17:07:51 +01:00
Alexis de Lattre
f5e9150d2d intrastat_product: default intrastat transaction on fiscal position AND company
Odoo uses, by order of priority:
1) intrastat transaction of the invoice
2) default intrastat transaction of the fiscal position of the invoice
3) default intrastat transaction of the company
2024-03-26 17:07:51 +01:00
Alexis de Lattre
8be97de8d0 [IMP] Big simplification, update and cleanup
This commit aims at removing the over-complexity of intrastat modules
while increasing simplicity/usability for users.

- Move default intrastat transaction from res.company to account.fiscal.position to add su
pport for B2C (and not just B2B)
- improve usability: auto-generate declaration lines and XML export when
going from draft to done. Auto-delete declaration lines and XML export
when going from done to draft (and add confirmation pop-up).
- declaration lines are now readonly. Only computation lines can be created/edited manuall
y
- add field region_code on computation lines and declaration lines.
Remove region_id on declaration lines. This change allows big
simplification in some localization modules such as
l10n_fr_intrastat_product.
- simplify Brexit implementation. Northern Ireland is important, but we
can't afford to have so many lines of code and add a field on
product.template (origin_state_id) for a territory of 1.9 million
inhabitants! This is too costly to maintain and too complex for users.
- improve default visibility of fields when reporting_level = 'standard'
- add support for weight calculation from uom categories other than
units and weight, supposing that the 'weight' field on product.template
is the weight per uom of the product
- add EU companies from several different countries in demo data with valid VAT numbers
2024-03-26 17:07:51 +01:00
Víctor Martínez
554173acc7 [FIX] intrastat_product: Avoid error if we create lines manually
TT40919
2024-03-26 17:07:51 +01:00
Luc De Meyer
3f62a5dd33 intrastat declaration - restore _compute_numbers that was dropped by PR #149 (removal of intrastat.common 2024-03-26 17:07:51 +01:00
Víctor Martínez
ae046349e0 [IMP] intrastat_product: Skip invoices according to partner country
Accidentally removed in 2646dc489e

TT38922
2024-03-26 17:07:51 +01:00
Stefan Rijnhart
c678d71a25 [FIX] intrastat_product: typo in filename 2024-03-26 17:07:51 +01:00
Luc De Meyer
09979cc3fa [14.0]fix stack trace when running module upgrade on 14.0.1.6.0 2024-03-26 17:07:51 +01:00
Luc De Meyer
f858d93a7e [14.0]brexit support - size=2 on product_origin_country_code 2024-03-26 17:07:51 +01:00
Luc De Meyer
2396602d73 [14.0]brexit support - DeprecationWarning 2024-03-26 17:07:51 +01:00
Luc De Meyer
88c47f9e15 [14.0]improved brexit support - keep backwards compatibility with localisation modules 2024-03-26 17:07:51 +01:00
Luc De Meyer
902eb6d2f0 [14.0]intrastat - improved brexit support 2024-03-26 17:07:51 +01:00
Luc De Meyer
84923ae76d fix unit tests - keep product_origin_country_id on top of new product_origin_country_code to avoid breaking the localisation modules 2024-03-26 17:07:51 +01:00
Luc De Meyer
e374af7613 [14.0]intrastat_product - Intrastat Brexit support 2024-03-26 17:07:51 +01:00
Luc De Meyer
d59f20f56a [14.0]Intrastat Brexit support 2024-03-26 17:07:51 +01:00
Luc De Meyer
f799e98107 [14.0]intrastat_product - remove incorrect domain on comutation line 2024-03-26 17:07:51 +01:00
Denis Roussel
57abf6bb4b [14.0][IMP] intrastat_product: Add codes in Excel report as required in some countries
In some countries, the imports are done through Excel imports.

They need the codes only in the columns.
2024-03-26 17:07:51 +01:00
Denis Roussel
c697b83a9e Updated from template 2024-03-26 17:07:51 +01:00
Luc De Meyer
2e397be86b [14.0]intrastat_product - fix amount_company_currency 2024-03-26 17:07:51 +01:00
Luc De Meyer
fe9713d48b [14.0][FIX]intrastat_product_declaration - fix amount by removing legacy currency conversion 2024-03-26 17:07:51 +01:00
Luc De Meyer
69bed49418 [13.0][FIX]intrastat_product_declaration - fix amount by removing legacy currency conversion 2024-03-26 17:07:51 +01:00
Alexis de Lattre
878a750287 intrastat_base: Remove intrastat.common class 2024-03-26 17:07:51 +01:00
Denis Roussel
c9d9d284b4 [14.0][IMP] intrastat_product: Add product country of origin in declaration 2024-03-26 17:07:51 +01:00
Denis Roussel
d4f8b89f43 [14.0][IMP] intrastat_*: Improve tests and code 2024-03-26 17:07:51 +01:00
João Marques
6c44534e75 [IMP] intrastat_product: add support for Brexit + small performance improvement + remove universal hs_code constaint
Add support for post-Brexit VAT numbers with latest python-stdnum version
Remove use of country_id.intrastat
Add 'vat' field on computation and declaration lines with a simple validity check
Add 'partner_id' field on computation lines
Prevent back to draft when an XML export is present
Remove the universal constaint applied to the hs_codes for countries in the "Europe" list, as discussed in https://github.com/OCA/intrastat-extrastat/pull/116#discussion_r569735555

Co-authored-by: Alexis de Lattre <alexis.delattre@akretion.com>
2024-03-26 17:07:51 +01:00
João Marques
9573e4ff74 [MIG] intrastat_product: Migration to 14.0
Rename field type to declaration_type
Use the new intrastat boolean of fiscal position, following issue #110

Co-authored-by: Alexis de Lattre <alexis.delattre@akretion.com>
2024-03-26 17:07:51 +01:00
Luc De Meyer
58bffd2d5c [13.0]invoice_date -> date 2024-03-26 17:07:51 +01:00
mreficent
bddb4731cd [FIX] Migration fixes + full migration scripts 2024-03-26 17:07:51 +01:00
Luc De Meyer
8e95e4f88b refactor code to allow adding transaction details while encoding invoices 2024-03-26 17:07:51 +01:00
Luc De Meyer
534bfefe3d [13.0]fix stack trace when entering invoice line without product 2024-03-26 17:07:51 +01:00
Alexis de Lattre
9043fe4bbc intrastat_product: Add xml_attachment_id field
intrastat_product: add mail.activity.mixin and widget in form view
product_harmonized_system: remove archive button (use Action menu)
All modules:
- use super() instead of super(class, self)
- Update domain_force in multi-company ir.rule to v13 standard
2024-03-26 17:07:51 +01:00
Benjamin Henquet
9ada9a6722 [13.0][FIX] 'number' for invoice does not exist anymore the account.move has attribute 'name' 2024-03-26 17:07:51 +01:00
Luc De Meyer
33e4c33999 [MIG] intrastat_product: Migration to 13.0 2024-03-26 17:07:51 +01:00
Daniel Duque
f89d184f8e [FIX] Translations in intrastat_product 2024-03-26 17:07:51 +01:00
Alexis de Lattre
0345cf2f2c [MIG] Migrate all modules from v11 to v12 2024-03-26 17:07:51 +01:00