On 22/07/13 07:06 -0700, Jesús Martín Jiménez wrote:
> Hi all,
>
> I have two fields One2Many pointing to the same model. Each one must have
> its own domain, so I tried to set them each domain in its field definition,
> but it doesn't work. When I saved the record, raises an error saying that
> the domain is not correct.
>
> Here is the code:
>
> current_line_accounts = fields.One2Many(
> 'account.financial.statement.report.line.account', 'report_line',
> 'Line Accounts', domain=[('fiscal_year', '=', 'current')])
> previous_line_accounts = fields.One2Many(
> 'account.financial.statement.report.line.account', 'report_line',
> 'Line Accounts', domain=[('fiscal_year', '=', 'previous')])
>
> Can I define it in another way I can't see right now (i.e. in the view)?domain on One2Many are constraint not selection. You must use a function field if you want to show different lists or use a different target field. -- Cédric Krier B2CK SPRL Rue de Rotterdam, 4 4000 Liège Belgium Tel: +32 472 54 46 59 Email/Jabber: [email protected] Website: http://www.b2ck.com/
pgpxwUZl1Pp09.pgp
Description: PGP signature
