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
[FIX] l10n_id_efaktur: NPWP and NIK #163707
base: 15.0
Are you sure you want to change the base?
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.
To check:
commercial_partner must be used when fetching fields that are not address related.
l10n_id_tax_name seems to not be used anymore, isn't this a mistake?
0bd7585
to
d5211fc
Compare
@vin-odoo good point you've raised. I think ideallly we would be putting it in l10n_id_tax_name. However, based on my discussion with JGR, now if the npwp is '000000000000000', then the etax name is automatically become {NIK}#NIK#NAMA#{customer name}. |
@nni-odoo My issue here is that you not only change the behavior when invoice_npwp[:15] == '000000000000000' but also when it's not. |
@vin-odoo from what I understand is people don't usually use it, so then they will just use the customer name (commercial_partner.name) in the end, which means this field is useless 🤔 Edit: I'll just make it use l10n_id_tax_name too |
d5211fc
to
70e212a
Compare
70e212a
to
4974e57
Compare
4974e57
to
696b580
Compare
Due to recent rule changes for E-faktur, now NIK and NPWP are complement to each other. Consequently, changes that are caused are: - No auto-assignat for NPWP to 000000000000000. User has to fill in NPWP, NIK or both. If not fulfilled, an error should show up. - Minimum length of NPWP is 15 - When NPWP is 000000000000000 and user fills in NIK, change the name shown to {NIK}#NIK#NAMA#{name} Unit tests to satisfy the above changes have also been added 3815006
696b580
to
493e0e4
Compare
@vin-odoo amended the commit message. I've also added the unit tests accordingly |
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.
LGTM, please mark the pr as ready for review :)
'views': [[self.env.ref('base.view_partner_form').id, 'form']], | ||
} | ||
msg = _("Please make sure that you've input the appropriate NPWP or NIK for the following customer") | ||
raise RedirectWarning(msg, action_error, _("Edit Customer Information")) |
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.
Nice :) during the forward port (in 17.2, or just master to make it easier) you can simplify this
raise RedirectWarning(msg, action_error, _("Edit Customer Information")) | |
raise RedirectWarning( | |
msg, | |
commercial_partner._get_records_action(), | |
_("Edit Customer Information") | |
) |
_get_records_action
can take as args whatever you would like to add to the action.
By default, it will dynamically set the view_mode based on the amount of records in self.
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.
Small nitpicking while I ran into this PR, I'll leave the rest to VIN 👍
from odoo.exceptions import UserError, ValidationError | ||
from odoo.tools import float_round, float_repr | ||
from odoo.exceptions import RedirectWarning |
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.
from odoo.exceptions import UserError, ValidationError | |
from odoo.tools import float_round, float_repr | |
from odoo.exceptions import RedirectWarning | |
from odoo.exceptions import RedirectWarning, UserError, ValidationError | |
from odoo.tools import float_round, float_repr |
Due to recent rule changes for E-faktur, now NIK and NPWP are complement to each other. Which means now, when the person is filling in 000000000000000, e-faktur should be taking the NIK as NPWP column in e-Faktur
3815006
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr