I am trying to set the order date from the POS order(pos.order) as the date in invoice(account.invoice). I've tried to super action_pos_order_invoice with the date field from the order based on the code (shown as commented), and I'm getting the error
AttributeError: 'dict' object has no attribute 'order'
What am I doing wrong here?
@ api.multi
def action_pos_order_invoice (self):
invoice_fields = super (PosOrder, self) .action_pos_order_invoice ()
Invoice = self.env ['account.invoice']
for order in self:
# invoice.fiscal_position_id = order.fiscal_position_id (path:/addons/point_of_sale/models/pos_orders.py/ line: 687)
invoice = Invoice.new (order._prepare_invoice ())
print (invoice_fields.order.date_order)
invoice.date_invoice = invoice_fields.order.date_order
return invoice_fields