Re: [tryton] Updating module from 2.4 to 2.6

28 views
Skip to first unread message

Raimon Esteve

unread,
May 10, 2013, 4:49:57 AM5/10/13
to try...@googlegroups.com
> and this is my experiment of the 2.6 version: http://pastebin.com/JmJxHYgn
> error message at the moment: local variable 'Sale' referenced before

line 15:

invoice_id = super(Sale, self).create_invoice(sale, invoice_type)

you define sale parameter and not add some value before.
http://hg.tryton.org/modules/sale/file/d3c06443a7b6/sale.py#l671

Example inherit:
http://hg.tryton.org/modules/sale_shipment_cost/file/1374b0326e10/sale.py#l190

API from 2.4 to 2.6 change some parts. Check documentation

Note:
More better send this questions at tryton-dev mailing list.

--
Si us plau, NO adjunti arxius a les seves respostes. Li preguem que
integri el text al cos del missatge. Pot respondre usant NetEtiquete
que li ajudarà a seguir la conversa.
http://es.wikipedia.org/wiki/Netiquette

Por favor, NO adjunte archivos a sus respuestas. Le rogamos que
integre el texto en el cuerpo del mensaje. Puede responder usando
NetEtiquete que le ayudará a seguir la
conversación.http://es.wikipedia.org/wiki/Netiquette

Please, DO NOT send attachment files with your answers, just copy and
paste only the text you need to send into the body of your mails.
Repply using NetEtiquete. http://en.wikipedia.org/wiki/Netiquette

Cédric Krier

unread,
May 10, 2013, 4:51:03 AM5/10/13
to try...@googlegroups.com
On 10/05/13 01:41 -0700, TPH wrote:
> Hello,
>
> I have a module that copies the sale.description automatially to
> invoice.description.
>
> Some time ago I payed someone to create this module. Now I have to update
> the module to 2.6, but I can't reach this person any longer.
>
> So I tried to update nodule by my own, but I have some problems, because I
> don't really understand "super" and some other things.
>
> Here is the version of 2.4: http://pastebin.com/B6Wb6H3P
>
> and this is my experiment of the 2.6 version: http://pastebin.com/JmJxHYgn
> error message at the moment: local variable 'Sale' referenced before

Better to do like that: http://pastebin.com/kFtb5JuP

--
Cédric Krier

B2CK SPRL
Rue de Rotterdam, 4
4000 Liège
Belgium
Tel: +32 472 54 46 59
Email/Jabber: cedric...@b2ck.com
Website: http://www.b2ck.com/
Reply all
Reply to author
Forward
0 new messages