Skip to Content
Menu
This question has been flagged
2 Replies
2479 Views

Hey so in our contract module we have a 'Contract Type' many2one field which references the account.analytic.group. Within that model there is a many2many field for selecing accepted SLA types (Service Level Agreement).

Now the issue im having is lets say the 'Contract Type' is set to 'Hardware Sales'

I need the SLA column on my contract lines to only show the values that are in the many2many field in the group.

I have used context and passed the Contract type through to the contract lines model so when they add a new line it knows what account.analytic.group it is. But now i cant actually put a domain on my SLA field to only show the ones in the group.

Ive tried everything i can think of, any help will be appreciated. Thanks (:

Edit: Ive tried doing a domain of [('id','in',x_group_id.x_assigned_sla)]
But this hasnt worked.

My Structure:

account.analytic.group (model)

    x_accepted_sla (many2many) rel: x_sla_type


account.analytic.account (model)

   group_id (many2one) rel: account.analytic.group


account.analytic.invoice.line (model)

  x_group_id (many2one) context(Pulled from parent group_id)

  x_sla (many2one) rel: x_sla_type    <!-- This is what needs to be filtered based on the selection in the account.analytic.group -->

Avatar
Discard
Best Answer

Is this related to your previous question?

Please check if web_domain_field can help you in this as well.

Avatar
Discard
Author

This module is not related to my issue, i got around the problem by passing the default parameters in the context of the account.analytic.invoice.line to bring it through.

Its just actually filtering what data is seen on the many2one based on the data thats in the many2many inside the many2one of the group id thats passed through.

Related Posts Replies Views Activity
2
Dec 23
12010
0
Oct 23
33
3
Oct 23
787
1
Oct 23
569
1
Aug 23
982