Hii,
This is a follow up mail regarding the previous issue
<https://groups.google.com/forum/#!topic/tryton/I2oaGFn2KGM> i had
regarding the invoice line and the account to be passed to it. The error
was at
line=invoice.lines.new()
line.account=account #<- showed an error but the account was saved
properly
It was marked as a bug issue4719 <https://bugs.tryton.org/issue4719>.
Since the account was passed properly but showed an error i used a
workaround,
try:
line.account=account #<<----line of error
except Exception, e:
pass
print line.account #prints the correct account passed in that try block
This made sure that the account was passed properly and the error was also
handled.
later when i tried to save the invoice, it showed me this error
UserError: ('UserError', (u'The value of the field "Account" on "Invoice"
is not valid according to its domain.', ''))
The values of account and invoice from _get_eval() has be displayed in the
previous issue also. While the bug is still being worked upon, may I know
is this "domain" error also due to the bug or is it because of something
else.
account._get_eval()
*Output*
In [9]: account._get_eval()
Out[9]:
{'active': True,
'balance': Decimal('0.00'),
'childs': [],
'code': None,
'company': 34,
'create_date': datetime.datetime(2015, 4, 27, 8, 56, 30, 201566),
'create_uid': 1,
'credit': Decimal('0.00'),
'currency': 142,
'currency_digits': 2,
'debit': Decimal('0.00'),
'deferral': True,
'deferrals': [],
'general_ledger_balance': False,
'id': 90,
'kind': u'revenue',
'left': 159,
'name': u'Main Income',
'note': None,
'parent': None,
'party_required': False,
'rec_name': u'Main Income',
'reconcile': False,
'right': 160,
'second_currency': None,
'taxes': [],
'template': None,
'type': 95,
'write_date': None,
'write_uid': None}
The value of invoice with invoice._get_eval()
*Output*
In [10]: invoice._get_eval()
Out[10]:
{'account': 90,
'accounting_date': None,
'amount_to_pay': None,
'amount_to_pay_today': None,
'cancel_move': None,
'comment': None,
'company': 34,
'create_date': datetime.datetime(2015, 4, 27, 8, 56, 27, 769534),
'create_uid': 1,
'currency': 142,
'currency_date': None,
'currency_digits': 2,
'description': None,
'id': -12,
'invoice_address': 1,
'invoice_date': None,
'invoice_report_cache': None,
'invoice_report_format': None,
'journal': 1,
'lines': [-13, -17],
'lines_to_pay': [],
'move': None,
'number': None,
'origins': None,
'party': 1,
'party_lang': u'en_US',
'payment_lines': [],
'payment_term': 27,
'rec_name': None,
'reconciled': False,
'reference': None,
'state': 'draft',
'tax_amount': Decimal('36.80'),
'taxes': [-14],
'total_amount': Decimal('356.80'),
'type': 'out_invoice',
'type_name': None,
'untaxed_amount': Decimal('320.00'),
'write_date': None,
'write_uid': None}
Can you please help me to figure out this issue,am I missing any important
step?
Reagads,
Jitesh