Technical архів поштової розсилки

technical@mail.odoo.com

Аватар

Re: POS order integrity issue.

від
Luis Alberto Guzman Garcia
- 26.08.2019 02:34:57

Thank you very much!

Great tip. I'll test it soon.

Best regards.


El 25/08/19 a las 17:32, Kiril Vangelovski escribió:

The POS orders are saved as a JSON string in Local Storage so you can edit it and remove the faulty order using your browser's dev tools. After that restart the POS and the remaining orders should get pushed to the server.

Here is where you can find them in Chrome:


Kind Regards,
Kiril

On 25.8.19 23:08, Luis Guzman wrote:
Hello guys,

I'd like to request some help with an issue that happened for the first
time in years.

I have POS for Odoo 10 working and after creating an order I got this error,

2019-08-24 16:05:43,300 4623 DEBUG tpv-odoov10 odoo.modules.registry: Multiprocess signaling check: [Registry - 29 -> 29] [Cache - 673 -> 673]
2019-08-24 16:05:43,304 4623 DEBUG tpv-odoov10 odoo.api: call pos.order().create_from_ui([{u'to_invoice': False, u'data': {u'user_id': 6, u'name': u'Pedido 00651-001-0028', u'partner_id': 1133, u'amount_paid': 1070, u'pos_session_id': 651, u'lines': [[0, 0, {u'product_id': 1066, u'price_unit': 240, u'qty': 1, u'pack_lot_ids': [], u'discount': 0, u'id': 1, u'tax_ids': [[6, False, [1]]]}], [0, 0, {u'product_id': 1001, u'price_unit': 830, u'qty': 1, u'pack_lot_ids': [], u'discount': 0, u'id': 2, u'tax_ids': [[6, False, [1]]]}]], u'statement_ids': [[0, 0, {u'journal_id': 8, u'amount': 1070, u'name': u'2019-08-24 16:05:37', u'account_id': 33, u'statement_id': 1085}]], u'creation_date': u'2019-08-24 16:05:37', u'amount_tax': 0, u'fiscal_position_id': False, u'uid': u'00651-001-0028', u'pricelist_id': 1, u'amount_return': 0, u'sequence_number': 28, u'amount_total': 1070}, u'id': u'00651-001-0028'}])
2019-08-24 16:05:43,336 4623 INFO tpv-odoov10 odoo.sql_db: bad query: INSERT INTO "pos_order" ("id", "nb_print", "user_id", "name", "pos_reference", "company_id", "session_id", "state", "sequence_number", "pricelist_id", "date_order", "partner_id", "fiscal_position_id", "create_uid", "write_uid", "create_date", "write_date") VALUES(nextval('pos_order_id_seq'), 0, 6, 'Main/57886', 'Pedido 00651-001-0028', 1, 651, 'draft', 1, 1, '2019-08-24 16:05:37', 1133, NULL, 6, 6, (now() at time zone 'UTC'), (now() at time zone 'UTC')) RETURNING id
2019-08-24 16:05:43,374 4623 DEBUG tpv-odoov10 odoo.service.model: IntegrityError
Traceback (most recent call last):
  File "/opt/odoov10/odoov10-server/odoo/service/model.py", line 101, in wrapper
    return f(dbname, *args, **kwargs)
  File "/opt/odoov10/odoov10-server/odoo/http.py", line 327, in checked_call
    result = self.endpoint(*a, **kw)
  File "/opt/odoov10/odoov10-server/odoo/http.py", line 942, in __call__
    return self.method(*args, **kw)
  File "/opt/odoov10/odoov10-server/odoo/http.py", line 507, in response_wrap
    response = f(*args, **kw)
  File "/opt/odoov10/odoov10-server/addons/web/controllers/main.py", line 895, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/opt/odoov10/odoov10-server/addons/web/controllers/main.py", line 887, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/opt/odoov10/odoov10-server/odoo/api.py", line 687, in call_kw
    return call_kw_model(method, model, args, kwargs)
  File "/opt/odoov10/odoov10-server/odoo/api.py", line 672, in call_kw_model
    result = method(recs, *args, **kwargs)
  File "/opt/odoov10/custom/addons/pos_orders/models/wk_orders.py", line 18, in create_from_ui
    order_ids = super(PosOrder,self).create_from_ui(orders)
  File "/opt/odoov10/odoov10-server/addons/point_of_sale/models/pos_order.py", line 613, in create_from_ui
    pos_order = self._process_order(order)
  File "/opt/odoov10/odoov10-server/addons/point_of_sale/models/pos_order.py", line 111, in _process_order
    order = self.create(self._order_fields(pos_order))
  File "/opt/odoov10/odoov10-server/addons/point_of_sale/models/pos_order.py", line 518, in create
    return super(PosOrder, self).create(values)
  File "/opt/odoov10/odoov10-server/odoo/models.py", line 3876, in create
    record = self.browse(self._create(old_vals))
  File "/opt/odoov10/odoov10-server/odoo/models.py", line 3971, in _create
    cr.execute(query, tuple(u[2] for u in updates if len(u) > 2))
  File "/opt/odoov10/odoov10-server/odoo/sql_db.py", line 154, in wrapper
    return f(self, *args, **kwargs)
  File "/opt/odoov10/odoov10-server/odoo/sql_db.py", line 231, in execute
    res = self._obj.execute(query, params)
IntegrityError: insert or update on table "pos_order" violates foreign key constraint "pos_order_partner_id_fkey"
DETAIL:  Key (partner_id)=(1133) is not present in table "res_partner".

The issue is that no mater what I do from the web interface, all the
following pos sales are on hold on the browser, with no recording on the
session.

Can't seem to find anything online, is there a way to delete that
specific order from browser cache, so all the rest can "flow" correctly.


Best regards and thanks in advance.

_______________________________________________
Mailing-List: https://www.odoo.com/groups/technical-62
Post to: mailto:technical@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe

_______________________________________________
Mailing-List: https://www.odoo.com/groups/technical-62
Post to: mailto:technical@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe


Референс