On Tuesday, May 5, 2015 at 1:15:04 PM UTC+5:30, Cédric Krier wrote:
>
>
> So the error must come from company record rule, so I guess you are
> mixing different companies.
>
>
Here i have uploaded the error as I have been trying to get this thing
working but it fails
---------------------------------------------------------------------------
UserError Traceback (most recent call last)
/usr/lib/python2.7/dist-packages/IPython/utils/py3compat.pyc in execfile(
fname, *where)
176 else:
177 filename = fname
--> 178 __builtin__.execfile(filename, *where)
/home/projects/new/new/invoice_testing.py in <module>()
147
148 invoice.account = account
--> 149 invoice.save()
150
151 print invoice.amount_to_pay
/usr/local/lib/python2.7/dist-packages/proteus/__init__.pyc in newfunc(*args
, **kwargs)
100 def newfunc(*args, **kwargs):
101 if instance:
--> 102 return self.func(owner, [instance], *args, **kwargs)
103 else:
104 return self.func(owner, *args, **kwargs)
/usr/local/lib/python2.7/dist-packages/proteus/__init__.pyc in save(cls,
records)
747 if create:
748 values = [r._get_values() for r in create]
--> 749 ids = proxy.create(values, context)
750 for record, id_ in zip(create, ids):
751 record.id = id_
/usr/local/lib/python2.7/dist-packages/proteus/config.pyc in __call__(self,
*args)
171 meth = getattr(self._object, self._name)
172 if not hasattr(meth, 'im_self') or meth.im_self:
--> 173 result = rpc.result(meth(*args, **kwargs))
174 else:
175 assert rpc.instantiate == 0
/home/projects/new/new/FSERP/trytond/trytond/model/modelsql.pyc in create(
cls, vlist)
506 records = cls.browse(new_ids)
507 for sub_records in grouped_slice(records, cache_size()):
--> 508 cls._validate(sub_records)
509
510 field_names = cls._fields.keys()
/home/projects/new/new/FSERP/trytond/trytond/model/modelstorage.pyc in
_validate(cls, records, field_names)
967 continue
968
--> 969 validate_domain(field)
970
971 def required_test(value, field_name):
/home/projects/new/new/FSERP/trytond/trytond/model/modelstorage.pyc in
validate_domain(field)
926
927 for domain, sub_records in domains.iteritems():
--> 928 validate_relation_domain(field, sub_records,
Relation, domain)
929
930 def validate_relation_domain(field, records, Relation,
domain):
/home/projects/new/new/FSERP/trytond/trytond/model/modelstorage.pyc in
validate_relation_domain(field, records, Relation, domain)
949 if sub_relations != set(finds):
950 cls.raise_user_error(
'domain_validation_record',
--> 951 error_args=cls._get_error_args(field.
name))
952
953 field_names = set(field_names or [])
/home/projects/new/new/FSERP/trytond/trytond/error.pyc in raise_user_error(
cls, error, error_args, error_description, error_description_args,
raise_exception)
72 return (error, error_description)
73 if raise_exception:
---> 74 raise UserError(error)
75 else:
76 return error
UserError: ('UserError', (u'The value of the field "Account" on "Invoice"
is not valid according to its domain.', ''))
I did check the account.invoice and found that there is no domain in
account field, but then the interpreter reports this error. The company is
created according to this context
<http://hg.tryton.org/modules/company/file/df2f37da15a3/tests/tools.py#l16>.
Is there anything else i need to check out in this case?
Regards,
jitesh