While using latest Odoo 10 and odoo-saas-tools I am not able to confirm incoming payments. The error in form of an infinite loop seems only to occur while using "saas_portal_sale"/"saas_portal_sale_online" AND the "purchase" module. Both alone work without any error.
As solution for the first occuring loop it helps to fix the typo in /saas_portal_sale/models/account_invoice.py line 40 where "compositon_mode" should be "composition_mode".
But this does not fix the whole error, it still remains in the second infinite loop.
Here is my excerpt of the log-file:
2017-10-02 08:50:01,804 30173 DEBUG database.local odoo.api: call account.payment(5,).post()
// START LOOP 69 TIMES
2017-10-02 08:50:02,179 30173 WARNING database.local odoo.models: mail.compose.message.create() includes unknown fields: compositon_mode
// END LOOP
2017-10-02 08:50:09,718 30173 INFO database.local odoo.addons.mail.models.mail_template: Failed to load template u"\n Your payment for service is accepted!\n\n
Now you can choose domain name for your service and create database
\n "
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/odoo/addons/mail/models/mail_template.py", line 374, in render_template
template = mako_env.from_string(tools.ustr(template_txt))
File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 880, in from_string
return cls.from_code(self, self.compile(source), globals, None)
File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 579, in compile
source = self._parse(source, name, filename)
File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 497, in _parse
return Parser(self, source, name, encode_filename(filename)).parse()
File "/usr/local/lib/python2.7/dist-packages/jinja2/parser.py", line 896, in parse
result = nodes.Template(self.subparse(), lineno=1)
File "/usr/local/lib/python2.7/dist-packages/jinja2/parser.py", line 878, in subparse
rv = self.parse_statement()
File "/usr/local/lib/python2.7/dist-packages/jinja2/parser.py", line 130, in parsestatement
return getattr(self, 'parse' + self.stream.current.value)()
File "/usr/local/lib/python2.7/dist-packages/jinja2/parser.py", line 193, in parse_for
extra_end_rules=('name:recursive',))
File "/usr/local/lib/python2.7/dist-packages/jinja2/parser.py", line 615, in parse_tuple
args.append(parse())
File "/usr/local/lib/python2.7/dist-packages/jinja2/parser.py", line 607, in
parse = lambda: self.parse_expression(with_condexpr=False)
File "/usr/local/lib/python2.7/dist-packages/jinja2/parser.py", line 428, in parse_expression
return self.parse_or()
File "/usr/local/lib/python2.7/dist-packages/jinja2/parser.py", line 445, in parse_or
left = self.parse_and()
File "/usr/local/lib/python2.7/dist-packages/jinja2/parser.py", line 454, in parse_and
left = self.parse_not()
File "/usr/local/lib/python2.7/dist-packages/jinja2/parser.py", line 465, in parse_not
return self.parse_compare()
File "/usr/local/lib/python2.7/dist-packages/jinja2/parser.py", line 469, in parse_compare
expr = self.parse_math1()
File "/usr/local/lib/python2.7/dist-packages/jinja2/parser.py", line 491, in parse_math1
left = self.parse_concat()
File "/usr/local/lib/python2.7/dist-packages/jinja2/parser.py", line 502, in parse_concat
args = [self.parse_math2()]
File "/usr/local/lib/python2.7/dist-packages/jinja2/parser.py", line 512, in parse_math2
left = self.parse_pow()
File "/usr/local/lib/python2.7/dist-packages/jinja2/parser.py", line 523, in parse_pow
left = self.parse_unary()
File "/usr/local/lib/python2.7/dist-packages/jinja2/parser.py", line 542, in parse_unary
node = self.parse_postfix(node)
File "/usr/local/lib/python2.7/dist-packages/jinja2/parser.py", line 667, in parse_postfix
node = self.parse_subscript(node)
File "/usr/local/lib/python2.7/dist-packages/jinja2/parser.py", line 708, in parse_subscript
args.append(self.parse_subscribed())
File "/usr/local/lib/python2.7/dist-packages/jinja2/parser.py", line 724, in parse_subscribed
node = self.parse_expression()
File "/usr/local/lib/python2.7/dist-packages/jinja2/parser.py", line 427, in parse_expression
return self.parse_condexpr()
File "/usr/local/lib/python2.7/dist-packages/jinja2/parser.py", line 432, in parse_condexpr
expr1 = self.parse_or()
File "/usr/local/lib/python2.7/dist-packages/jinja2/parser.py", line 445, in parse_or
left = self.parse_and()
File "/usr/local/lib/python2.7/dist-packages/jinja2/parser.py", line 454, in parse_and
left = self.parse_not()
File "/usr/local/lib/python2.7/dist-packages/jinja2/parser.py", line 465, in parse_not
return self.parse_compare()
File "/usr/local/lib/python2.7/dist-packages/jinja2/parser.py", line 469, in parse_compare
expr = self.parse_math1()
File "/usr/local/lib/python2.7/dist-packages/jinja2/parser.py", line 491, in parse_math1
left = self.parse_concat()
File "/usr/local/lib/python2.7/dist-packages/jinja2/parser.py", line 502, in parse_concat
args = [self.parse_math2()]
File "/usr/local/lib/python2.7/dist-packages/jinja2/parser.py", line 512, in parse_math2
left = self.parse_pow()
File "/usr/local/lib/python2.7/dist-packages/jinja2/parser.py", line 523, in parse_pow
left = self.parse_unary()
File "/usr/local/lib/python2.7/dist-packages/jinja2/parser.py", line 541, in parse_unary
node = self.parse_primary()
File "/usr/local/lib/python2.7/dist-packages/jinja2/parser.py", line 559, in parse_primary
next(self.stream)
File "/usr/local/lib/python2.7/dist-packages/jinja2/lexer.py", line 361, in next
self.current = next(self._iter)
File "/usr/local/lib/python2.7/dist-packages/jinja2/lexer.py", line 564, in wrap
for lineno, token, value in stream:
File "/usr/local/lib/python2.7/dist-packages/jinja2/lexer.py", line 640, in tokeniter
if isinstance(tokens, tuple):
RuntimeError: maximum recursion depth exceeded while calling a Python object
2017-10-02 08:50:09,799 30173 ERROR database.local odoo.http: Exception during JSON request handling.
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/odoo/http.py", line 640, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/usr/lib/python2.7/dist-packages/odoo/http.py", line 677, in dispatch
result = self._call_function(self.params)
File "/usr/lib/python2.7/dist-packages/odoo/http.py", line 333, in _call_function
return checked_call(self.db, *args, *kwargs)
File "/usr/lib/python2.7/dist-packages/odoo/service/model.py", line 101, in wrapper
return f(dbname, args, kwargs)
File "/usr/lib/python2.7/dist-packages/odoo/http.py", line 326, in checked_call
result = self.endpoint(*a, kw)
File "/usr/lib/python2.7/dist-packages/odoo/http.py", line 935, in call
return self.method(*args, *kw)
File "/usr/lib/python2.7/dist-packages/odoo/http.py", line 506, in response_wrap
response = f(args, kw)
File "/usr/lib/python2.7/dist-packages/odoo/addons/web/controllers/main.py", line 889, in call_button
action = self._call_kw(model, method, args, {})
File "/usr/lib/python2.7/dist-packages/odoo/addons/web/controllers/main.py", line 877, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/usr/lib/python2.7/dist-packages/odoo/api.py", line 689, in call_kw
return call_kw_multi(method, model, args, kwargs)
File "/usr/lib/python2.7/dist-packages/odoo/api.py", line 680, in call_kw_multi
result = method(recs, args, kwargs)
File "/usr/lib/python2.7/dist-packages/odoo/addons/account/models/account_payment.py", line 364, in post
move = rec._create_payment_entry(amount)
File "/usr/lib/python2.7/dist-packages/odoo/addons/account/models/account_payment.py", line 429, in _create_payment_entry
self.invoice_ids.register_payment(counterpart_aml)
File "/usr/lib/python2.7/dist-packages/odoo/addons/account/models/account_invoice.py", line 663, in register_payment
return (line_to_reconcile + payment_line).reconcile(writeoff_acc_id, writeoff_journal_id)
File "/usr/lib/python2.7/dist-packages/odoo/addons/account/models/account_move.py", line 900, in reconcile
remaining_moves = self.auto_reconcile_lines()
File "/usr/lib/python2.7/dist-packages/odoo/addons/account/models/account_move.py", line 866, in auto_reconcile_lines
'currency_id': currency,
File "/usr/lib/python2.7/dist-packages/odoo/addons/account/models/account_move.py", line 1537, in create
res = super(AccountPartialReconcile, self).create(vals)
File "/usr/lib/python2.7/dist-packages/odoo/models.py", line 3826, in create
record = self.browse(self._create(old_vals))
File "/usr/lib/python2.7/dist-packages/odoo/models.py", line 3993, in _create
self.recompute()
File "/usr/lib/python2.7/dist-packages/odoo/models.py", line 5319, in recompute
recs.browse(ids)._write(dict(vals))
// START LOOP 69 TIMES
File "/usr/lib/python2.7/dist-packages/odoo/addons/account/models/account_invoice.py", line 359, in _write
(reconciled & pre_reconciled).filtered(lambda invoice: invoice.state == 'open').action_invoice_paid()
File "/usr/lib/python2.7/dist-packages/odoo/it-projects-llc/odoo-saas-tools.git/saas_portal_sale/models/account_invoice.py", line 40, in action_invoice_paid
plans=plans).message_post_with_template(template.id, compositon_mode='comment')
File "/usr/lib/python2.7/dist-packages/odoo/addons/mail/models/mail_thread.py", line 1949, in message_post_with_template
return composer.send_mail()
File "/usr/lib/python2.7/dist-packages/odoo/addons/purchase/models/purchase.py", line 1174, in send_mail
return super(MailComposeMessage, self.with_context(mail_post_autofollow=True)).send_mail(auto_commit=auto_commit)
File "/usr/lib/python2.7/dist-packages/odoo/addons/sale/wizard/mail_compose_message.py", line 17, in send_mail
return super(MailComposeMessage, self).send_mail(auto_commit=auto_commit)
File "/usr/lib/python2.7/dist-packages/odoo/addons/account/models/account_invoice.py", line 1539, in send_mail
return super(MailComposeMessage, self).send_mail(auto_commit=auto_commit)
File "/usr/lib/python2.7/dist-packages/odoo/addons/mail/wizard/mail_compose_message.py", line 258, in send_mail
mail_values)
File "/usr/lib/python2.7/dist-packages/odoo/addons/mail/models/mail_thread.py", line 1838, in message_post
self.message_subscribe(list(partner_to_subscribe), force=False)
File "/usr/lib/python2.7/dist-packages/odoo/addons/mail/models/mail_thread.py", line 1988, in message_subscribe
self.sudo().write({'message_follower_ids': gen})
File "/usr/lib/python2.7/dist-packages/odoo/addons/purchase/models/account_invoice.py", line 204, in write
result = result and super(AccountInvoice, invoice).write(vals)
File "/usr/lib/python2.7/dist-packages/odoo/addons/mail/models/mail_thread.py", line 274, in write
result = super(MailThread, self).write(values)
File "/usr/lib/python2.7/dist-packages/odoo/models.py", line 3560, in write
self._write(old_vals)
// END LOOP
File "/usr/lib/python2.7/dist-packages/odoo/addons/account/models/account_invoice.py", line 354, in _write
pre_not_reconciled = self.filtered(lambda invoice: not invoice.reconciled)
File "/usr/lib/python2.7/dist-packages/odoo/models.py", line 4993, in filtered
return self.browse([rec.id for rec in self if func(rec)])
File "/usr/lib/python2.7/dist-packages/odoo/addons/account/models/account_invoice.py", line 354, in
pre_not_reconciled = self.filtered(lambda invoice: not invoice.reconciled)
File "/usr/lib/python2.7/dist-packages/odoo/fields.py", line 870, in get
self.determine_value(record)
File "/usr/lib/python2.7/dist-packages/odoo/fields.py", line 956, in determine_value
self.compute_value(recs)
File "/usr/lib/python2.7/dist-packages/odoo/fields.py", line 936, in compute_value
self._compute_value(records)
File "/usr/lib/python2.7/dist-packages/odoo/fields.py", line 927, in _compute_value
getattr(records, self.compute)()
File "", line 2, in _compute_residual
File "/usr/lib/python2.7/dist-packages/odoo/api.py", line 369, in loop
result = [method(rec, args, kwargs) for rec in self]
File "/usr/lib/python2.7/dist-packages/odoo/addons/account/models/account_invoice.py", line 91, in _compute_residual
sign = self.type in ['in_refund', 'out_refund'] and -1 or 1
File "/usr/lib/python2.7/dist-packages/odoo/fields.py", line 870, in get
self.determine_value(record)
File "/usr/lib/python2.7/dist-packages/odoo/fields.py", line 972, in determine_value
record._prefetch_field(self)
File "/usr/lib/python2.7/dist-packages/odoo/models.py", line 3066, in _prefetch_field
result = records.read([f.name for f in fs], load='_classic_write')
File "/usr/lib/python2.7/dist-packages/odoo/models.py", line 2991, in read
self.check_access_rights('read')
File "/usr/lib/python2.7/dist-packages/odoo/models.py", line 3285, in check_access_rights
return self.env['ir.model.access'].check(self._name, operation, raise_exception)
File "", line 2, in check
File "/usr/lib/python2.7/dist-packages/odoo/tools/cache.py", line 82, in lookup
r = d[key]
File "/usr/lib/python2.7/dist-packages/odoo/tools/func.py", line 68, in wrapper
return func(self, *args, *kwargs)
File "/usr/lib/python2.7/dist-packages/odoo/tools/lru.py", line 44, in getitem
self[a[0]] = a[1]
File "/usr/lib/python2.7/dist-packages/odoo/tools/func.py", line 68, in wrapper
return func(self, args, kwargs)
File "/usr/lib/python2.7/dist-packages/odoo/tools/lru.py", line 50, in setitem
del self[obj]
File "/usr/lib/python2.7/dist-packages/odoo/tools/func.py", line 70, in wrapper
lock.release()
File "/usr/lib/python2.7/threading.py", line 213, in release
self._note("%s.release(): non-final release", self)
RuntimeError: maximum recursion depth exceeded
2017-10-02 08:50:09,863 30173 INFO database.local werkzeug: 127.0.0.1 - - [02/Oct/2017 08:50:09] "POST /web/dataset/call_button HTTP/1.0" 200 -
2017-10-02 08:50:09,916 30173 DEBUG database.local odoo.api: call account.payment().search_read([[u'id', u'in', [5]]], [u'communication', u'currency_id', u'partner_id', u'id', u'payment_method_id', u'journal_id', u'state', u'payment_date', u'has_invoices', u'partner_type', u'move_line_ids', u'payment_transaction_id', u'name', u'hide_payment_method', u'payment_method_code', u'destination_journal_id', u'amount', u'payment_type', u'display_name', u'__last_update'])
2017-10-02 08:50:09,972 30173 INFO database.local werkzeug: 127.0.0.1 - - [02/Oct/2017 08:50:09] "POST /web/dataset/call_kw/account.payment/search_read HTTP/1.0" 200 -
2017-10-02 08:50:10,387 30173 INFO database.local werkzeug: 127.0.0.1 - - [02/Oct/2017 08:50:10] "POST /web/dataset/search_read HTTP/1.0" 200 -
---
Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/49955769-error-while-confirming-a-payment?utm_campaign=plugin&utm_content=tracker%2F3643037&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F3643037&utm_medium=issues&utm_source=github).
While using latest Odoo 10 and odoo-saas-tools I am not able to confirm incoming payments. The error in form of an infinite loop seems only to occur while using "saas_portal_sale"/"saas_portal_sale_online" AND the "purchase" module. Both alone work without any error.
As solution for the first occuring loop it helps to fix the typo in /saas_portal_sale/models/account_invoice.py line 40 where "compositon_mode" should be "composition_mode".
But this does not fix the whole error, it still remains in the second infinite loop.
Here is my excerpt of the log-file:
2017-10-02 08:50:01,804 30173 DEBUG database.local odoo.api: call account.payment(5,).post() // START LOOP 69 TIMES 2017-10-02 08:50:02,179 30173 WARNING database.local odoo.models: mail.compose.message.create() includes unknown fields: compositon_mode // END LOOP 2017-10-02 08:50:09,718 30173 INFO database.local odoo.addons.mail.models.mail_template: Failed to load template u"\n Your payment for service is accepted!\n\n
Now you can choose domain name for your service and create database
\nopen following link
\n\n % for plan in ctx['plans']:\n
\n " Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/odoo/addons/mail/models/mail_template.py", line 374, in render_template template = mako_env.from_string(tools.ustr(template_txt)) File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 880, in from_string return cls.from_code(self, self.compile(source), globals, None) File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 579, in compile source = self._parse(source, name, filename) File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 497, in _parse return Parser(self, source, name, encode_filename(filename)).parse() File "/usr/local/lib/python2.7/dist-packages/jinja2/parser.py", line 896, in parse result = nodes.Template(self.subparse(), lineno=1) File "/usr/local/lib/python2.7/dist-packages/jinja2/parser.py", line 878, in subparse rv = self.parse_statement() File "/usr/local/lib/python2.7/dist-packages/jinja2/parser.py", line 130, in parsestatement return getattr(self, 'parse' + self.stream.current.value)() File "/usr/local/lib/python2.7/dist-packages/jinja2/parser.py", line 193, in parse_for extra_end_rules=('name:recursive',)) File "/usr/local/lib/python2.7/dist-packages/jinja2/parser.py", line 615, in parse_tuple args.append(parse()) File "/usr/local/lib/python2.7/dist-packages/jinja2/parser.py", line 607, in\n http://${ctx['saas_domain']}/page/start?plan_id=${plan}\n % endfor\n