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

i want to create an automation in which the customer will automatically added to the specific group when the subscription status is in progress

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

Hi,

Steps:

1. Settings->Technical->Automation-> Automation rules

model: Sales order(Subscription model is also sale.order)

Tigger: State is set to Sales order (When a sale order is confirmed, the related subscription is considered to be in progress).


2. Add an action for the automation rule.


Hope it helps.

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

Go to: Settings > Technical > Automation > Automated Actions
Create  a new automation Action

  • Model: Subscription
  • Trigger: On Update
  • Trigger Fields: state
  • Filter: State = 'in_progress'
  • Action To Do: Execute Python Code
  • python code 

group = env.ref('base.group_user') 

partner = record.partner_id

user = partner.user_ids and partner.user_ids[0]  

if user and group not in user.groups_id:

    user.groups_id += group

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
2
ส.ค. 25
148
2
ส.ค. 25
1301
0
ก.พ. 25
1447
1
ม.ค. 25
1996
2
ธ.ค. 24
1674