Community mailing list archives

community@mail.odoo.com

Re: New API in YAML tests

by
Camptocamp SA, Nicolas Bessi
- 09/25/2014 06:14:52
Please 


I did not have the occasion to test it but it's the presented way to do it on the Odoo Days

Regards

Nicolas

2014-09-25 10:49 GMT+02:00 Alexandre Fayolle <alexandre.fayolle@camptocamp.com>:
See https://github.com/odoo/odoo/issues/2695

On 24/09/2014 23:24, Torvald Baade Bringsvor wrote:
<blockquote cite="mid:CAGWx-g81bSH3P1XhdYpUbp7jmr_NLMiXreR4meeHCaJb+x-Fhw@mail.gmail.com" type="cite">
Sorry to answer my own question, but to me it seems this is the way:

self = self.browse(cr, uid, [self.create(cr, uid, {})])


-Torvald


2014-09-24 21:58 GMT+02:00 Torvald Baade Bringsvor <torvald@bringsvor.com>:
Hi

Have any of you had success using the new API in YAML tests?

I tried to do something like this:

!python {model: mymodel}: |
     self # this is what the documentation said you should do to get new api
     self.store_data(context)

The store_data accesses self.env, which fails since you don't have the attribute.

So, have any of you done this?

-Torvald


--
Torvald Baade Bringsvor
Bringsvor Consulting AS - Odoo (formerly OpenERP) implementation partner



--
Torvald Baade Bringsvor
Bringsvor Consulting AS - Odoo (formerly OpenERP) implementation partner

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe



-- 
Alexandre Fayolle
Chef de Projet
Tel : + 33 (0)4 79 26 57 94

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac Cedex
http://www.camptocamp.com

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe




--
Nicolas Bessi
Senior ERP consultant
Business Solution technical manager

Camptocamp SA
PSE A
CH-1015 Lausanne