Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
3 Odpowiedzi
5264 Widoki

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


Awatar
Odrzuć
Najlepsza odpowiedź

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

Awatar
Odrzuć
Najlepsza odpowiedź

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

Awatar
Odrzuć
Najlepsza odpowiedź

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.

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
lut 21
3181
0
cze 21
2777
1
gru 20
14357
2
lip 25
3273
2
lip 25
2994