Skip to Content
Menu
This question has been flagged
1805 Views

Hi all i have upgraded from v12 to v14 EE

i have a custome module for Delivery Schedule where we can handle Late Deliveries against Sale Orders as well

in my workflow i have a function to create and post invoices for those sale orders but when i click it it gives me this error 

was working fine in v12

blow is the function


def create_validate_invoices (self):
if self.delivered_moves:
validated_deliveries = self.delivered_moves
sale_order_ids = validated_deliveries.mapped ('sale_line_id.order_id')
invoices = self.env ['account.move']. browse ((sale_order_ids._create (sale_order_ids._create (sale_order_ids._create (sale_order_ids._create) .ids)
invoices.write ({
'invoice_date': self.time_end.date (),
})
invoices._post ()
self.write ({
# 'sale_ids': [(6, 0, sale_order_ids.ids)],
# 'invoice_ids': [(6, 0, invoices.ids)],
'state': 'paid',
})
else:
self.write ({
'state': 'paid',
})
i would appreciate if anyone could guide me plz,thanks

Avatar
Discard

post more detail for proper help