Skip to content

product_uom_po_domain not compatible with other modules that used uom_po_id in their view #2041

@quentinDupont

Description

@quentinDupont

Module

product_uom_po_domain

Describe the bug

product_uom_po_domain not compatible with other modules that add uom_po_id in their view
For example hr_expense.
It throws this error :

 odoo.tools.convert.ParseError: while parsing /opt/odoo/addons/hr_expense/views/hr_expense_views.xml:492
Error while validating view near:

<form string="Expense Categories" __validate__="1">
                    <div class="alert alert-warning" role="alert" attrs="{'invisible': [('standard_price_update_warning', '=', False)]}">
                        <field name="standard_price_update_warning"/>

Field 'uom_category_id' used in domain of field 'uom_po_id' ([('category_id', '=', uom_category_id)]) must be present in view but is missing.

To Reproduce

Affected versions: 16.0 at least

Steps to reproduce the behavior:

  1. Install product_uom_po_domain
  2. Install hr_expense → it doesn't work and throws the error

Additional Context

As this module change domain in python, it throws an error if uom_category_id is not present in view
I don't know how to fix properly this issue
I tried with no success :

  • using priority for view ❌
  • to override get_view for product_template ❌

That's why i write this (temporary) PR that remove domain in Python and change only Product View + glue module here for hr_expense.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions