content = fields.Text('Content')@api.multi
def write(self, values):
library_write = super(Library, self).write(values)
text = self.read_from_doc()
values['content'] = text
print 'Passed this function. passed_override_write_function value: ' + str(
library_write)
return library_write
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Boekhouding
- Voorraad
- PoS
- Project
- MRP
Deze vraag is gerapporteerd
Hi,
Rewrite the function like this,
@api.multi
def write(self, values):
text = self.read_from_doc()
values['content'] = text
library_write = super(Library, self).write(values)
return library_write
Thanks
But when I update the content field before, the previous value is updated,not the current value. I need to update it with the current value. When i save all other fields get current values, but content field alone gets the previous value. What may be the issue?
After Calling super() you are trying to update values with 'content' it's wrong.
Before Calling the super() you have to update values with 'content' field
@api.multi
def write(self, values):
values['content'] = self.read_from_doc()
return super(Library, self).write(values)
Geniet je van het gesprek? Blijf niet alleen lezen, doe ook mee!
Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!
AanmeldenGerelateerde posts | Antwoorden | Weergaven | Activiteit | |
---|---|---|---|---|
|
2
jul. 25
|
4789 | ||
|
2
dec. 24
|
7893 | ||
How to ORDER BY? [Odoo 10]
Opgelost
|
|
2
nov. 24
|
28693 | |
|
2
mei 24
|
7592 | ||
|
3
mrt. 24
|
7039 |
In this article you will learn how to override Odoo methods. I will show you how to override Odoo Create, Write and Unlink method.
Reference Link: https://goo.gl/4BkizH