-
-
Notifications
You must be signed in to change notification settings - Fork 177
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
Feature/account fiscal position rule migration 8.0 #10
Feature/account fiscal position rule migration 8.0 #10
Conversation
else: | ||
partner_addr = partner.address_get(['invoice']) | ||
addr_id = partner_addr['invoice'] and \ | ||
partner_addr['invoice'] or None |
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.
Please do not use ... and ... or ...
but ... if ... else ...
, and do not use \
but parenthesis.
This module deserves tests. |
Thanks for the work on the migration |
ctx = dict(self._context) | ||
ctx.update({'use_domain': ('use_invoice', '=', True)}) | ||
return self.env['account.fiscal.position.rule'].with_context( | ||
ctx).apply_fiscal_mapping(result, **kwargs) |
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 don't need to update the context yourself. with_context()
does that. You can write (with a better care of the length of the line, probably by extracting a part in a variable):
return self.env['account.fiscal.position.rule'].with_context(use_domain=('use_invoice', '=', True)).apply_fiscal_mapping(result, **kwargs)
@guewen yes we will put some tests before merging, we just didn't have time so far. |
👍 |
1 similar comment
👍 |
…rule_migration_8.0 Feature/account fiscal position rule migration 8.0
No description provided.