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

[MIG] 8.0 l10n_nl_intrastat #58

Closed
wants to merge 12 commits into from

Conversation

thomaspaulb
Copy link
Contributor

Imported from Launchpad, ported to v8, added tests.

@hbrunn hbrunn added this to the 8.0 milestone Dec 2, 2016
@hbrunn
Copy link
Member

hbrunn commented Dec 2, 2016

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?

@thomaspaulb
Copy link
Contributor Author

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?

@hbrunn
Copy link
Member

hbrunn commented Dec 2, 2016

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

@hbrunn
Copy link
Member

hbrunn commented Feb 23, 2017

@thomaspaulb can you rebase?

@@ -1 +1,2 @@
partner-contact https://github.com/OCA/partner-contact 8.0
intrastat https://github.com/sunflowerit/intrastat 8.0-intrastat_base-tests
Copy link
Member

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?

Copy link
Member

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'

Copy link
Member

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)

@astirpe
Copy link
Member

astirpe commented Mar 2, 2017

About keeping authors and commits when importing from launchpad, I think the decision is up to the Authors (@Therp, @alexis-via, etc..).

@hbrunn
Copy link
Member

hbrunn commented Mar 2, 2017

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

Copy link
Member

@astirpe astirpe left a 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')]):
Copy link
Member

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',
Copy link
Member

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',
Copy link
Member

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 ""
Copy link
Member

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
Copy link
Member

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,
Copy link
Member

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,
Copy link
Member

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
Copy link
Member

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:
Copy link
Member

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)
Copy link
Member

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.

@andreschenkels
Copy link
Member

Do you guys need some help here?

@thomaspaulb
Copy link
Contributor Author

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?

@hbrunn
Copy link
Member

hbrunn commented Aug 30, 2017

@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?

@thomaspaulb
Copy link
Contributor Author

@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?

@astirpe
Copy link
Member

astirpe commented Aug 30, 2017

@thomaspaulb I think doing a backport from 9.0 is faster, but be careful there are some aspects to consider:

  • The version 9.0 of this module makes use of date_range and gets rid of V8.0 fiscal periods. It means that, if you go for the backporting way, you will have to ensure that you continue to use periods instead of date_range (module date_range is not available in V8.0 and I don't think it will be ever backported).
  • The Monetary field type used in V9.0 is not existing in V8.0

... 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 :)

@hbrunn
Copy link
Member

hbrunn commented Oct 26, 2017

as of the discussion above I close this one

@hbrunn hbrunn closed this Oct 26, 2017
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.

None yet

4 participants