Issue 10983

Title
error in account_rule when processing the sale
Priority
bug
Status
chatting
Nosy list
booraa0a, ced
Assigned to
Keywords

Created on 2021-11-26.03:07:34 by booraa0a, last changed yesterday by booraa0a.

Messages

Author: [hidden] (booraa0a)
Date: 2021-12-06.20:52:53

The error will only show when you activate all modules but if you activate only account_rule, the error will not show.

Author: [hidden] (booraa0a)
Date: 2021-12-06.20:50:00

Thank you C├ędric

I am using only standard modules. I tried to debug the issue but could not. However, I replicated the same issue in the demo server 6.2 version. Please check sales id 123, the error will show up when you click process.

Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2021-12-01.00:14:13

You seem to have a date key in the context that is not a date but just a string.
Have you any custom module activated?

Author: [hidden] (booraa0a)
Date: 2021-11-26.03:07:34

I am using the Tryton 6.2. I receive the following traceback when clicking on process (Sale).

Thank you.


Traceback (most recent call last):
  File "/usr/local/lib/python39/dist-packages/trytond/wsgipy", line 117, in dispatch_request
    return endpoint(request, **requestview_args)
  File "/usr/local/lib/python39/dist-packages/trytond/protocols/dispatcherpy", line 47, in rpc
    return methodsget(requestrpc_method, _dispatch)(
  File "/usr/local/lib/python39/dist-packages/trytond/wsgipy", line 84, in auth_required
    return wrapped(*args, **kwargs)
  File "/usr/local/lib/python39/dist-packages/trytond/protocols/wrapperspy", line 159, in wrapper
    return func(request, pool, *args, **kwargs)
  File "/usr/local/lib/python39/dist-packages/trytond/protocols/dispatcherpy", line 181, in _dispatch
    result = rpcresult(meth(*c_args, **c_kwargs))
  File "/usr/local/lib/python39/dist-packages/trytond/model/modelviewpy", line 774, in wrapper
    return func(cls, records, *args, **kwargs)
  File "/usr/local/lib/python39/dist-packages/trytond/modules/sale_shipment_cost/salepy", line 216, in process
    super()process(sales)
  File "/usr/local/lib/python39/dist-packages/trytond/model/modelviewpy", line 774, in wrapper
    return func(cls, records, *args, **kwargs)
  File "/usr/local/lib/python39/dist-packages/trytond/modules/sale/salepy", line 958, in process
    cls_process_invoice(sales)
  File "/usr/local/lib/python39/dist-packages/trytond/modules/sale/salepy", line 970, in _process_invoice
    invoice = salecreate_invoice()
  File "/usr/local/lib/python39/dist-packages/trytond/modules/sale_advance_payment/salepy", line 405, in create_invoice
    invoice = super(Sale, self)create_invoice()
  File "/usr/local/lib/python39/dist-packages/trytond/modules/commission/salepy", line 25, in create_invoice
    invoice = super(Sale, self)create_invoice()
  File "/usr/local/lib/python39/dist-packages/trytond/modules/sale/salepy", line 794, in create_invoice
    invoice_linesappend(lineget_invoice_line())
  File "/usr/local/lib/python39/dist-packages/trytond/modules/account_rule/salepy", line 14, in get_invoice_line
    return super()get_invoice_line()
  File "/usr/local/lib/python39/dist-packages/trytond/modules/sale_secondary_unit/salepy", line 160, in get_invoice_line
    lines = super()get_invoice_line()
  File "/usr/local/lib/python39/dist-packages/trytond/modules/sale_shipment_cost/salepy", line 332, in get_invoice_line
    lines = super()get_invoice_line()
  File "/usr/local/lib/python39/dist-packages/trytond/modules/sale_advance_payment/salepy", line 474, in get_invoice_line
    lines = super(SaleLine, self)get_invoice_line()
  File "/usr/local/lib/python39/dist-packages/trytond/modules/analytic_sale/salepy", line 31, in get_invoice_line
    invoice_lines = super()get_invoice_line()
  File "/usr/local/lib/python39/dist-packages/trytond/modules/commission/salepy", line 87, in get_invoice_line
    lines = super()get_invoice_line()
  File "/usr/local/lib/python39/dist-packages/trytond/modules/sale/salepy", line 1521, in get_invoice_line
    invoice_lineaccount = selfproductaccount_revenue_used
  File "/usr/local/lib/python39/dist-packages/trytond/modules/account_product/productpy", line 51, in prop
    return getattr(selftemplate, field_name)
  File "/usr/local/lib/python39/dist-packages/trytond/modules/account_rule/productpy", line 18, in account_revenue_used
    return super()account_revenue_used
  File "/usr/local/lib/python39/dist-packages/trytond/modules/account_product/productpy", line 26, in wrapper
    account = selfget_account(field_name + '_used')
  File "/usr/local/lib/python39/dist-packages/trytond/modules/account_product/productpy", line 348, in get_account
    return selfaccount_categoryget_account(name, **pattern)
  File "/usr/local/lib/python39/dist-packages/trytond/modules/account_rule/productpy", line 47, in get_account
    account = super()get_account(name, **pattern)
  File "/usr/local/lib/python39/dist-packages/trytond/modules/account_product/productpy", line 192, in get_account
    return selfparentget_account(name, **pattern)
  File "/usr/local/lib/python39/dist-packages/trytond/modules/account_rule/productpy", line 47, in get_account
    account = super()get_account(name, **pattern)
  File "/usr/local/lib/python39/dist-packages/trytond/modules/account_product/productpy", line 192, in get_account
    return selfparentget_account(name, **pattern)
  File "/usr/local/lib/python39/dist-packages/trytond/modules/account_rule/productpy", line 50, in get_account
    account = AccountRuleapply(account)
  File "/usr/local/lib/python39/dist-packages/trytond/modules/account_rule/accountpy", line 109, in apply
    rules = clssearch([
  File "/usr/local/lib/python39/dist-packages/trytond/model/modelsqlpy", line 1442, in search
    tables, expression = cls__search_query(domain, count, query, order)
  File "/usr/local/lib/python39/dist-packages/trytond/model/modelsqlpy", line 1361, in __search_query
    tables, expression = clssearch_domain(domain)
  File "/usr/local/lib/python39/dist-packages/trytond/model/modelsqlpy", line 1571, in search_domain
    expression = convert(domain)
  File "/usr/local/lib/python39/dist-packages/trytond/model/modelsqlpy", line 1567, in convert
    return And((convert(d) for d in (
  File "/usr/local/lib/python39/dist-packages/trytond/model/modelsqlpy", line 1567, in <genexpr>
    return And((convert(d) for d in (
  File "/usr/local/lib/python39/dist-packages/trytond/model/modelsqlpy", line 1565, in convert
    return Or((convert(d) for d in domain[1:]))
  File "/usr/local/lib/python39/dist-packages/trytond/model/modelsqlpy", line 1565, in <genexpr>
    return Or((convert(d) for d in domain[1:]))
  File "/usr/local/lib/python39/dist-packages/trytond/model/modelsqlpy", line 1558, in convert
    expression = fieldconvert_domain(domain, tables, cls)
  File "/usr/local/lib/python39/dist-packages/trytond/model/fields/fieldpy", line 408, in convert_domain
    expression = Operator(column, self_domain_value(operator, value))
  File "/usr/local/lib/python39/dist-packages/trytond/model/fields/fieldpy", line 385, in _domain_value
    return selfsql_format(value)
  File "/usr/local/lib/python39/dist-packages/trytond/model/fields/datepy", line 37, in sql_format
    year, month, day = list(map(int, valuesplit("-", 2)))
ValueError: invalid literal for int() with base 10: ''

Fault: invalid literal for int() with base 10: ''
History
Date User Action Args
2021-12-06 20:52:53booraa0asetmessages: + msg72009
2021-12-06 20:50:00booraa0asetmessages: + msg72008
2021-12-01 00:14:13cedsetmessages: + msg71954
nosy: + ced
status: unread -> chatting
2021-11-26 03:07:34booraa0acreate

Showing 10 items. Show all history (warning: this could be VERY long)