Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
3 ตอบกลับ
5276 มุมมอง

When creating a new product I would like each product to automatically have a Internal Reference. How can I do this using "Sequences" and Automated/Server Actions?


Thanks

Ricardo

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi,
See this sample showing setting up a sequential number for customers from the user interface. You just have to create an automated action.

See this sample:  Assign Sequential Value For Field Using Automated Action And Sequence


Thanks

อวตาร
ละทิ้ง

Hi @Ricardo, you can make the field read only in the views by adding a readonly="1" attribute to the default_code field. i.e <field name="default_code" readonly="1" .... />

You might be better off with a client side readonly such as attrs={'readonly':[('default_code','!=',False)]} and add force_save="1" because as soon as you enter a value, the field will become readonly and you will need to force save - the value won't be saved unless you do that.

ผู้เขียน คำตอบที่ดีที่สุด

Thanks Niyas for the video link!

I created the sequence:


and the automated action:



But I'm missing to find the best way to turn it Readonly?


And the "Internal Reference" for Product variants, isn't working!


Thanks

อวตาร
ละทิ้ง

Did you found the solution to generate sequences of product variants and make the field read only?

คำตอบที่ดีที่สุด

Hi, you have just to check the Readonly property of your field like this pic.

WhatsApp : +225 05 45 14 53 91

Regards !

อวตาร
ละทิ้ง
ผู้เขียน

Thanks Abdul! but how to solve it without Studio?

Hello, u just need to make a field readonly and now, write ur automated actions.

For make a field readonly without Odoo studio, just go to this right model XML, and add to field , readonly="1"

U can reach me on my whatsApp number 
WhatsApp : +225 0545145391

Regards !

Le sam. 24 juin 2023 à 07:40, Ricardo Gross <notifications@mail.odoo.com> a écrit :
Thanks Abdul! but how to solve it without Studio? ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​ ͏ ​

Thanks Abdul! but how to solve it without Studio?

--
Ricardo Gross


Odoo S.A.

+32 81 81 37 00 | info@odoo.com | https://www.odoo.com

Généré par Odoo

Related Posts ตอบกลับ มุมมอง กิจกรรม
0
ก.พ. 22
157
0
ก.พ. 22
3280
1
มิ.ย. 24
1357
0
ม.ค. 23
1461
1
มี.ค. 22
3485