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

I am trying to this: Automatically Close Purchase Order when all its tasks are CompletedI cannot touch the code directly at this moment (too many changes from front-end). So that's the LAST option I want to pursue. So, from front-end GUI, I am thinking to create an Automated Action on Task Update that runs a Server Action to do this task.

How to find if the task's project has all tasks in closed/cancelled state (or not)?

Can we modify any of these below and use them in a server action to do this?

    def
_task_count(self, cr, uid, ids, field_name, arg, context=None):
        res={}
        for tasks in self.browse(cr, uid, ids, dict(context, active_test=False)):
            res[tasks.id] = len(tasks.task_ids)
        return res


ids = models.execute_kw(db, uid, password,
'res.partner', 'search',
[[['is_company', '=', True], ['customer', '=', True]]],
{'limit': 1})
[record] = models.execute_kw(db, uid, password,
'res.partner', 'read', [ids])
# count the number of fields fetched by default
len(record)
อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
มี.ค. 23
1777
2
ม.ค. 20
15218
16
ส.ค. 19
10179
1
ม.ค. 19
5430
5
มิ.ย. 18
10840