Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
3 Odpovědi
5290 Zobrazení

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
Zrušit
Nejlepší odpověď

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

Avatar
Zrušit
Nejlepší odpověď

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

Avatar
Zrušit
Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
úno 21
3218
0
čvn 21
2801
1
pro 20
14385
2
čvc 25
7011
2
čvc 25
3337