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)