Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

what is wrong with this code? error is ParseError: "null value in column "name" violates not-null constraint

By
Ahmed
on 5/9/16, 5:47 AM 688 views

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

<openerp>

<data>

<record model = "ir.ui.view" id = "order_data">

<field name = 'date'>Order Date</field>

<field name = 'customer'>Customer</field>

<field name = 'product'>Product</field>

<field name = 'quantity'>Order Quantity</field>

<field name = 'deliverydate'>Delivery Date</field>

<field name = 'supplier'>Supplier</field>

<field name = 'vehiclenum'>Vehicle Number</field>

<field name = 'drivername'>Driver Name</field>

<field name = 'drivernum'>Driver Number</field>

<field name = 'deliveredquantity'>Delivered Quantity</field>

<field name = 'deliverylocation'>Delievery Location</field>

<field name = 'takinglocation'>Shipment From</field>

<field name = 'saleprice'>Sale Price</field>

<field name = 'Costprice'>Cost Price</field>

<field name = "model">oil.ordertaking</field>

<field name = "arch" type="xml">

<form string = "Oil Order Taking">

<sheet>

<group>

<field name= 'date' string="Order Date" />

<field name = 'customer' string="Customer"/>

<field name = 'product' string="Product"/>

<field name = 'quantity' string="Order Quantity"/>

<field name = 'deliverydate' string="Delivery Date"/>

<field name = 'supplier' string="Supplier"/>

<field name = 'vehiclenum' string="Vehicle Number"/>

<field name = 'drivername' string="Driver Name"/>

<field name = 'drivernum' string="Driver Number" />

<field name = 'deliveredquantity' string="Delivered Quantity"/>

<field name = 'deliverylocation' string="Delievery Location"/>

<field name = 'saleprice' string="Sale Price"/>

<field name = 'takinglocation' string="Shipment From"/>

<field name = 'Costprice' string="Cost Price"/>

</group>

</sheet>

</form>

</field>

</record>

<record model=s"ir.actions.act_window" id="order_data">

<field name='customer'>Order Date</field>

<field name='customer'>Customer</field>

<field name='product'>Product</field>

<field name='quantity'>Order Quantity</field>

<field name='customer'>Delivery Date</field>

<field name='supplier'>Supplier</field>

<field name='vehiclenum'>Vehicle Number</field>

<field name='drivername'>Driver Name</field>

<field name='drivernum'>Driver Number</field>

<field name='deliveredquantity'>Delivered Quantity</field>

<field name='deliverylocation'>Delievery Location</field>

<field name='takinglocation'>Shipment From</field>

<field name='saleprice'>Sale Price</field>

<field name='Costprice'>Cost Price</field>

<field name='res_model'>oil.ordertaking</field>

<field name='view_type'>form</field>

<field name='view_mode'>form</field>

</record>-->

<menuitem id="oil_main_head" action="order_data" name="Oil Kinetics Sale Order" sequence="10"/>

</data>

</openerp> 

thank you Akhil 

Ahmed
on 5/9/16, 2:08 PM
0

Akhil P Sivan

--Akhil P Sivan--
3423
| 5 3 6
Kochi, India
--Akhil P Sivan--

Interested in exploring Odoo both technically & functionality wise.

email-id : akhilpsivan01@gmail.com

Akhil P Sivan
On 5/9/16, 7:33 AM

Hi,

The syntax of your view definition is completely wrong. You may check the Odoo tutorial or refer some addons view definition in the xml files.

Here, you may change the code like following & check:

 <openerp>
     <data>
         <record model ="ir.ui.view" id="order_data_form_view">
<field name="name">order.data.form.view</field>
<field name ="model">oil.ordertaking</field>
<field name ="arch" type="xml">
<form string = "Oil Order Taking">
<sheet>
<group>
<field name= 'date' string="Order Date" />
<field name = 'customer' string="Customer"/>
<field name = 'product' string="Product"/>
<field name = 'quantity' string="Order Quantity"/>
<field name = 'deliverydate' string="Delivery Date"/>
<field name = 'supplier' string="Supplier"/>
<field name = 'vehiclenum' string="Vehicle Number"/>
<field name = 'drivername' string="Driver Name"/>
<field name = 'drivernum' string="Driver Number" />
<field name = 'deliveredquantity' string="Delivered Quantity"/>
<field name = 'deliverylocation' string="Delievery Location"/>
<field name = 'saleprice' string="Sale Price"/>
<field name = 'takinglocation' string="Shipment From"/>
<field name = 'Costprice' string="Cost Price"/>
</group>
</sheet>
</form>
</field>
</record>
<record model="ir.actions.act_window" id="order_data">
<field name="name">Order Details</field>
<field name="type">ir.actions.act_window</field>
<field name='res_model'>oil.ordertaking</field>
<field name='view_type'>form</field>
<field name='view_mode'>form</field>
</record>

<menuitem id="oil_main_head" action="order_data" name="Oil Kinetics Sale Order" sequence="10"/>
     
     </data>
</openerp>

Hope this helps

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 5/9/16, 5:47 AM
Seen: 688 times
Last updated: 5/12/16, 11:20 AM