Skip to Content
Menu
This question has been flagged
1 Reply
140 Views

I only created two files ('drug.py  and drug_views.xml) to add a new field to an existing form view

from odoo import fields, models 
class Drug(models.Model):
_inherit = "product.template"
drug_name = fields.Char(string="Drug Name",
help="Name of the drug",required=True)
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="view_drug_view_form" model="ir.ui.view">
<field name="name">
drug.view.form.inherit.odoo.hotel.management
</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_only_form_view"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='invoice_policy']" position="after">
<field name="drug_name"/>
</xpath>
</field>
</record>
</odoo>

Error Message says:

File "/Users/hellohein/Desktop/odoo_pharmacy/community/odoo/tools/misc.py", line 226, in file_path
    raise FileNotFoundError("File not found: " + file_path)
FileNotFoundError: File not found: pharmacy_management_odoo/views/durg_views.xml

The above server error caused the following client error:
RPC_ERROR: Odoo Server Error
    RPC_ERROR
        at makeErrorFromResponse (http://localhost:8070/web/assets/9a60bde/web.assets_web.min.js:3149:163)
        at XMLHttpRequest.<anonymous> (http://localhost:8070/web/assets/9a60bde/web.assets_web.min.js:3154:13)
Avatar
Discard
Best Answer
FileNotFoundError: File not found: pharmacy_management_odoo/views/durg_views.xml

Assuming your view file is actually called drug_views.xml, you have a typo in your path in the data key of your __manifest__.pydurg_views.xml vs drug_views.xml

Avatar
Discard
Related Posts Replies Views Activity
4
May 25
2192
0
Mar 25
604
0
Jan 25
773
2
Jan 25
1395
0
Jan 25
624