Odoo Hilfe

0

0
3 Answers
1
Avatar

Ivan

--Ivan--

3410
| 6 3 9
Jakarta, Indonesien
--Ivan--
Ivan
27.01.15, 04:08

@Dzingai what you need is to change the value field into a function field.  In new API (v8) you need to put the compute attribute in the field definition.  In both you need to develop a method in the said model to be used by the function.

You can find sample in the account.invoice modules which have quite a lot of function fields.

0
Dzingai Chakazamba
01.05.19, 10:40

Thanks Salama. That is very helpful.

0
Salama Sidna
01.05.19, 05:55

Try this  function just replace the attribut by the yours

this function should be in the class concerned


@api.depends('required_hours','completed_hours')

def presence_avarage_count(self):

for r in self:

r.presence_avarage = completed_hours / required_hours

Fragen Sie
Keep Informed
1 Verfolger
About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register
Odoo Training Center

Access to our eLearning platform and experience all Odoo Apps through learning videos, use cases and quizzes.

Test it now