i inherit res.partner and i have field , i want to replace that field city with my city_id i use this code below
class ResPartner(models.Model):
_inherit = 'res.partner'city_id = fields.Many2one('res.city', string='City')my xml
<record id="view_partner_form_inherit_tawssil" model="ir.ui.view">
<field name="name">res.partner.form.inherit.tawssil</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='city']" position="replace">
<field name="city_id" placeholder="City" context="{'default_city': active_id}"/>
</xpath>
</record>
but i had the error
Field 'city' used in attributes must be present in view but is missing:
- 'city' in context="{'default_parent_id': active_id, 'default_street': street, 'default_street2': street2, 'default_city': city, 'default_state_id': state_id, 'default_zip': zip, 'default_country_id': country_id, 'default_supplier': supplier, 'default_customer': customer, 'default_lang': lang, 'default_user_id': user_id}"