Giter Club home page Giter Club logo

intrastat-extrastat's Introduction

Runboat Pre-commit Status Build Status codecov Translation Status

intrastat-extrastat

TODO: add repo description.

Available addons

addon version maintainers summary
intrastat_base 16.0.1.1.0 alexis-via luc-demeyer Base module for Intrastat reporting
intrastat_delivery 16.0.1.0.0 Propagates the value of the incoterm fields from the order shipping method to the invoices
intrastat_product 16.0.2.0.0 Base module for Intrastat Product
intrastat_product_generic 16.0.1.0.0 Generic Intrastat Product Declaration
intrastat_product_hscodes_import 16.0.1.0.0 Module used to import HS Codes for Intrastat Product
product_harmonized_system 16.0.1.1.0 alexis-via luc-demeyer Base module for Product Import/Export reports
product_harmonized_system_delivery 16.0.1.0.0 alexis-via luc-demeyer Hide native hs_code field provided by the delivery module
product_harmonized_system_stock 16.0.1.0.0 alexis-via luc-demeyer Adds a menu entry for H.S. codes

Licenses

This repository is licensed under AGPL-3.0.

However, each module can have a totally different license, as long as they adhere to Odoo Community Association (OCA) policy. Consult each module's __manifest__.py file, which contains a license key that explains its license.


OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

intrastat-extrastat's People

Contributors

aiendry-aktivsoftware avatar alexis-via avatar anasuarez1 avatar aritzolea avatar badbole avatar cubells avatar gelo-fl avatar guewen avatar hbrunn avatar ivorra78 avatar jdidderen-noviat avatar joao-p-marques avatar luc-demeyer avatar mat-moran avatar metaminux avatar miquelrforgeflow avatar mymage avatar nl66278 avatar oca-git-bot avatar oca-transbot avatar oca-travis avatar pedrobaeza avatar rousseldenis avatar rvalyi avatar sanrav avatar sbidoul avatar stefanrijnhart avatar victoralmau avatar weblate avatar yweng8111 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

intrastat-extrastat's Issues

[RFC] intrastat_product: Add an Intrastat summary in the invoice report

One of my customers has asked for having an Intrastat summary on each invoice for their customers to be aware about the HS codes, weights and so on to fill. I think this can be something that can be done in this module instead of handling it on each localization.

It can be an extra page in the same invoice report with a table with the following cells:

  • Product reference
  • Product name
  • HS code
  • Weight
  • Origin country

And it would be something opt-in to be marked on the commercial partner.

What do you think? @alexis-via @luc-demeyer

intrastat: country of origin

Hi all,

I've a requirement about the country of origin for a product (origin_country_id).

In order to not create a new product for each country of origin, we try to find the best way to implement it.

For instance, one sold product 'Bananas' with different origin countries.

Is someone has faced this kind of issue ?

I thought about using variants but what impact in terms of warehouse flows ? We envisaged also to set the information on lots. But that has the disadvantage of breaking the intrastat_product module code.

Thanks for your answers.

@alexis-via @luc-demeyer

Brexit and impact on intrastat

I've read in detail the official documentation for the intrastat declaration for France (DEB) updated on January 5 2021 with the details for Brexit:
https://www.douane.gouv.fr/la-douane/informations/bulletins-officiels-des-douanes/da/21-003 (in French only)
and I have also exchanged with the French fiscal administration to have some details about the services (DES).
Here are the requirements, according to the French official documentation:

  1. If we ship some goods from France to Great Britain (UK without Northern Ireland), we should not mention it on intrastat
  2. If we ship some goods from France to Northern Ireland, the EU VAT regime still applies and the sale should be declared in the intrastat declaration. Companies in Northern Ireland now have a new VAT number starting with XI (VIES has been updated).
  3. if we sell a service in B2B without VAT to a company in the UK, we should NOT mention it in the intrastat declaration, even when the customer is in Northern Ireland. It means the VAT regime for Northern Ireland is different between goods and services !
  4. When the country of origin/destination is Northern Ireland, we are supposed to use the code XI as country code.
  5. For the Country of origin of the goods (Made in xxx), we should distinguish between Northern Ireland (using country code XI) and Great Britain (using country code XU)

Do you agree on the requirements ? If yes, we can continue the discussion and talk about the implementation.

Problem [12.0] [intrastat_base]

Hi there,
when trying to enter the general settings of Odoo, I get this error:

Odoo Server Error
Traceback (most recent call last):
  File "/opt/odoo/odoo/odoo/api.py", line 1049, in get
    value = self._data[key][field][record._ids[0]]
KeyError: <odoo.models.NewId object at 0x7f5cc17c9d98>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/odoo/odoo/odoo/fields.py", line 1004, in __get__
    value = record.env.cache.get(record, self)
  File "/opt/odoo/odoo/odoo/api.py", line 1051, in get
    raise CacheMiss(record, field)
