Skip to content

Commit

Permalink
[FIX] purchase_requisition: state_blanket_order on multiple records
Browse files Browse the repository at this point in the history
Reading `state_blanket_order` on multiple records was failing.

e.g.
```python
env['purchase.requisition'].create({})
env['purchase.requisition'].create({})
env['purchase.requisition'].search([]).mapped('state_blanket_order')
```
raised
```python
ValueError: Expected singleton: purchase.requisition(5, 1, 4)
```

closes odoo#48639

X-original-commit: 031c3f3
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
  • Loading branch information
beledouxdenis committed Mar 30, 2020
1 parent 6f0a4f1 commit 1f71fe4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion addons/purchase_requisition/models/purchase_requisition.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ def _get_type_id(self):

@api.depends('state')
def _set_state(self):
self.state_blanket_order = self.state
for requisition in self:
requisition.state_blanket_order = requisition.state

@api.onchange('vendor_id')
def _onchange_vendor(self):
Expand Down

0 comments on commit 1f71fe4

Please sign in to comment.