Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

How share the same database cursor with same session during each phantom's steps?

By
Hugo Adan
on 1/14/16, 11:20 AM 437 views

Added follow prints sentence:import traceback;traceback.print_stack();print "force_carrier_id", force_carrier_id, "cr", cr, "order.id", order.id in follow file /root/odoo-8.0/addons/website_sale_delivery/models/sale_order.py in line 85, in method_check_carrier_quotation

I ran steps again and saw follow result:

  • File ""/root/odoo-8.0/addons/website_sale_options/controllers/main.py, line 46, in cart_options_update_json
        optional_product_ids=optional_product_ids)
      File ""/root/odoo-8.0/addons/website_sale_delivery/models/sale_order.py, line 141, in _cart_update
        self._check_carrier_quotation(cr, uid, sale_order, context=context)
      File ""/root/odoo-8.0/addons/website_sale_delivery/models/sale_order.py, line 86, in<0> _check_carrier_quotation
    force_carrier_id None cr openerp.sql_db.Cursor object at 0x7f08b01d32d order.id 151
    ...
    File ""/root/odoo-8.0/addons/website_sale/controllers/main.py, line 648, in confirm_order
        request.website.sale_get_order(update_pricelist=True, context=context)
      File ""/root/odoo-8.0/addons/website_sale/models/sale_order.py, line 197, in sale_get_order
        sale_order._cart_update(product_id=line.product_id.id, line_id=line.id, add_qty=0)
      File ""/root/odoo-8.0/addons/website_sale_delivery/models/sale_order.py, line 141, in _cart_update
        self._check_carrier_quotation(cr, uid, sale_order, context=context)
      File ""/root/odoo-8.0/addons/website_sale_delivery/models/sale_order.py, line 86, in<310> _check_carrier_quotation
    force_carrier_id None cr openerp.sql_db.Cursor object at 0x7f08a3dbc order.id 151
    ...
    File ""/root/odoo-8.0/addons/website_sale/controllers/main.py, line 648, in confirm_order
        request.website.sale_get_order(update_pricelist=True, context=context)
      File ""/root/odoo-8.0/addons/website_sale/models/sale_order.py, line 197, in sale_get_order
        sale_order._cart_update(product_id=line.product_id.id, line_id=line.id, add_qty=0)
      File ""/root/odoo-8.0/addons/website_sale_delivery/models/sale_order.py, line 141, in _cart_update
        self._check_carrier_quotation(cr, uid, sale_order, context=context)
      File ""/root/odoo-8.0/addons/website_sale_delivery/models/sale_order.py, line 86, in<10> _check_carrier_quotation
    force_carrier_id None cr openerp.sql_db.Cursor object at 0x7f08b0bf1c order.id 151
    ...
     File ""/root/odoo-8.0/addons/website_sale_delivery/controllers/main.py, line 18, in payment
        request.registry[''sale.order]._check_carrier_quotation(cr, uid, order, force_carrier_id=carrier_id, context=context)
    force_carrier_id 4 cr <7090>openerp.sql_db.Cursor object at 0x7f08b0fa order.id 151
    2016-01-13 03:47:56,520 14248 ERROR openerp_test openerp.sql_db: bad query: UPDATE ""sale_order""carrier_id""write_uid"write_date" SET =4,=1,
    =(now() at time zone ''UTC""/.repo_requirements/odoo/openerp/sql_db.py) WHERE id IN (151)
    Traceback (most recent call last):
      File , line 234, in execute res = self._obj.execute(query, params) TransactionRollbackError: could not serialize access due to concurrent update ...


Every time you enter the function _check_carrier_qoutation, different cursor is printed Is possible shared the same cursor in each request ?


Regards!

0

Axel Mendoza

--Axel Mendoza--
10228
| 7 7 8
Camaguey, Cuba
--Axel Mendoza--

DevOps - Full stack - Software Architect - Developer - Technology Integrator

I could help you to develop anything and solve complex problems based on technologies, integrations and tricky stuffs mostly in Python with OpenERP/Odoo, Zato, Django and many others frameworks programming languages and technologies.

I offers consulting services to anyone with an unanswered questions or needs for customizations. Think about it, maybe it's better to have an expert to solve your issues and projects than having a full time employee trying to understand what to do an how

Reach me at aekroft@gmail.com

Axel Mendoza
On 1/21/16, 8:36 PM

No, it's not possible to share the same db cursor for multiple requests, also there is no need for doing that.

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 1/14/16, 11:20 AM
Seen: 437 times
Last updated: 1/21/16, 8:36 PM