Skip to Content
Menu
This question has been flagged
1874 Views

hi .. now i try to inherit customer form view 'base.res_partner_form_view' using xml path

my xml

<odoo>
<data>
<record id="view_customers" model="ir.ui.view">
<field name="name">View Customers</field>
<field name="model">shop.customers</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='name']" position="after">
<field name="customer_type" />
</xpath>
</field>
</record>

<record id="shop_customers_action" model="ir.actions.act_window">
<field name="name">SHOP Customers</field>
<field name="res_model">shop.customers</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem id="my_shop" name="MY SHOP"/>
<menuitem id="shop_data" name="Shop Data" parent="my_shop"/>
<menuitem id="customers" name="Customers" parent="shop_data" action="shop_customers_action"/>
</data>
</odoo>
my model
class ShopCustomers(models.Model):
_name = 'shop.customers'
_inherit = 'res.partner'

customer_type = fields.Selection([
('p','person'),('c','company'),
])
error
File "/home/omar/tutorials/odoo10/odoo/fields.py", line 1944, in convert_to_cache raise ValueError("Wrong value for %s: %r" % (self, value)) ValueError: Wrong value for shop.customers.commercial_partner_id: shop.customers(<odoo.models.NewId object at 0x7f45b1862950>,)
Avatar
Discard
Related Posts Replies Views Activity
2
Oct 22
8789
2
Nov 19
9714
1
May 17
6699
2
Dec 23
6171
2
Dec 23
11087