Scheduler error

Bug #708595 reported by Alan Lord
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Invalid
Medium
OpenERP R&D Addons Team 2

Bug Description

Server is running Ubuntu 10.04.
OpenERP is the 6.0.1 deb from the OpenERP website.

Have been trying to make a demo for a prospect.

Using the "Invoice from Picking" option of a Sales Order with Partial Delivery and Invoice on Shipped Quantities... I have been trying to get Invoices to be created when each part of the sales order is picked and shipped (or at least show in the Sales->Invoices->Lines to Invoice list). But it doesn't seem to work...

I set the mrp scheduler to run every 5 minutes. This is what I'm seeing in the logs, and I'm getting the item I'm picking/delivering being flagged as State "Exception."

** This is in the openerp-server log file when the mrp scheduler runs automatically every 5 minutes **

[2011-01-27 11:45:28,593][demo_01] WARNING:browse_record:[01]: Field 'purchase_id' does not exist in object 'browse_record(procurement.order, 35)':
[2011-01-27 11:45:28,593][demo_01] WARNING:browse_record:[02]: None
[2011-01-27 11:45:28,594][demo_01] ERROR:netsvc.agent:Job call of self.pool.get('procurement.order').run_scheduler(cr, uid, *(False,)) failed
Traceback (most recent call last):
  File "/usr/share/pyshared/openerp-server/addons/base/ir/ir_cron.py", line 94, in _callback
    f(cr, uid, *args)
  File "/usr/share/pyshared/openerp-server/addons/procurement/procurement.py", line 469, in run_scheduler
    use_new_cursor=use_new_cursor, context=context)
  File "/usr/share/pyshared/openerp-server/addons/procurement/schedulers.py", line 223, in _procure_orderpoint_confirm
    if op.procurement_id and op.procurement_id.purchase_id and op.procurement_id.purchase_id.state in ('draft', 'confirmed'):
  File "/usr/share/pyshared/openerp-server/osv/orm.py", line 287, in __getattr__
    raise AttributeError(e)
AttributeError: "Field 'purchase_id' does not exist in object 'browse_record(procurement.order, 35)'"

** Here I manually ran the scheduler from the Warehouse->Schedulers->Compute Schedulers menu **

[2011-01-27 11:46:52,232][demo_01] WARNING:browse_record:[01]: Field 'purchase_id' does not exist in object 'browse_record(procurement.order, 35)':
[2011-01-27 11:46:52,233][demo_01] WARNING:browse_record:[02]: None
[2011-01-27 11:47:18,830][demo_01] WARNING:db.cursor:Cursor not closed explicitly
Please enable sql debugging to trace the caller.
[2011-01-27 11:47:27,516][demo_01] WARNING:db.connection_pool:ConnectionPool(used=0/count=2/max=64): Free leaked connection to 'user=openerp dbname=demo_01'

Related branches

Revision history for this message
Amit Parik (amit-parik) wrote :

Hello Alan Lord,

I have tested your scenario with stable 6.0 at my end. But I am not able to reproduce it.

So would you please elaborate with more or provide the proper steps to reproduce it.

Thanks.

Changed in openobject-addons:
status: New → Incomplete
Revision history for this message
Alan Lord (theopensourcerer) wrote :

Thanks for the follow up.

I did wonder if there was some sort of corruption in the db as I had another issue with not being able to run the Accounts Configuration wizard (UK minimal coa) so I started again and built a new database.

I have not seen this error with the new db so please feel free to close this or mark as invalid. If it re-appears I can try to dig a little further into the ultimate cause.

Thanks.

Revision history for this message
Amit Parik (amit-parik) wrote :

Hello Alan Lord,

Thanks for the quick reply. From your last comment I am closing this bug.

Changed in openobject-addons:
status: Incomplete → Invalid
Revision history for this message
Amit Parik (amit-parik) wrote :

Hello,

Today I have faced the same problem on trunk from scheduler.py(line#251).

Producible steps are:
1) Create one product with qty0.0 assign the supplier for this product.
2)Create a minimum stock rule with minimum qty10.00 and maximum qty20.00

3) Run the scheduler (2 times).

Then this type of trace-back will generated.

Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/lib/python2.6/threading.py", line 532, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.6/threading.py", line 484, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/home/amp/workspace/trunk6/addons/procurement/wizard/schedulers_all.py", line 52, in _procure_calculation_all
    context=context)
  File "/home/amp/workspace/trunk6/addons/procurement/schedulers.py", line 41, in run_scheduler
    use_new_cursor=use_new_cursor, context=context)
  File "/home/amp/workspace/trunk6/addons/procurement/schedulers.py", line 251, in _procure_orderpoint_confirm
    if op.procurement_id and op.procurement_id.purchase_id and op.procurement_id.purchase_id.state in ('draft', 'confirmed'):
  File "/home/amp/workspace/trunk6/server/openerp/osv/orm.py", line 478, in __getattr__
    raise AttributeError(e)