odoo.exceptions.CacheMiss: ('res.config.settings(<odoo.models.NewId object at 0x7f5cc17c9d98>,).intrastat_remind_user_ids', None)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/odoo/odoo/odoo/api.py", line 1049, in get
    value = self._data[key][field][record._ids[0]]
KeyError: 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/odoo/odoo/odoo/fields.py", line 1004, in __get__
    value = record.env.cache.get(record, self)
  File "/opt/odoo/odoo/odoo/api.py", line 1051, in get
    raise CacheMiss(record, field)
odoo.exceptions.CacheMiss: ('res.company(1,).intrastat_remind_user_ids', None)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/odoo/odoo/odoo/http.py", line 656, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/opt/odoo/odoo/odoo/http.py", line 314, in _handle_exception
    raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
  File "/opt/odoo/odoo/odoo/tools/pycompat.py", line 87, in reraise
    raise value
  File "/opt/odoo/odoo/odoo/http.py", line 698, in dispatch
    result = self._call_function(**self.params)
  File "/opt/odoo/odoo/odoo/http.py", line 346, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/opt/odoo/odoo/odoo/service/model.py", line 97, in wrapper
    return f(dbname, *args, **kwargs)
  File "/opt/odoo/odoo/odoo/http.py", line 339, in checked_call
    result = self.endpoint(*a, **kw)
  File "/opt/odoo/odoo/odoo/http.py", line 941, in __call__
    return self.method(*args, **kw)
  File "/opt/odoo/odoo/odoo/http.py", line 519, in response_wrap
    response = f(*args, **kw)
  File "/opt/odoo/odoo/odoo/addons/web/controllers/main.py", line 962, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/opt/odoo/odoo/odoo/addons/web/controllers/main.py", line 954, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/opt/odoo/odoo/odoo/api.py", line 759, in call_kw
    return _call_kw_multi(method, model, args, kwargs)
  File "/opt/odoo/odoo/odoo/api.py", line 746, in _call_kw_multi
    result = method(recs, *args, **kwargs)
  File "/opt/odoo/odoo/odoo/models.py", line 5524, in onchange
    snapshot1 = Snapshot(record, nametree)
  File "/opt/odoo/odoo/odoo/models.py", line 5414, in __init__
    if subnames else record[name]
  File "/opt/odoo/odoo/odoo/models.py", line 5123, in __getitem__
    return self._fields[key].__get__(self, type(self))
  File "/opt/odoo/odoo/odoo/fields.py", line 1010, in __get__
    self.determine_draft_value(record)
  File "/opt/odoo/odoo/odoo/fields.py", line 1132, in determine_draft_value
    self._compute_value(record)
  File "/opt/odoo/odoo/odoo/fields.py", line 1068, in _compute_value
    self.compute(records)
  File "/opt/odoo/odoo/odoo/fields.py", line 2362, in _compute_related
    super(_RelationalMulti, self)._compute_related(records)
  File "/opt/odoo/odoo/odoo/fields.py", line 632, in _compute_related
    record[self.name] = value[self.related_field.name]
  File "/opt/odoo/odoo/odoo/models.py", line 5123, in __getitem__
    return self._fields[key].__get__(self, type(self))
  File "/opt/odoo/odoo/odoo/fields.py", line 1008, in __get__
    self.determine_value(record)
  File "/opt/odoo/odoo/odoo/fields.py", line 1111, in determine_value
    record._prefetch_field(self)
  File "/opt/odoo/odoo/odoo/models.py", line 2843, in _prefetch_field
    result = records.read([f.name for f in fs], load='_classic_write')
  File "/opt/odoo/odoo/odoo/models.py", line 2781, in read
    self._read_from_database(stored, inherited)
  File "/opt/odoo/odoo/odoo/models.py", line 2942, in _read_from_database
    field.read(fetched)
  File "/opt/odoo/odoo/odoo/fields.py", line 2711, in read
    records._cr.execute(query, where_params)
  File "/opt/odoo/odoo/odoo/sql_db.py", line 148, in wrapper
    return f(self, *args, **kwargs)
  File "/opt/odoo/odoo/odoo/sql_db.py", line 225, in execute
    res = self._obj.execute(query, params)
psycopg2.ProgrammingError: column res_company_res_users_rel.company_id does not exist
LINE 1:  SELECT res_company_res_users_rel.company_id, res_company_re...

Apparently, it might be caused by the module intrastat_base, where the field intrastat_remind_user_ids is defined without the proper relation attribute while trying to create a table between res.company and res.users (which might already be in place, instantiated by some other Many2many field, like user_ids defined in base module).

