-
-
Notifications
You must be signed in to change notification settings - Fork 182
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
[16.0][ADD] account_multi_foreign_vat #387
[16.0][ADD] account_multi_foreign_vat #387
Conversation
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.
Some comments
|
||
class AccountFiscalPosition(models.Model): | ||
|
||
_inherit = "account.fiscal.position" |
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 are inheriting twice account.fiscal.position in tow different files. Can you move this extension to the file with the name of the model?
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.
Sure, my bad
if not checked_country_code and not record.country_id: | ||
raise ValidationError( | ||
_("The foreign VAT number is not correct.") | ||
) from e |
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.
Is this the only change done to the standard method? https://github.com/odoo/odoo/blob/7d678cc7f4c9e00d78d4120f703e90bd282c1a51/addons/base_vat/models/account_fiscal_position.py
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.
Yes
similar_fpos_domain = [ | ||
("foreign_vat", "!=", False), | ||
("country_id", "=", record.country_id.id), | ||
("company_id", "=", record.company_id.id), | ||
("id", "!=", record.id), | ||
] | ||
if record.state_ids: | ||
similar_fpos_domain.append( | ||
("state_ids", "in", record.state_ids.ids) | ||
) | ||
|
||
similar_fpos_count = self.env["account.fiscal.position"].search_count( | ||
similar_fpos_domain | ||
) | ||
if similar_fpos_count: | ||
pass |
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.
at the end this code is just skipping the full check, isn't it? Why dont you just return pass?
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.
Yes, you are right
account_multi_foreign_vat/README.rst
Outdated
@@ -0,0 +1,41 @@ | |||
====================================== | |||
Account Multi Foreign VAT |
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.
README files in OCA are autogenerated from fragments, see https://github.com/OCA/maintainer-tools/tree/master/template/module/readme
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.
Okay, I didn't know
Are requested changes done @LoisRForgeFlow ? |
…g entries - if the impacted countries are part of the country group of the fiscal position we do not raise an error. - if the fiscal position does not have country or country group specificed, we do not raise an error.
6997b3f
to
b297be1
Compare
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
No description provided.