-
-
Notifications
You must be signed in to change notification settings - Fork 55
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
[MIG] 8.0 l10n_nl_intrastat #58
Conversation
did you consider using this https://github.com/OCA/maintainer-tools/wiki/Migration-Launchpad-%E2%86%92-GitHub method to import from launchpad, this way keeping authors and commits? |
I saw it but I somehow thought it was only for migrating full repos, not single modules to add to an existing OCA repo. Is it useful to keep history for this one? |
Sometimes it's helpful for stuff, but it's also a lot of extra work. You'd have to filter the commits for the directory in question as outlined in https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-8.0#how Let's see what other reviewers think and do nothing for now |
@thomaspaulb can you rebase? |
oca_dependencies.txt
Outdated
@@ -1 +1,2 @@ | |||
partner-contact https://github.com/OCA/partner-contact 8.0 | |||
intrastat https://github.com/sunflowerit/intrastat 8.0-intrastat_base-tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Module intrastat_base
is available in OCA for V8, so I think you can set the OCA repository intrastat
here, instead of the sunflowerit branch. Or is it a temporary solution for some reason?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it was probably not merged at the time of the PR, so this was necessary to get the tests right. But by now, this should indeed just be 'intrastat'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(took the liberty to do exactly that in order to continue with this)
About keeping authors and commits when importing from launchpad, I think the decision is up to the Authors (@Therp, @alexis-via, etc..). |
We don't really mind attribution wise as the license headers are kept intact. For git migrations from older branches I'd enforce this, because it makes cherry picking stuff back and forth between the different versions a lot simpler. But this is not going to happen with launchpad, so technically, it wouldn't be useful. @StefanRijnhart what do you think? It's your commits that are mutilated here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thomaspaulb thanks for porting this module.
Here is just a code review, I didn't test the module.
""" | ||
Do not allow unlinking of confirmed reports | ||
""" | ||
if self.search([('state', '!=', 'draft')]): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This porting of unlink()
method would not work as expected: it actually checks "all" the records that are not in draft.
It should be instead something like:
for report in self:
if report.state != 'draft':
raise ...
'depends': ['intrastat_base'], | ||
'data': [ | ||
'views/l10n_nl_intrastat.xml', | ||
'security/ir.model.access.csv', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
security/* files are commonly declared before the views/* files
'license': 'AGPL-3', | ||
'summary': """Intrastat report for the Netherlands""", | ||
'author': 'Therp BV, Odoo Community Association (OCA)', | ||
'website': 'https://launchpad.net/new-report-intrastat', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we think of an updated website to propose?
Maybe https://github.com/OCA/intrastat ?
#. module: l10n_nl_intrastat | ||
#: field:l10n_nl.report.intrastat,date_done:0 | ||
msgid "Date done" | ||
msgstr "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
File .pot could be safely removed, is not required anymore
=========== | ||
|
||
Bugs are tracked on `GitHub Issues | ||
<https://github.com/OCA/{project_repo}/issues>`_. In case of trouble, please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The link here should be https://github.com/OCA/l10n-netherlands/issues
string='Period', | ||
comodel_name='account.period', | ||
states={'done': [('readonly', True)]}, | ||
default=_default_period_id, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here:
default=lambda self: self._default_period_id(),
required=True, | ||
states={'done': [('readonly', True)]}, | ||
help="Related company.", | ||
default=_default_company_id, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here:
default=lambda self: self.env.user.company_id
and method _default_company_id()
can be removed.
for line_obj in self.line_ids: | ||
line_obj.unlink() | ||
# Define search for invoices for period and company: | ||
company_obj = self.company_id # simplify access |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here if you replace the name of the variable from company_obj
to company
(and do the same for its usage in the subsequent lines), then you are compliant with the OCA guidelines
self._check_generate_lines() | ||
|
||
# Remove existing lines | ||
for line_obj in self.line_ids: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can simply do this:
self.line_ids.unlink()
('company_id', '=', company_obj.id), | ||
] | ||
# Signal invoices without a country | ||
# (Should not happen, as country_id on parter is set to required) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: parter
-> partner
But real question is: why this comment line? country_id
on partner is not required by default.
I think this comment line should be removed. I would prefer this way, instead of setting country_id
as required on partner.
Do you guys need some help here? |
Hey @aschenkels-ictstudio, of course help is always appreciated :-) If I remember correctly, after the code sprint in Barcelona me and @astirpe managed to get the 9.0 and 10.0 versions accepted, but this one slipped my mind. @astirpe what did we suggest for this module.. backporting or resuming with this one? |
@thomaspaulb you already made https://github.com/OCA/l10n-netherlands/tree/9.0/l10n_nl_intrastat, don't you think it's simpler to backport that? Originally the 9 version cam from this I think to remember, so that might just work with cherry picking and changing some xmlids? |
@hbrunn I think so too. The 9.0 version was what we finished, reviewed and polished in the end, also the unit tests there are more developed. So it's best to just backport that, run the unit tests and do some fixing here and there. @aschenkels-ictstudio do I hear you volunteering for the job? |
@thomaspaulb I think doing a backport from 9.0 is faster, but be careful there are some aspects to consider:
... and surely I'm missing something else. So at the end you will have to resume part of the code V8.0. Whatever will be your choice, I will be happy to review it :) |
as of the discussion above I close this one |
Imported from Launchpad, ported to v8, added tests.