def action_cancel(self):
"""
@param self: object pointer
"""
for rec in self:
if not rec.order_id:
raise UserError(_("Order id is not available"))
for product in rec.room_line_ids.filtered(
lambda l: l.order_line_id.product_id == product
):
rooms = self.env["hotel.room"].search([("product_id", "=", product.id)])
rooms.write({"isroom": True, "status": "available"})
rec.invoice_ids.button_cancel()
return rec.order_id.action_cancel()
Hello how can I solve this error?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Contabilità
- Magazzino
- PoS
- Project
- MRP
La domanda è stata contrassegnata
1
Rispondi
6480
Visualizzazioni
Hi, You are filtering the room_line_ids in your for loop as below
lambda l: l.order_line_id.product_id == product
But the product variable in the right side of the expression is not assigned to any value.
Ti stai godendo la conversazione? Non leggere soltanto, partecipa anche tu!
Crea un account oggi per scoprire funzionalità esclusive ed entrare a far parte della nostra fantastica community!
RegistratiPost correlati | Risposte | Visualizzazioni | Attività | |
---|---|---|---|---|
|
0
ott 24
|
4935 | ||
|
12
lug 15
|
47692 |