2016-06-29 5 views
0

上の選択を選択し、あなたがOdooの変更は、私が選択フィールドを持つモデルを持っているのpythonファイル

task_type = fields.Selection([ 
      ('product', 'Product'), 
      ('document', 'Document'), 
      ('issue', 'Issue'), 
      ('child','Child'), 
      ('other','Other')], 
      'Task Type', copy=False, 
       help="Let user choose the type of each task:\n" 
         "- Product :\n" 
         " Development of new system, apps, report, ...\n" 
         "- Document : \n" 
         " The deliverable is a document, presentation, invoice, sales, slides, ...\n" 
         "- Issue : \n" 
         " There is an issue or task to solve related to other task\n" 
         "- Child : \n" 
         " Used for children task\n" 
         "- Other \n" ) 

の下に表示することができますように私の問題は、私はの.pyファイル内のプログラムで、この選択の選択された値を変更することができる方法です?。

私はこれを試したが、うまくいかなかった。

task_type = "child" 

答えて

0

あなたのようなそのレコードの利用writeメソッドを更新したい場合は、ここで

Partner.write([partner.id], {'name': "MyCompany"}) 

パートナーはres.partnerモデルのオブジェクトです。

関連する問題