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

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

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

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.

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

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

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 8 25
168
2
thg 8 25
1309
0
thg 2 25
1450
1
thg 1 25
2010
2
thg 12 24
1681