تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
4795 أدوات العرض

Hello,


When I set the stage of a task in the project module to the closing stage, I want the sales order line linked to that task to update the delivered quantity to match the initial quantity. For products that have Milestones set as their invoicing policy.


For example, I planned to sell 50hours for a service to one of my clients (milestones). When I mark the task linked to that item as done (closing stage), the delivered quantity on the sales order should update to 50hours. The sales order should now appear as "to invoice".


Can I do that by simply creating an automated action ? If so, how ?


Thanks

الصورة الرمزية
إهمال
الكاتب أفضل إجابة

So this can be done with an automated action with executing a Python code:


try:
if record.stage_id and record.sale_line_id and record.sale_line_id.product_id:
if record.stage_id.name == "Done" and record.sale_line_id.qty_delivered == 0:
qty = record.sale_line_id.product_uom_qty
record.sale_line_id['qty_delivered'] = qty
except:
pass


الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
3
فبراير 20
3755
1
أغسطس 25
3601
1
يناير 17
10821
1
مارس 15
8268
1
سبتمبر 18
4660