Skip to Content
Menu
This question has been flagged

i am trying to customise the report template ,but when i tried to upgrade my module it shows an error field does not exist in xml .but when i checked my xml in view there is no such field in both the xml and py. that is in my module i did not even tried to add such a field .i searched alot but couldnt find an answer please help,my code is given below i am using odoo 10


my xml error message:

ParseError: "Error while validating constraint

Field `bank_reference` does not exist

Error context:
View `Account Payment Form Inherit`
[view_id: 1069, xml_id: n/a, model: account.payment, parent_id: 334]
None" while parsing /opt/odoo10/custom/addons/custom-addons/hb_vat_payment_receipt/views/account_payment_view.xml:4, near
<record id="inherit_account_payment_form1" model="ir.ui.view">
        <field name="name">Account Payment Form Inherit</field>
        <field name="model">account.payment</field>
        <field name="inherit_id" ref="account.view_account_payment_form"/>
        <field name="arch" type="xml">
            <data><field name="journal_id" position="before">
                <field name="trn_number" attrs="{'invisible': [('payment_type', 'not in', ('inbound', 'outbound'))]}" readonly="1"/>
            </field>
            <field name="partner_type" position="replace">
                <strong>
                    <field name="partner_type" nolabel="1" widget="selection" string="" attrs="{'required': [('payment_type', 'in', ('inbound', 'outbound'))], 'invisible': [('payment_type', 'not in', ('inbound', 'outbound'))], 'readonly': [('state', '!=', 'draft')]}"/>
                </strong>
            </field>
            <field name="partner_id" position="attributes">
                <attribute name="style">padding-left:0.8em;</attribute>
            </field>
        </data></field>
    </record>

my xml code:

<?xml version="1.0" encoding="utf-8"?>
<odoo>

<record id="inherit_account_payment_form" model="ir.ui.view">
<field name="name">Account Payment Form1 Inherit</field>
<field name="model">account.payment</field>
<field name="inherit_id" ref="account.view_account_payment_form"/>
<field name="arch" type="xml">
<field name="journal_id" position="before">
<field name="trn_number" attrs="{'invisible': [('payment_type', 'not in', ('inbound', 'outbound'))]}" readonly="1"/>
</field>
<field name="partner_type" position="replace">
<strong>
<field name="partner_type" nolabel="1" widget="selection" string="" attrs="{'required': [('payment_type', 'in', ('inbound', 'outbound'))], 'invisible': [('payment_type', 'not in', ('inbound', 'outbound'))], 'readonly': [('state', '!=', 'draft')]}"/>
</strong>
</field>
<field name="partner_id" position="attributes">
<attribute name="style">padding-left:0.8em;</attribute>
</field>
</field>
</record>

</odoo>

my python code is:

# -*- coding: utf-8 -*-

from odoo import models, fields, api

class AccountPayment(models.Model):
_inherit = "account.payment"

trn_number = fields.Char(related='partner_id.trn_number', string='TRN Number')

AccountPayment()






Avatar
Discard
Related Posts Replies Views Activity
0
Jul 17
2727
0
May 24
419
0
Oct 23
3
0
Jun 19
1839
0
Nov 18
2466