2016-06-29 10 views
0

Ich habe ein Modell, das ein Auswahlfeld hat wie Sie untenOdoo ändern Auswahl auf Python-Datei ausgewählt

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" ) 

Mein Problem zeigen kann, ist, wie kann ich Wert dieser Auswahl programmatisch innerhalb .py Datei ausgewählt ändern ?.

Ich habe so versucht, aber es hat nicht funktioniert.

task_type = "child" 

Antwort

0

Wenn Sie möchten, wie, diesen Rekord Verwendung Schreibverfahren aktualisieren

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

Hier Partner ist ein Ziel der res.partner Modell.

Verwandte Themen