[14.0] partner_tier_validation - stack trace when accessing enterprise's follow-up report form
Module
partner_tier_validation
Describe the bug
Enterprise version: try accessing the follow-up reports forms in accounting and you'll get a stack trace if partner_tier_validation is installed.
To Reproduce
Affected versions: 14.0 and probably other versions
Steps to reproduce the behavior:
- Install accounting
- Install partner_tier_validation
- Go to follow-up reports and click on a line in the tree view to access the form view
- You have your stack trace
Expected behavior
No stack trace
technical analysis
What does the stack trace say?
Error: While parsing modifiers for div: for modifier "invisible": Unknown field state in domain
in partner_tier_validation, partner_form_tier adds state field on partner form by inheriting base.view_partner_form. https://github.com/OCA/partner-contact/blob/e3bc760a632f47120cb265789adb162b80c4246d/partner_tier_validation/views/res_partner_view.xml#L13
in account_followup, a new res.partner form, not inheriting base.view_partner_form is created without a state field. https://github.com/odoo/enterprise/blob/9f165d053ff63d0f2482930491959afb846be2c8/account_followup/views/account_followup_views.xml#L3
The last one is the view we try to access. Absent state field is the cause of the stack trace.
Why do we need state field? Because of template tier_validation_label in base_tier_validation. https://github.com/OCA/server-ux/blob/3b6e31c7f1f29f60089c94ad62ccefcdd1dae83f/base_tier_validation/templates/tier_validation_templates.xml#L27
approaching a solution
adding <field name="state" invisible="1" /> in the account_followup view fixes the problem. but since it is enterprise we cannot do this in any oca module. we need to add the state field in every res.partner form view. i'll try to open a pr that does that.
There hasn't been any activity on this issue in the past 6 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. If you want this issue to never become stale, please ask a PSC member to apply the "no stale" label.