201
201
if context.get('from_accrual_line', False):
202
202
field.set('domain', "[('id', '=', %s)]" % fp_id)
203
203
# If context with 'from' exist AND its content is an integer (so an invoice_id)
204
elif (context.get('from_invoice', False) and isinstance(context.get('from_invoice'), int)) or (context.get('from_commitment', False) and isinstance(context.get('from_commitment'), int)):
204
elif (context.get('from_invoice', False) and isinstance(context.get('from_invoice'), int)) or (context.get('from_commitment', False) and isinstance(context.get('from_commitment'), int)) \
205
206
# Filter is only on cost_center and MSF Private Fund on invoice header
206
207
field.set('domain', "[('type', '!=', 'view'), ('state', '=', 'open'), ('category', '=', 'FUNDING'), '|', ('cost_center_ids', '=', cost_center_id), ('id', '=', %s)]" % fp_id)