Branch 12.0 missing

Branch 12.0 does not exist here but has been created in weblate.

Should we remove the 12.0 project from weblate?

[14.0]intrastat_product issue with stdnum.vatin

Latest ocb v14
following lib in pip :
image

yet when loading module we have :

from . import intrastat_product_declaration
File "/home/odoo_14/additionnal_repositories/OCA-intrastat-extrastat/intrastat_product/models/intrastat_product_declaration.py", line 11, in <module>
from stdnum.vatin import is_valid
ModuleNotFoundError: No module named 'stdnum.vatin'

Hi @luc-demeyer , any tips on this one?

14.0 mig : invoice domain should be based on fiscal position in stead of country

Up till now the default domain to select intrastat transactions is based upon invoices to/from EU countries.
I propose that we change in 14.0 the logic to be based upon the "Intra EU" fiscal position.

On the Belgian market transactions subject to the 'intrastat' declaration are also subject to the 'intracommunity' tax declaration.
In the 13.0 version of the Belgium localisation module I already replaced the domain query, cf.
https://github.com/Noviat/noviat-apps/blob/012c9a254b101c405126b1c0ce5276a0a9c16d9e/l10n_be_intrastat_product/models/l10n_be_intrastat_product_declaration.py#L219

But since these rules are decided on an european level, this should be applicable for all EU countries.
As a consequence I propose that for the 14.0 migration we add an 'intrastat' boolean to the fiscal position and base the domain on invoices with fiscal positions marked as 'intrastat'. In the localisation modules we can add the logic to set this flag automatically on the standard Intra EU fiscal position.

To give a concrete example why the country tabel is wrong:
If you ship goods to a customer without VAT number in an EU country that this shipment must not be included in the intrastat declaration.

[10] ICP report for multicompany

I'm using the ICP report in a multicompany environment. When I open the menu the view l10n_nl.report.intrastat tree shows me all the reports of all the companies. There is a recordrule missing to display on the report of the current logged in company. Please add record rule with the following Domain Filter for version 10 and above:

