Community archives des diffusions par email

community@mail.odoo.com

Avatar

add a field in wizard.

par
Comstar Information System Associates , Assad Ali Sheikh
- 30/11/2017 00:07:59


Hi,


I am new in odoo and currently using odoo11.

  1. __manifest__.py

{
'name': 'My Module',
'version': '1.1',
'category': 'My Module',
'author':'zuhair',
'summary': 'Sales internal machinery',
'description': """
This module contains all the common features of Sales Management and eCommerce.
""",
'depends': ['base','sale','account'],
'data': [
'views/demo.xml', 'views/partner.xml', 'views/sale_order_inherit.xml', 'views/invoice_inherit.xml',

],
'demo': [

],

} 2. .py file

class InvoiceInsert(models.Model):
_name = "sale.advance.payment.inv.inherit"
_inherit = "sale.advance.payment.inv"

# Add a new column to the res.partner model, by default partners are not
# instructors
# instructor = fields.Boolean(default=False)

# customInvoice = fields.Selection([
# ('gst', "Gst"),
# ('nongst', "Non-Gst")
# ], string="Type of invoice (Gst / Non-Gst)", default="gst", required=True)
customInvoice = fields.Char(string='testing')


InvoiceInsert()
3. invoice_inherit.xml
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<data>
<!-- Add instructor field to existing view -->
<record model="ir.ui.view" id="view_sale_advance_payment_inv">
<field name="name">sale.advance.payment.inv.form.inherit</field>
<field name="model">sale.advance.payment.inv</field>
<field name="inherit_id" ref="sale.view_sale_advance_payment_inv"/>
<field name="arch" type="xml">
<xpath expr="/form/group/field[@name='advance_payment_method']" position="after">
<field name="customInvoice" widget="radio"/>
</xpath>
</field>
</record>
</data>
</odoo> Error:
Field `customInvoice` does not exist

Error context:
View `sale.advance.payment.inv.form.inherit`
[view_id: 979, xml_id: n/a, model: sale.advance.payment.inv, parent_id: 625]


Suiveurs