Hello,
I'm trying to run a python function when I click on "Save" in a product page but I don't know what is the function I have to inherit from product.product or product.template.
Please, help me ! Thank you in advance.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Hello,
I'm trying to run a python function when I click on "Save" in a product page but I don't know what is the function I have to inherit from product.product or product.template.
Please, help me ! Thank you in advance.
def create() if it is a new record
def write() if it is an existing record.
You can find nice informations in the documentation of odoo about the ORM : https://www.odoo.com/documentation/8.0/reference/orm.html
product.product if you are in a product variant view
product.template if you are on a product view.
You can find easily in the url the active_model.
When you click on "Save" button below two method you have to inherit...
def create(self, cr, uid, ids, context=None):
--
--
res = super(sale_order, self).create(cr, uid, ids, context=None)
--
--
return res
or
def write(self, cr, uid, ids,vals, context=None):
--
--
res = super(sale_order, self).create(cr, uid, ids, vals,context=None)
--
--
return res
สร้างบัญชีวันนี้เพื่อเพลิดเพลินไปกับฟีเจอร์พิเศษและมีส่วนร่วมกับคอมมูนิตี้ที่ยอดเยี่ยมของเรา!
ลงชื่อRelated Posts | ตอบกลับ | มุมมอง | กิจกรรม | |
---|---|---|---|---|
|
1
มี.ค. 21
|
7632 | ||
|
2
เม.ย. 25
|
3080 | ||
Add products in attribute values?
แก้ไขแล้ว
|
|
1
พ.ค. 19
|
5024 | |
|
0
ธ.ค. 23
|
1576 | ||
|
4
พ.ย. 20
|
4815 |