Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
4843 Lượt xem

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.

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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)

Ảnh đại diện
Huỷ bỏ
Tác giả

u have any demo method so i can implement it.

Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 10 24
974
3
thg 2 18
3932
2
thg 12 17
4791
1
thg 4 15
4288
0
thg 3 15
3372