Skip to Content
Menu
This question has been flagged

Hey i have duplicated purchase.order and i have added approval matrix lines in another page in it and a Many2one field in header and when i select the field from header lines with the user names populate in the line view of PO. Then i press ask approval button it changes state now what i want is that

* When i press Approve button it should not change state at once but it should change state after every user in the matrix lines press that button and a comment wizard should open for all of them.

Here is my code

@api.multi
    def button_approve(self):
        self.ensure_one()
        for rec in self.approval.matrix_order:
            if rec.res_user:
                self.write({'state': 'approved'})
                return self._add_comment()
it works for one time only. I know the code is already wrong so please suggest something. Thanks

Avatar
Discard
Related Posts Replies Views Activity
1
Sep 21
4948
0
Sep 17
2021
1
Aug 24
152
0
Mar 24
3286
3
Aug 22
2653