0

OpenERP サブスクリプションのドキュメント選択フィールドを変更したいと考えています。

'doc_source': fields.reference('Source Document', required=True,
selection=_get_document_types, size=128, 
help="User can choose the source document on which he wants to create documents"),

最初にモデルを選択し、次に 2 番目のフィールドでドキュメントを選択できます。私が望むのは、ドキュメントをドラフト ドキュメント (たとえば、請求書) のみにフィルター処理することです。この 2 番目のフィールドにドメインを設定することは可能ですか?

前もって感謝します!

4

1 に答える 1

0

There is no direct way to do it but you need to do it manually. You need to override name_search / search method of the model , that you are selecting from the reference field, by adding your condition like ('state','=','draft') and it will work for you.

于 2013-04-30T11:07:17.783 に答える