Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
3232 Widoki

Hello,
I am trying to create an invoice from the external API. Only I am not able to retrieve the correct list of fields that I must fill in to achieve it.
After several tests, I had very exotic results but the only way to succeed was to resume the list of fields sent between the Odoo client and the server.
In order to make my code lighter and more compatible, is there sorting logic on the fields that fields_get returns to achieve this?
'Required' is not good and leaving everything is not good either.

Thank you in advance and have a very good day


EDIT : I work on a V13


invoice_field = self.models.execute_kw( self.db, self.uid, self.password,  'account.move',  'fields_get',
       [],
       {
               'attributes': [],
               'context': {'allowed_company_ids':[self.company_id] , 'default_type': "in_invoice", 'default_is_company': True, 'uid': self.uid, 'default_currency_id': False, 'default_partner_id': partner_id, "tz": "Europe/Zurich", "lang": "fr_CH"}}
)


for name, field in invoice_field.items():
       if field['required']:

               invoice[name] = False 


Awatar
Odrzuć
Autor Najlepsza odpowiedź

No idea ?

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
0
sty 20
3902
2
lip 19
4055
0
maj 19
4123
1
cze 17
3556
1
lut 25
1515