Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
3 ตอบกลับ
13646 มุมมอง

Hii, I have a custom module that is an extension to Odoo Purchase App. I added a custom field by inheriting  account.invoice model. I inherited its xml view i.e 'account.invoice_supplier_form' and showing the custom field in the view by xpath expression.

Now when I am installing this custom module from Apps, getting this strange error...

Field 'has_outstanding' used in attributes must be present in view but is missing:  - 'has_outstanding' in attrs="{'invisible': [('has_outstanding','=',False)]}"

Error context:
View `purchase.account.invoice.supplier.form_inherit`
[view_id: 2277, xml_id: n/a, model: account.invoice, parent_id: 1050]
None" while parsing /odoo/odoo-server/odoo/custom/purchase_shipment/views/aaa_invoice_supplier_form.xml:3, near
<record model="ir.ui.view" id="aaa_invoice_supplier_form_inherit">
        <field name="name">purchase.account.invoice.supplier.form_inherit</field>
        <field name="model">account.invoice</field>
        <field name="inherit_id" ref="account.invoice_supplier_form"/>
        <field name="arch" type="xml">
            <xpath expr="//field[@name='reference']" position="after">
                <field name="custom_field_id"/>
            </xpath>
        </field>
</record>




อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

I found the solution. Here are the steps...

Activate developer mode.
Open users and set filter to display Inactive Users
Select OdooBot and it should be an internal user
I saw OdooBot has no Access Rights selected for Purchase App
I Made OdooBot as Purchase Manager

Now when I install the custom module, it installed successfully.


อวตาร
ละทิ้ง

In my case OdooBot was missing a custom access right but this solution works, Do you know the reason?

คำตอบที่ดีที่สุด

In my case it was that someone had created an internal account without any permissions in applications.
It is not only necessary to give permissions on "Purchase App" but also in the others like: "Sales App", "Inventory", "Accounting" and "Others rights"; except in "Administration" that isn't required in this case.

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Dear Anees,

I face the same issue in customer invoice. I followed the steps above and rectified. You know the exact reason of this?! it is little strange I think.

อวตาร
ละทิ้ง
ผู้เขียน

Hii Nilmar,

What is your findings?

Related Posts ตอบกลับ มุมมอง กิจกรรม
1
มี.ค. 24
1751
3
ธ.ค. 24
1632
3
มี.ค. 15
7258
1
ธ.ค. 24
4384
0
พ.ย. 24
1800