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.

1

add record in existing module

By
vijay
on 2/5/16, 6:07 AM 425 views

i have create one module custom_module which is store record like firstname and lastname  of customer .now when i save the record it will also display in existing customer module,and i don't want any inherited field. for example:customer and suppliers.

0
Dr Obx
On 2/5/16, 7:50 AM

Your module must have method which will update existing module res.partner or res.user ....

Working on similar project at this moment. My module require it as well. Must add if not exist a new customer/supplier and create a new order.

Will follow your subject :)

This is an example given me by Gerthard (new API)

<pre>

  self.env['sale.order'].create({

     'field': variable,

     'field2': variable2

     ...

})

</pre> 

another example: (of course you have to adapt it to your requirements)

vals = {

'name': self.name,

'date_order': self.appointment_date,

'partner_id': self.patient.partner_id.id,

'user_id': self.doctor.partner_id.user_id.id,

'order_line': [[0, 0, {

'name': self.consultations.name,

'price_unit': self.consultations.list_price,

'product_id': self.consultations.id,

}]],

}

if pricelist_id:

vals['pricelist_id'] = pricelist_id.id

vals['currency_id'] = pricelist_id.currency_id.id

self.sale_id = self.env['sale.order'].create(vals)

u have any demo method so i can implement it.

vijay
on 2/5/16, 7:55 AM

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

0 follower(s)

Stats

Asked: 2/5/16, 6:07 AM
Seen: 425 times
Last updated: 2/5/16, 7:51 AM