Please review this at http://codereview.appspot.com/1879044/show
Affected files: M INSTALL M invoice.py Index: INSTALL =================================================================== --- a/INSTALL +++ b/INSTALL @@ -4,7 +4,7 @@ Prerequisites ------------- - * Python 2.4 or later (http://www.python.org/) + * Python 2.5 or later (http://www.python.org/) * trytond (http://www.tryton.org/) * trytond_account_invoice (http://www.tryton.org/) * trytond_party (http://www.tryton.org/) Index: invoice.py =================================================================== --- a/invoice.py +++ b/invoice.py @@ -1,8 +1,8 @@ #This file is part of Tryton. The COPYRIGHT file at the top level of #this repository contains the full copyright notices and license terms. -from trytond.model import ModelWorkflow, ModelView, ModelSQL, fields import datetime import copy +from trytond.model import ModelWorkflow, ModelView, ModelSQL, fields class Invoice(ModelWorkflow, ModelSQL, ModelView): @@ -30,22 +30,18 @@ self.payment_term.depends.append('open_date') self._reset_columns() - def set_number(self, cursor, user, invoice_id, context=None): - res = super(Invoice, self).set_number(cursor, user, invoice_id, - context=context) - self.write(cursor, user, invoice_id, { + def set_number(self, invoice_id): + res = super(Invoice, self).set_number(invoice_id) + self.write(invoice_id, { 'open_date': datetime.datetime.now(), - }, context=context) + }) return res - def copy(self, cursor, user, ids, default=None, context=None): + def copy(self, ids, default=None): if default is None: default = {} - default = default.copy() default['open_date'] = False - - return super(Invoice, self).copy(cursor, user, ids, default=default, - context=context) + return super(Invoice, self).copy(ids, default=default) Invoice() -- Cédric Krier B2CK SPRL Rue de Rotterdam, 4 4000 Liège Belgium Tel: +32 472 54 46 59 Email/Jabber: [email protected] Website: http://www.b2ck.com/
pgpDlhMt4EeCA.pgp
Description: PGP signature
