2013/7/22 Cédric Krier <[email protected]>

> 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.
>

Thank you. I'll try with function fields.

--
> 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/
>



-- 

Jesús Martín

Zikzakmedia SL
Dr. Fleming, 28, baixos
08720 Vilafranca del Penedès
☏ 93 890 21 08

Reply via email to