Skip to content

Commit

Permalink
[FIX] purchase_request: not allow to edit an approved purchase request
Browse files Browse the repository at this point in the history
This commit fixes the the following issue.

- Create a purchase request with some products and send it to approval
- The manager approves the purchase request.
- After the approval the user can add new products to the request and can abuse
  • Loading branch information
alan196 committed Feb 23, 2024
1 parent 52fb05b commit befe9d8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion purchase_request/models/purchase_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,10 @@ def _compute_is_editable(self):
comodel_name="purchase.request.line",
inverse_name="request_id",
string="Products to Purchase",
readonly=False,
readonly=True,
copy=True,
tracking=True,
states={"draft": [("readonly", False)]},
)
product_id = fields.Many2one(
comodel_name="product.product",
Expand Down

0 comments on commit befe9d8

Please sign in to comment.