Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
2 Antwoorden
7413 Weergaven

Hello everybody!!

My friends i am using  the hr.payslip model and i want to call the function compute_sheet().

Here is what i have tried:


@api.onchange('field1')

 def onchange_solde(self):

  for payslip in self :

   if self.field1 == True : 

           self.compute_sheet()

 

But the problem here is my self contains this: <odoo.models.NewId object at 0x7f7769d212d0>

How can i solve this please.

Thanks a lot in advance.

Best reagrds.

Avatar
Annuleer
Auteur

no one can anwser plz

Beste antwoord

Self being a odoo.models.NewId object simply means, that it is an odoo model that has not yet been committed to the database (at least I think so). That should not prevent you from calling member functions on it though.

What are you exactly trying to accomplish? And does your method not work (I guess so)? If not, can you post the error message?

Avatar
Annuleer
Auteur

i have inherited the hr.payslip model and i want to call the compute_sheet() function.

Have you tried something simple like this:

@api.multi

@api.onchange('field1')

def onchange_solde(self):

self.compute_sheet()

What is wrong with your function? Do you get an error? If yes what?

Gerelateerde posts Antwoorden Weergaven Activiteit
7
mei 20
3752
1
jun. 18
5431
2
jul. 25
4552
2
dec. 24
7710
2
nov. 24
28454