Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rma_repair] Exception raised when osv_memory.autovacuum run #13

Closed
andhit-r opened this issue Oct 24, 2017 · 1 comment
Closed

[rma_repair] Exception raised when osv_memory.autovacuum run #13

andhit-r opened this issue Oct 24, 2017 · 1 comment

Comments

@andhit-r
Copy link

Hi Guys,

On v8.0 i encountered problem when osv_memory.autovacuum run. Here are the logs:

2017-10-24 02:21:36,138 3724 ERROR mrp1 openerp.addons.base.ir.ir_cron: Call of self.pool.get('osv_memory.autovacuum').power_on(cr, uid, *()) failed in Job 1
Traceback (most recent call last):
File "/home/andhit_r/odoo8/odoo/openerp/addons/base/ir/ir_cron.py", line 138, in _callback
getattr(model, method_name)(cr, uid, *args)
File "/home/andhit_r/odoo8/odoo/openerp/api.py", line 268, in wrapper
return old_api(self, *args, **kwargs)
File "/home/andhit_r/odoo8/odoo/openerp/addons/base/ir/osv_memory_autovacuum.py", line 31, in power_on
model._transient_vacuum(cr, uid, force=True)
File "/home/andhit_r/odoo8/odoo/openerp/api.py", line 268, in wrapper
return old_api(self, *args, **kwargs)
File "/home/andhit_r/odoo8/odoo/openerp/models.py", line 5108, in _transient_vacuum
self._transient_clean_rows_older_than(cr, self._transient_max_hours * 60 * 60)
File "/home/andhit_r/odoo8/odoo/openerp/api.py", line 268, in wrapper
return old_api(self, *args, **kwargs)
File "/home/andhit_r/odoo8/odoo/openerp/models.py", line 5072, in _transient_clean_rows_older_than
self.unlink(cr, SUPERUSER_ID, ids)
File "/home/andhit_r/odoo8/odoo/openerp/api.py", line 268, in wrapper
return old_api(self, *args, **kwargs)
File "/home/andhit_r/odoo8/odoo/openerp/models.py", line 3631, in unlink
'where id IN %s', (sub_ids,))
File "/home/andhit_r/odoo8/odoo/openerp/sql_db.py", line 158, in wrapper
return f(self, *args, **kwargs)
File "/home/andhit_r/odoo8/odoo/openerp/sql_db.py", line 234, in execute
res = self._obj.execute(query, params)
IntegrityError: null value in column "wiz_id" violates not-null constraint
CONTEXT: SQL statement "UPDATE ONLY "public"."rma_order_line_make_repair_item" SET "wiz_id" = NULL WHERE $1 OPERATOR(pg_catalog.=) "wiz_id""

It cannot erase all the wizard data (rma.order.line.make.repair) since all the wizard items (rma.order.line.make.repair.item) need wiz_id. Do you guys having this similar problem?

Propose Solution:

  1. set required=False on wiz_id field, or
  2. Add ondelete="cascade" parameter on wiz_id
@LoisRForgeFlow
Copy link
Contributor

Hi @andhit-r

We haven't had this issue, but anyway your proposal seems good and can prevent it. Fix done in 2598b71

Thanks!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants