This question has been flagged
4 Replies
3579 Views

Hello, and thank you for helping.

I'm working on a POS module, creating pos.order objects.

order = {u'pflag': False, u'uid': u'00004-006-0002', u'table_ids': [6], u'creation_date': u'2019-07-19 13:37:30', u'table_data': [{u'reserver_seat': u'6', u'table_id': 6}], u'customer_count': 1, u'table': u'Table6', u'partner_id': 47, u'id': None, u'split_order': None, u'reserved_seat': u'6/6_', u'user_id': 1, u'statement_ids': [], u'floor': u'Main Floor', u'folio_id': 4, u'pos_session_id': 4, u'amount_tax': 0, u'amount_return': 0, u'parcel': False, u'amount_paid': 0, u'phone': False, u'creationDate': u' Table6/6', u'fiscal_position_id': False, u'amount_total': 1.69, u'name': u'Order 00004-006-0002', u'floor_id': 1, u'lines': [[0, 0, {u'mp_skip': False, u'note': u'', u'mp_dirty': True, u'product_id': 48, u'price_unit': 1.69, u'qty': 1, u'pack_lot_ids': [], u'discount': 0, u'order_line_state_id': 1, u'id': 6, u'tax_ids': [[6, False, []]]}]], u'driver_name': False, u'table_id': 6, u'sequence_number': 2}
myorders = self._order_fields(order)
​order_id = self.create(myorders)
_logger.critical(order_id)
Output:
2019-07-19 13:37:36,102 28976 CRITICAL new2 odoo.addons.pos_receipt.models.pos_receipt: pos.order(pos.order(89,),)
The fact is there is no pos.order with ID 89 , not in the pos.order list nor in the database (table: pos_order), so i'm getting errors when i try to add lines to that order:
MissingError: (u'Record does not exist or has been deleted.', None) 
Why i'm getting a reference to a non-existing pos.order ?
i read somewhere that because of some missing mandatory parameters (maybe stripped while passing throught self._order_fields) but i'm getting no errors nor warnings.

PS: sorry for the bad english

Avatar
Discard

You're facing a problem related to your order id missing in pos order?

Yes, creating an order returns an object with a non valid id, 89,  while valid orders can be shown in web interface and database with id's merely go beyond 20.

I read somewhere this because the returned object is in memory, not attached yet to a database record (like "sticky objects" in Zope/ZODB database). Creating a pos.order with a lot of module inheritance can take a lot of parameters, some missing would prevent the actual creation of an object fully mapped to database.

I'm struggling for days.


Le sam. 20 juil. 2019 à 04:08, Manish Kumar Bohra <mkbohra1994@gmail.com> a écrit :

You're facing a problem related to your order id missing in pos order?

Sent by Odoo S.A. using Odoo.

You validate your order I mean payment your invoices?

Author Best Answer

No,&nbsp;i&nbsp;did&nbsp;not

Avatar
Discard