Odoo Hilfe

0

0
3 Answers
1
Avatar

Axel Mendoza

--Axel Mendoza--
13613
| 8 8 10
Camaguey, Kuba
--Axel Mendoza--

DevOps - Full stack - Software Architect - Developer - Technology Integrator

I could help you to develop anything and solve complex problems based on technologies, integrations and tricky stuffs mostly in Python with OpenERP/Odoo, Zato, Django and many others frameworks programming languages and technologies.

I offers consulting services to anyone with an unanswered questions or needs for customizations. Think about it, maybe it's better to have an expert to solve your issues and projects than having a full-time employee trying to understand what to do and how

Reach me at aekroft@gmail.com

Axel Mendoza
13.03.17, 15:34

Just solve it like this:

self.env['model.name'].browse(id).write({'field': 'value'})
3 Comments
FEDERICO LEONI
13.03.17, 15:54

It works!

But since I'm a curious person would you mind to share some other infos and explain why with

wt = self.env['model.name']

wt2 = wt.browse(id)

wt2.write({'field': 'value'})

it will not works?

Axel Mendoza
13.03.17, 16:04

It should work too, I just compress it, but your code wasn't the same as in the comments above

the idea is to call write over a recordset returned by the browse

FEDERICO LEONI
13.03.17, 16:13

Interesting I think it rose an error because I've tried to use a field from the original recordset (self.field) but using as a var (var = self.field) before change the recordset with self.env works.

Thanks Axel!

0
mahmoud
13.03.17, 10:37

Try this code:

wt = self.env['model.name']wt.write({'field': 'value'})

1 Kommentar
FEDERICO LEONI
13.03.17, 10:57

Assuming you're referring to

wt = self.env['model.name']

wt.write({'field': 'value'})

not in a single line, I've already tried, doesn't rise any error (nor infos on log) but doesn't update the recordset since no id was specified.

Fragen Sie
Writer
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