['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]

Weight not calculated when the Uom is not Units

When the product has a unit of measure different from units or with category different from units, e.g., meters or m2, the weight is not calculated. The module gives the message: Conversion from unit of measure 'm' to 'Kg' is not implemented yet. It is needed for product 'xxxx'
The supplementary units field is correctly put into the declaration when it is set in the intrastat code but the weight is not calculated and is set to zero.

Fields codes instead of names

@luc-demeyer @alexis-via I've a request from a customer:

They want some codes in the xls file instead of names for declaration :

  • Source country
  • Destination country
  • Transaction
  • Transport

As I see in inrastat definition, I think this is quite legitimate. What do you think of ?

[16.0] intrastat_product : uom_id in supplementary units shouldn't be required in form view

Module

intrastat_product

Describe the bug

In Supplementary Units (intrastat.unit) the field uom_id is a Many2one to native Odoo model Unit of Measures (uom.uom)
In the form view, this field is set as required="1", but we can have intrastat unit that will never be mapped to an odoo unit

To Reproduce

16.0:

Steps to reproduce the behavior:

  1. Just install the intrastat_product module

Expected behavior
This field shouldn't be set as required

Additional context
80c0e7c already fixed this but was reverted in 2320981
@luc-demeyer and @alexis-via Is there a reason why ?

[16.0] intrastat_product : notedict should be initialized properly before calling method using it

Module

intrastat_product

Describe the bug

As of 5071a99 the generation of the messages in the warning pop-up is using notedict

the _prepare_notedict method is initializing this dict and a lot of methods are using it without controlling if keys actually exist.

For example,
_get_partner_country suppose that keys "partner", "inv_origin" and "invoice" exist
_get_weight_and_supplunits suppose that keys "invoice", "invline_origin", "intrastat_unit" and "inv_origin" exist
_get_product_origin_country suppose that keys "product" and "invline_origin" exist
_get_vat suppose that keys "partner" and "inv_origin" exist
_gather_invoices suppose that keys "inv_origin", "invline_origin" and "product" exist

and some other methods that are intended to be inherited by localisation modules are using it too (like _get_region_code)

but _prepare_notedict is only called once in action_gather

So, for the moment, calling one of the previously mentionned methods directly, raises an error.

This happens at least in 2 cases for the moment :

  • In account_move.py, _get_intrastat_line_vals is calling get_weight_and_supplunits without initializing notedict properly
  • In invoice report, QWEB is calling _get_intrastat_lines_info which calls _get_intrastat_line_vals

@alexis-via or @luc-demeyer, I will propose a PR to fix this but would like an opinion about how to properly fix that :

  • should I just fix the _get_intrastat_line_vals method to initialize notedict ?
  • should I check that keys exist in each method using notedict ?

I will make the PR for the first solution, waiting for any opinion...

To Reproduce

Affected versions: 16.0

Steps to reproduce the behavior:

  1. Install intrastat_product on a fresh database with demo data
  2. Add "admin" user to the "Invoice Intrastat Transaction Details" group
  3. Set "My Company (San Francisco)" country as France (keep USD as currency)
  4. Set "Azure Interior" customer country as Germany
  5. Open customer invoice INV/2023/00001
  6. In the first invoice line, open the product (FURN_6741) and set HS code to "84717050 Storage units"
  7. Open the HS code "84717050 Storage units" and change supplementary unit to "ce/el"
  8. Go back to the invoice, open the "Intrastat transaction details" tab and click on the "Compute" button
  9. Alternatively, we can also use the "Print" menu and click on "Invoices"

Current behavior
An Odoo Server Error is raised with KeyError: 'intrastat_unit'

Expected behavior
A line should appear in the "Intrastat transaction details" tab of the invoice (as notedict is not used here)

9.0 branch

what is the proper way to create an empty 9.0 branch here and fill it from 8? Or should be just push the current 8 there and make everything uninstallable manually?

Field hs_code_id on products and company_dependent

Currently, in the module product_harmonized_system, the field hs_code_id on product.template and on product.category has company_dependent=True, cf
https://github.com/OCA/intrastat-extrastat/blob/14.0/product_harmonized_system/models/product_template.py#L16

Is it really a good idea ? Sometimes I think that it has been introduced by someone who needed it on a project in a very special context, but it adds extra complexity for everybody. In a standard scenario, HS code should not depend on company. HS code should be considered as "physical" property of a product, like the weight, which doesn't depend on the company.

What do you think ? Should be consider to switch back to company_dependent=False on v15 ?

Migration to version 17.0

Todo

https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-17.0

Modules to migrate

Missing module? Check https://github.com/OCA/maintainer-tools/wiki/%5BFAQ%5D-Missing-modules-in-migration-issue-list

[15.0] [Intrastat_product] Cannot create a Product declaration

Module

intrastat_product

Describe the bug

I cannot creat a product declaration because there is an error. There is a function that is not defined in the code.
1

AttributeError: 'l10n.es.intrastat.product.declaration' object has no attribute '_compute_numbers'

To Reproduce

Go to Accounting > Reporting > Intrastat Product declaration

Expected behavior
Create a new Intrastat Product Declaration record.

Additional context
Add any other context about the problem here. (e.g. OS, Python version, ...)

cant generate report for france

Traceback (most recent call last):
File "/opt/odoo/odoo-server/openerp/http.py", line 546, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/opt/odoo/odoo-server/openerp/http.py", line 583, in dispatch
result = self._call_function(**self.params)
File "/opt/odoo/odoo-server/openerp/http.py", line 319, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/opt/odoo/odoo-server/openerp/service/model.py", line 118, in wrapper
return f(dbname, *args, **kwargs)
File "/opt/odoo/odoo-server/openerp/http.py", line 316, in checked_call
return self.endpoint(*a, **kw)
File "/opt/odoo/odoo-server/openerp/http.py", line 812, in call
return self.method(*args, **kw)
File "/opt/odoo/odoo-server/openerp/http.py", line 412, in response_wrap
response = f(*args, **kw)
File "/opt/odoo/odoo-server/addons/web/controllers/main.py", line 948, in call_button
action = self._call_kw(model, method, args, {})
File "/opt/odoo/odoo-server/addons/web/controllers/main.py", line 936, in _call_kw
return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)
File "/opt/odoo/odoo-server/openerp/api.py", line 268, in wrapper
return old_api(self, *args, **kwargs)
File "/opt/odoo/odoo-server/openerp/api.py", line 399, in old_api
result = method(recs, *args, **kwargs)
File "/opt/odoo/oca/intrastat/intrastat_product/models/intrastat_product_declaration.py", line 653, in action_gather
lines = self._gather_invoices()
File "/opt/odoo/oca/intrastat/intrastat_product/models/intrastat_product_declaration.py", line 544, in _gather_invoices
hs_code = inv_line.product_id.product_tmpl_id.
AttributeError: 'product.template' object has no attribute 'get_hs_code_recursively'

incoterms_id in intrastat_product module

Hi,

I'm not sure if it is a real issue or not.

On vendor invoices:

After installing this module, you will have 2 incoterms fields:

1- incoterm_id --> from standard Odoo

2- incoterms_id --> from intrastat_product module

What's the point on having 2 incoterm related fields; one from standard and another one coming from intrastat_product module? Am I missing something?

Captura de pantalla 2020-08-12 a las 17 13 06

@luc-demeyer @alexis-via @pedrobaeza

THX

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.