Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
3 Risposte
5408 Visualizzazioni

hi all, inherited " res.partner " and added a page (editable tree) in notebook section, but when clicking on "Add a line" it is showing below error: 

ValueError: Invalid field 'same_vat_partner_id' on model 'tests.users'

my  model 'tests.users' have no field with this invalid field named 'same_vat_partner_id' or i am missing what odoo trying to communicate? 

class Users(models.Model):
    _name = 'tests.users'
    _rec_name = 'name'
    _description = "Tests Users"
    name = fields.Char(string="User Name", required=True)
    email = fields.Char(string="Email")
    email_verified_at = fields.Datetime(string="Email Verified At")
    address = fields.Text(string="User Address")
    password = fields.Char(string="Password", required=True)
    profile_picture = fields.Binary()
    phone = fields.Char(string="Phone No.", required=True)
    type = fields.Selection([
        ('staff', 'Staff'),
        ('customer', 'Customer'),
        ('rider', 'Rider')
    ], required=True, string="User Type", default='staff')
    remember_token = fields.Char(string="Remember Token")
    zone_id = fields.Many2one("tests.zones", string="Zone")
    description = fields.Text(string="Other Information")
    deleted_at = fields.Datetime()
    user_ids = fields.One2many('tests.userzones', 'user_id', string="User Zone")

and didn't used this model in any means when inherited res.partner... please help to resolve the problem.


for reference, my model and view files are as below for inheritance:

class PartnerZone(models.Model):
    _inherit = 'res.partner'
    zone_id = fields.Many2one('tests.zones', string="Zone")
    user_mids = fields.One2many('tests.usermetas', 'user_id', string="User Metas")
    user_wids = fields.One2many('tests.userwallets', 'user_id', string="User Wallets")
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
    <record id="view_res_partner_form_inherit" model="ir.ui.view">
        <field name="name">Contacts Custom Fields</field>
        <field name="model">res.partner</field>
        <field name="type">form</field>
        <field name="inherit_id" ref="base.view_partner_form"/>
        <field name="arch" type="xml">
            <xpath expr="//field[@name='category_id']" position="after">
                <field name="zone_id" string="Zone"/>
            </xpath>
            <!-- added below code for editable tree in contacts form -->
            <xpath expr="//page[@name='sales_purchases']" position="after" >
                <page string="Wallets">
                    <field name="user_wids">
                        <tree editable="bottom" string="User Wallets">
                            <field name="amount"/>
                            <field name="credits"/>
                            <field name="description"/>
                        </tree>
                    </field>
                </page>
            </xpath>
        </field>
    </record>
</odoo>

regards


Avatar
Abbandona
Risposta migliore

They removed the field since v14?
Did you find the new name or replacement?

Avatar
Abbandona
Risposta migliore

Did you found a solution? Because I am having the exact same problem with the same_vat_partner_id field

Avatar
Abbandona
Risposta migliore

Same error here. I want to add a treeview to just assign/add "hr.employees" to the crm.lead model view but when I click on "add a Line" it returns that "ValueError: Invalid field 'show_enrich_button' on model 'hr.employee'". I do not use that field whatsoever. Even when I exchange "hr.employees" with "res.partner" it returns the same error.

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
1
feb 21
3307
0
giu 21
2873
1
dic 20
14494
1
lug 25
2319
2
lug 25
7798