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

[8.0] Attribute error when generating recurring invoices

By
Rubén Cabrera
on 6/13/16, 12:54 PM 232 views

Hello:

This odoo database is a migration from v7, today is the first day and everything else starts to work correctly, but can't seem to find a way out of this one.


How to reproduce:


Go to contracts, select a contract with recurring invoices and click on "generate recurring invoices".


I get the following error:

Traceback (most recent call last):
  File "/home/dev/opt/odoo/openerp/http.py", line 537, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/home/dev/opt/odoo/openerp/http.py", line 574, in dispatch
    result = self._call_function(**self.params)
  File "/home/dev/opt/odoo/openerp/http.py", line 310, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/home/dev/opt/odoo/openerp/service/model.py", line 118, in wrapper
    return f(dbname, *args, **kwargs)
  File "/home/dev/opt/odoo/openerp/http.py", line 307, in checked_call
    return self.endpoint(*a, **kw)
  File "/home/dev/opt/odoo/openerp/http.py", line 803, in __call__
    return self.method(*args, **kw)
  File "/home/dev/opt/odoo/openerp/http.py", line 403, in response_wrap
    response = f(*args, **kw)
  File "/home/dev/opt/odoo/addons/web/controllers/main.py", line 948, in call_button
    action = self._call_kw(model, method, args, {})
  File "/home/dev/opt/odoo/addons/web/controllers/main.py", line 936, in _call_kw
    return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)
  File "/home/dev/opt/odoo/openerp/api.py", line 256, in wrapper
    return old_api(self, *args, **kwargs)
  File "/home/dev/opt/odoo/addons/account_analytic_analysis/account_analytic_analysis.py", line 750, in recurring_create_invoice
    return self._recurring_create_invoice(cr, uid, ids, context=context)
  File "/home/dev/opt/odoo/openerp/api.py", line 256, in wrapper
    return old_api(self, *args, **kwargs)
  File "/home/dev/opt/odoo/addons/account_analytic_analysis/account_analytic_analysis.py", line 769, in _recurring_create_invoice
    invoice_ids.append(self.pool['account.invoice'].create(cr, uid, invoice_values, context=context))
  File "/home/dev/opt/odoo/openerp/api.py", line 256, in wrapper
    return old_api(self, *args, **kwargs)
  File "/home/dev/opt/odoo/addons/mail/mail_thread.py", line 378, in create
    message_follower_ids = values.get('message_follower_ids') or []  # webclient can send None or False
AttributeError: 'bool' object has no attribute 'get'



This is the block with the line referenced in the traceback (mail_thread.py lines 375-380 :


        # subscribe uid unless asked not to
        if not context.get('mail_create_nosubscribe'):
            pid = self.pool['res.users'].browse(cr, SUPERUSER_ID, uid).partner_id.id
            message_follower_ids = values.get('message_follower_ids') or []  # webclient can send None or False
            message_follower_ids.append([4, pid])
            values['message_follower_ids'] = message_follower_ids


I tried selecting "Never" in receive email messages for the res.partner of my user but that didn't work.


Also tried to avoid that block by checking if values is True in that same file but didn't manage to update the mail.thread model correctly. I'd rather to avoid that method, as it seems very bad practice, but this is invoice generating, so anything is less important than not having invoices done, cheating is ok with me in this matter.


Thanks a lot.

0
Rubén Cabrera
On 6/15/16, 5:58 AM

The problem is solved and the solution had nothing to do with the code above.


The problem was caused by a legacy module written for OpenERP 7. After refactoring it to the v8 api things worked perfectly, but I still don't know why.

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: 6/13/16, 12:54 PM
Seen: 232 times
Last updated: 6/15/16, 5:58 AM