コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
6476 ビュー
    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?
アバター
破棄
最善の回答

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. 

アバター
破棄
関連投稿 返信 ビュー 活動
0
10月 24
4930
12
7月 15
47691