Odoo Help

3

1
8 Answers
5
Avatar

Sudhir Arya (ERP Harbor Consulting Services) India

--Sudhir Arya (ERP Harbor Consulting Services)--
26747
| 8 9 10
Ahmedabad, India
--Sudhir Arya (ERP Harbor Consulting Services)--

• Co-Founder & Co-Owner at ERP Harbor Consulting Services

• ERP Consultant / ERP Customization / TechnoFunctional Expert

• Sound knowledge in Python, Odoo (Open ERP), XML, PostgreSQL

• Domain knowledge of Sale Management, Purchase Management, Warehouse Management, Manufacturing, Multi Company Configuration & Management, HR Management, Medical Management, Construction Management, Education Management, Point of Sale, Third Party Integrations

• Positive attitude and quick Learner

• Good analytical skill, quick bug and issue tracing and find the solution

• Good knowledge and experience in payment gateway integration with Odoo

• Ready to accept new challenges

• Active Memeber On Stackoverflow 

LinkedIn

Blog

Stackoverflow

ERP Harbor Consulting Services

Skype:sudhir@erpharbor.com
Website: http://www.erpharbor.com
Sudhir Arya (ERP Harbor Consulting Services) India
4/11/13, 7:52 AM

First you have to create many2one field of product.product and then you can create one2many field.

For example:

`partent_id`: fields.many2one('product.product', 'Parent Product', ondelete='cascade'),
`product_ids`: fields.one2many('product.product', 'parent_id', 'Products'),
3 Comments
mid123 India
1/29/14, 2:47 AM

Thanks for your reply

Shivam Mahajan India
5/2/16, 5:43 AM

but it still gives the integrity error

Shivam Mahajan India
5/2/16, 5:48 AM

Integrity Error The operation cannot be completed, probably due to the following: - deletion: you may be trying to delete a record while other records still reference it - creation/update: a mandatory field is not correctly set [object with reference: name - name]

1
mywebsitedeal India
8/27/14, 6:46 AM

Hi,

I also  have created that one2many field  on same model . it works but their are no records are being displayed  in one2many field .

How to display value in one2many .

1 Comment
dharupriyanshi@gmail.com India
1/11/17, 7:15 AM

you got solution to this?

0
Rey Perez Cuba
8/4/17, 7:18 AM

if you ask something like this:
model "product.product"
fields in the same model: product_parent_id, product_children_ids

when you try running the program this show some integrity error with the fields ids that should be into list product_children_ids,

you should solve with something like this, creating domain for this filed into the xml and some additional field into model like "type_product" if haven't anyone like this field to refer:

TYPE_MODE = [('product','product'),('subproduct','subproduct')]

model ("product.product")
type_product = fields.Selection(TYPE_MODE , 'Product Type', default='product', store=True)

xml (form_view for  "product.product")
<field name="product_children_ids" domain="[('type_product','=','subproduct')]">
                                <tree>
                                    <field name="code"/>
                                    <field name="descripcion"/>
                                    <field name="other_product_field_name"/>
                                </tree>
</field>

if this solve work for you, make me know.

Ask a Question
Writer
Keep Informed
0 follower(s)
About This Community

This platform 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.

Register
Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now