Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

10.0 Port all intrastat modules #3

Merged
merged 103 commits into from
Nov 12, 2016
Merged

10.0 Port all intrastat modules #3

merged 103 commits into from
Nov 12, 2016

Conversation

alexis-via
Copy link
Contributor

This PR will contain the port of all the modules of the project to Odoo v10.

For the moment, only intrastat_base has been ported.

Alexis de Lattre and others added 30 commits October 7, 2016 13:12
…tat_product/service object is stored in database, we don't need the legal_intrastat state on invoices any more, because we will be able to create entry lines for DEB for a repair of equipment under warranty without using a legal_intrastat. Report_intrastat_type is now only required for DEB -> object moved to module l10n_fr_intrastat_product. For DEB, the button "regenerate lines" only regenerate DEB lines related to invoices.

Renamed intrastat base module, because it doesn't have France-specific parameters any more.

Add demo data.
…port_intrastat_type table, restarting OpenERP and re-creating intrastat types. Moved intrastat departments from stock.warehouse to stock.location. Dropped SQL queries ; replaced by traditionnal python code logic. No more need to have one rate per day for invoices with foreign currency. Add total fiscal value for DEB More code factorization. Prepare translation work.
… Moved configuration about taxes from company form to tax form Some modifications to ease v5 -> v6 migration : - object report_intrastat_code now belong to group account manager - button functions now return True Tried to implement the following feature : open attachement form when the XML file as been generated : works on v6, but make client crash en v5 -> code has been commented DEB lines with procedure code = 25 are now deducted from the fiscal total. Round invoice total.
… l10n_fr_intrastat_product to intrastat_base, because it should also be used in the module l10n_fr_intrastat_service. Take this field into account in the generation of DEB lines (module l10n_fr_intrastat_service).
…to the EU but invoice outside of the EU, your customer needs to have a fiscal representative inside the EU, which will be used for the DEB . depend on base_vat instead of account.
…hysical person in the EU with VAT, the move is not declared in DEB, so it must not block with a "raise" if the partner doesn't have a VAT number.
…as is_accessory_cost services but no regular product -> DES If the invoice has is_accessory_cost services and regular product -> added to the cost of products in DEB

Now allows "pricelist for statistical value" which is not in EUR (the currency conversion will be made from the pricelist currency to EUR)

Usability improvements :
- Order for DEB and DES tree view : "the more recent at the top"
- distinction between "Information to declare" and "Additionnal information" in intrastat lines
…ive" field in order to avoid the "compression" of the VAT field that made it too small.
…ncluding your own country - When generating lines for Intrastat Product/Service, all invoices for which country == Company's country are excluded
…ligation_level on res.company Add group group_detailed_intrastat_product, so that companies that only use obligation = simplified don't see all the additionnal fields. Remove transaction code corresponding to repairs in intrastat types Better on_change on intrastat types (code is mutualised with field.function) Update syntax : demo_xml/update_xml/init_xml -> data/demo
…astat_service (hope that Akretion France won't forget it's own declarations now !!!) On report.intrastat.product and report.intrastat.service : add copy() fonctions, tracking of important fields, a year_month function field and enhance views. Remove date_done field (the tracking in the chatter does the job). Remove class instanciation in the code.
…p "Detailed intrastat product". Remove dead code and fields that was used when we had to put DEB lines for repair operations (a thing of the past !). Update coding style. Reduce the number of flake8 warnings.
…nload the attachement via the drop down list on the form view, the name of the file will be the name of the attachement and not datas_fname ; so we need to have name = datas_fname.
@alexis-via
Copy link
Contributor Author

I ported product_harmonized_system, but I have a strange warning when loading the module:

2016-10-11 16:11:48,758 6885 WARNING test_01 odoo.fields: Field hs.code.display_name depends on itself; please fix its decorator @api.depends().

If you have a clue...

@hbrunn
Copy link
Member

hbrunn commented Oct 19, 2016

@alexis-via I think this is caused by https://github.com/OCA/intrastat/pull/3/files#diff-b0f1105b01cd5c85d3ad003c0a061e16R15 - the ORM uses this as @Depends for its own _compute_display_name in https://github.com/OCA/OCB/blob/10.0/odoo/models.py#L1511.
You're better off in my opinion with not touching rec_name and _compute_display_name at all, just override name_get to do what you need there, and override the computation function only to set the proper depends

@pedrobaeza
Copy link
Member

Yeah, that's something that happens in v10 with the special field display_name. Look here for a same issue detected by an Odoo employee that has worked on some community modules migration for Hacktoberfest: OCA/social#108 (comment)

@alexis-via
Copy link
Contributor Author

@hbrunn Thank you very much for your advice. I thought that name_get() was kind of deprecated and it was bettter to use a computed 'display_name' field, cf https://www.odoo.com/fr_FR/forum/how-to/developers-13/how-to-override-name-get-method-in-new-api-61228
But maybe that info was wrong...

Special thanks to Pedro and Holger for finding the solution for display_name
Fix demo data
@hbrunn
Copy link
Member

hbrunn commented Nov 10, 2016

@alexis-via travis errors van be fixed by including an update for .travis.cfg: https://github.com/OCA/intrastat/blob/10.0/.travis.yml#L35

@coveralls
Copy link

coveralls commented Nov 10, 2016

Coverage Status

Coverage remained the same at 50.857% when pulling 4f96d35 on akretion:10-intrastat-v3 into 0e8a209 on OCA:10.0.

@hbrunn
Copy link
Member

hbrunn commented Nov 10, 2016

@alexis-via how do you see this? Should we merge what we have already? I'd be in favor of this, because then other people can give you a hand, while if we keep one PR to rule them all, you're alone.

@alexis-via
Copy link
Contributor Author

@hbrunn yes, good idea !

@hbrunn hbrunn merged commit 4b7fb6f into OCA:10.0 Nov 12, 2016
@hbrunn
Copy link
Member

hbrunn commented Nov 12, 2016

okay, then I'll merge this as it is without squashing, this way, you can simply keep your branch and create a new PR when there are new commits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants