hi all, i am creating a custom module, i have created Model and it can be seen in Technical -> Models (the code is below) which is fine, then i created View but when upgrading Module in Apps it is throwing Error.
due to some problems here i am posting View code and Error message in Comment.
please help to find out what i am doing wrong and how to resolve it.
My Model code is here:
from odoo import models, fields
class CRMInquiry(models.Model):
_name = 'crm.inquiry'
_description = 'CRM Lead Inquiry'
product_id = fields.Many2one('product.product', string='Product Name', required=True)
qty = fields.Integer(string='Quantity', default=1)
note: as mentioned above, check View code and Error in Comments below.
in continuation of my topic below :
regards
My view code as per your advised code:
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<record id="view_crm_lead_form_inherit01" model="ir.ui.view">
<field name="name">crm.leads.inherit</field>
<field name="model">crm.inquiry</field>
<field name="inherit_id" ref="crm.crm_lead_view_form"/>
<field name="arch" type="xml">
<xpath expr="//page[@name='lead']" position="after">
<page name="">th
<group>
<field name="product_id"/>
<field name="qty"/>
</group>
</page>
</xpath>
</field>
</record>
</odoo>
the Error while upgrading Module through Apps:
<form class="o_lead_opportunity_form" js_class="crm_form">
<header>
<button name="action_set_won_rainbowman" string="Won" type="object" class="oe_highlight" data-hotkey="w" title="Mark as won" attrs="{'invisible': ['|','|', ('active','=',False), ('probability', '=', 100), ('type', '=', 'lead')]}"/>
Field `stage_id` does not exist
View error context:
{'file': 'd:\\program files\\odoo '
'16.0e.20230607\\server\\odoo\\custom_addons\\crm_customz\\views\\crm_leads_custom_inquiry.xml',
'line': 1,
'name': 'crm.leads.inherit',
'view': ir.ui.view(2407,),
'view.model': 'crm.inquiry',
'view.parent': ir.ui.view(2318,),
'xmlid': 'view_crm_lead_form_inherit01'}