AttributeError: "Field 'purchase_id' does not exist in object 'browse_record(procurement.order, 8)'"

Cheers.

summary: - [6.0] mrp scheduler errors
+ Scheduler error
Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 2 (openerp-dev-addons2)
importance: Undecided → Medium
status: Invalid → Confirmed
Revision history for this message
Nicolas Réau (kolia) wrote :

Allan, Did you use the account_voucher module?

Revision history for this message
Amit Parik (amit-parik) wrote :

Hello Nicolas,

No, Here no need to use account_voucher module because error comes from procurement module when running the scheduler.

Thanks!

Revision history for this message
Alan Lord (theopensourcerer) wrote :

@Nicholas, Gosh!

I reported this on 2011-01-27. And we closed it soon after. I haven't seen that issue since, but no I do not recall using the account_voucher module.

Changed in openobject-addons:
status: Confirmed → In Progress
Revision history for this message
Ashvin Rathod (OpenERP) (ara-tinyerp) wrote :

Hello Alan Lord,

Its fixed in lp:~openerp-dev/openobject-addons/trunk-bug-708595-ara branch with following revision.

Revision No: 6786
Revision ID: <email address hidden>

Thank you,
ara

Changed in openobject-addons:
status: In Progress → Fix Committed
Revision history for this message
Amit Parik (amit-parik) wrote :

Hello Ashvin,

Really good work! and thanks for fixing it..:-)

Revision history for this message
Amit Parik (amit-parik) wrote :

Hello Folks,

I have again tried this issue with latest trunk, but amazing faced the another problem.

I tried same steps which I was given on comment#4, If the purchase module has not installed then it's give the following warning message
2012-08-27 06:01:15,500 2775 WARNING ? openerp.osv.orm.browse_record.procurement.order: Field 'purchase_id' does not exist in object 'browse_record(procurement.order, 11)'
2012-08-27 06:01:15,525 2775 WARNING ? openerp.osv.orm.browse_record.procurement.order: Field 'purchase_id' does not exist in object 'browse_record(procurement.order, 12)'

And even if I have installed the purchase module then It gives the traceback as follow.

2012-08-27 06:40:05,224 5367 ERROR ? openerp.sql_db: bad query: update stock_warehouse_orderpoint set "procurement_id"=8,write_uid=1,write_date=(now() at time zone 'UTC') where id IN (1)
Traceback (most recent call last):
  File "/home/amp/workspace/rdtools/server/trunk/openerp/sql_db.py", line 212, in execute
    res = self._obj.execute(query, params)
TransactionRollbackError: could not serialize access due to concurrent update

Exception in thread Thread-292:
Traceback (most recent call last):
  File "/usr/lib/python2.6/threading.py", line 532, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.6/threading.py", line 484, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/home/amp/workspace/rdtools/addons/trunk/procurement/wizard/schedulers_all.py", line 52, in _procure_calculation_all
    context=context)
  File "/home/amp/workspace/rdtools/addons/trunk/procurement/schedulers.py", line 41, in run_scheduler
    use_new_cursor=use_new_cursor, context=context)
  File "/home/amp/workspace/rdtools/addons/trunk/procurement/schedulers.py", line 286, in _procure_orderpoint_confirm
    {'procurement_id': proc_id}, context=context)
  File "/home/amp/workspace/rdtools/server/trunk/openerp/osv/orm.py", line 4012, in write
    'where id IN %s', upd1 + [sub_ids])
  File "/home/amp/workspace/rdtools/server/trunk/openerp/sql_db.py", line 152, in wrapper
    return f(self, *args, **kwargs)
  File "/home/amp/workspace/rdtools/server/trunk/openerp/sql_db.py", line 212, in execute
    res = self._obj.execute(query, params)
TransactionRollbackError: could not serialize access due to concurrent update

2012-08-27 06:40:05,459 5367 WARNING ? openerp.sql_db: Cursor not closed explicitly
Please enable sql debugging to trace the caller.

I am again confirming this issue because the bug still doesn't fixed yet as well the the related ashvin's branch is rejected.

Thank you!

Changed in openobject-addons:
status: Fix Committed → Confirmed
Revision history for this message
Nimesh Contractor(Open ERP) (nco-openerp) wrote :

Hello,

         I have check this issue at my end but it doesn't seems reproducible any more in latest trunk.

         rev nos:
         addons : 7437
         server : 4427
         web : 3062

         Thanks for reporting!

Thanks,
NCO

Changed in openobject-addons:
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.