[9.0] invoice_datetime: ValueError: "'tuple' object has no attribute 'strftime'" while evaluating u'action_date_assign()'
osvalr opened this issue · 3 comments
osvalr commented
Summary
When processing a POS order from point of sale and using the module datetime_invoice
, the invoicing step it fails. This needs to be debugged
Down below you will see the traceback thrown:
Traceback (most recent call last):
File "/.repo_requirements/odoo/openerp/http.py", line 648, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/.repo_requirements/odoo/openerp/http.py", line 685, in dispatch
result = self._call_function(**self.params)
File "/.repo_requirements/odoo/openerp/http.py", line 321, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/.repo_requirements/odoo/openerp/service/model.py", line 118, in wrapper
return f(dbname, *args, **kwargs)
File "/.repo_requirements/odoo/openerp/http.py", line 314, in checked_call
result = self.endpoint(*a, **kw)
File "/.repo_requirements/odoo/openerp/http.py", line 964, in __call__
return self.method(*args, **kw)
File "/.repo_requirements/odoo/openerp/http.py", line 514, in response_wrap
response = f(*args, **kw)
File "/root/enterprise/web/controllers/main.py", line 912, in call_kw
return self._call_kw(model, method, args, kwargs)
File "/root/enterprise/web/controllers/main.py", line 904, in _call_kw
return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)
File "/.repo_requirements/odoo/openerp/api.py", line 250, in wrapper
return old_api(self, *args, **kwargs)
File "/root/odoo-9.0/addons/point_of_sale/point_of_sale.py", line 813, in create_from_ui
self.pool['account.invoice'].signal_workflow(cr, SUPERUSER_ID, [order_obj.invoice_id.id], 'invoice_open')
File "/.repo_requirements/odoo/openerp/api.py", line 250, in wrapper
return old_api(self, *args, **kwargs)
File "/.repo_requirements/odoo/openerp/models.py", line 3623, in signal_workflow
result[res_id] = workflow.trg_validate(uid, self._name, res_id, signal, cr)
File "/.repo_requirements/odoo/openerp/workflow/__init__.py", line 67, in trg_validate
return WorkflowService.new(cr, uid, res_type, res_id).validate(signal)
File "/.repo_requirements/odoo/openerp/workflow/service.py", line 73, in validate
res2 = wi.validate(signal)
File "/.repo_requirements/odoo/openerp/workflow/instance.py", line 62, in validate
wi.process(signal=signal, force_running=force_running, stack=stack)
File "/.repo_requirements/odoo/openerp/workflow/workitem.py", line 102, in process
ok = self._split_test(activity['split_mode'], signal, stack)
File "/.repo_requirements/odoo/openerp/workflow/workitem.py", line 230, in _split_test
self._join_test(t[0], t[1], stack)
File "/.repo_requirements/odoo/openerp/workflow/workitem.py", line 239, in _join_test
WorkflowItem.create(self.session, self.record, activity, inst_id, stack=stack)
File "/.repo_requirements/odoo/openerp/workflow/workitem.py", line 77, in create
workflow_item.process(stack=stack)
File "/.repo_requirements/odoo/openerp/workflow/workitem.py", line 98, in process
if not self._execute(activity, stack):
File "/.repo_requirements/odoo/openerp/workflow/workitem.py", line 144, in _execute
returned_action = self.wkf_expr_execute(activity)
File "/.repo_requirements/odoo/openerp/workflow/workitem.py", line 295, in wkf_expr_execute
return self.wkf_expr_eval_expr(activity['action'])
File "/.repo_requirements/odoo/openerp/workflow/workitem.py", line 273, in wkf_expr_eval_expr
result = eval(line, env, nocopy=True)
File "/.repo_requirements/odoo/openerp/tools/safe_eval.py", line 298, in safe_eval
return eval(c, globals_dict, locals_dict)
File "", line 1, in <module>
File "/.repo_requirements/odoo/openerp/api.py", line 248, in wrapper
return new_api(self, *args, **kwargs)
File "/root/odoo-9.0/addons/account/models/account_invoice.py", line 614, in action_date_assign
inv._onchange_payment_term_date_invoice()
File "/root/odoo-9.0/addons/account/models/account_invoice.py", line 516, in _onchange_payment_term_date_invoice
self.date_due = max(line[0] for line in pterm_list)
File "/.repo_requirements/odoo/openerp/fields.py", line 846, in __set__
value = self.convert_to_cache(value, record)
File "/.repo_requirements/odoo/openerp/fields.py", line 1361, in convert_to_cache
return self.to_string(value)
File "/.repo_requirements/odoo/openerp/fields.py", line 1351, in to_string
return value.strftime(DATE_FORMAT) if value else False
ValueError: "'tuple' object has no attribute 'strftime'" while evaluating
u'action_date_assign()'
nhomar commented
Este módulo está depreciado para la v9.0
Me comentas en que lo requieres?
osvalr commented
Estuve probándolo porque necesito tener la fecha y hora de facturación para que sean impresos en la factura de venta, estuve buscando una opción en Odoo 9.0 y no encontré, pero si encontré el módulo invoice_datetime
.