diff --git a/addons/account/report/rml_parse.py b/addons/account/report/rml_parse.py index aab5e14c777..cf33d1c6ae0 100644 --- a/addons/account/report/rml_parse.py +++ b/addons/account/report/rml_parse.py @@ -19,6 +19,8 @@ # ############################################################################## +import time + import re import sys @@ -100,7 +102,7 @@ class rml_parse(report_sxw.rml_parse): return Stringer return Stringer def explode_this(self,chaine,length): - chaine = rstrip(chaine) + chaine = chaine.rstrip() ast = list(chaine) i = length while i <= len(ast): diff --git a/addons/account_analytic_analysis/account_analytic_analysis.py b/addons/account_analytic_analysis/account_analytic_analysis.py index 90fc9f1fd6a..55213155168 100644 --- a/addons/account_analytic_analysis/account_analytic_analysis.py +++ b/addons/account_analytic_analysis/account_analytic_analysis.py @@ -20,7 +20,7 @@ ############################################################################## from osv import osv, fields -from osv.orm import intersect +from osv.orm import intersect, except_orm import tools.sql from tools.translate import _ from decimal_precision import decimal_precision as dp diff --git a/addons/account_voucher/report/rml_parse.py b/addons/account_voucher/report/rml_parse.py index 1a5d3fa6ec1..52c724ab7bf 100644 --- a/addons/account_voucher/report/rml_parse.py +++ b/addons/account_voucher/report/rml_parse.py @@ -101,7 +101,7 @@ class rml_parse(report_sxw.rml_parse): return Stringer def explode_this(self, chaine, length): - chaine = rstrip(chaine) + chaine = chaine.rstrip(chaine) ast = list(chaine) i = length while i <= len(ast): diff --git a/addons/membership/membership.py b/addons/membership/membership.py index c87ca4a66b1..86c35347691 100644 --- a/addons/membership/membership.py +++ b/addons/membership/membership.py @@ -22,7 +22,6 @@ import time from osv import fields, osv -from tools import config import decimal_precision as dp from tools.translate import _ @@ -525,15 +524,15 @@ class account_invoice_line(osv.osv): date_to = line.product_id.membership_date_to if line.invoice_id.date_invoice > date_from and line.invoice_id.date_invoice < date_to: date_from = line.invoice_id.date_invoice - line_id = member_line_obj.create(cr, uid, { - 'partner': line.invoice_id.partner_id.id, - 'membership_id': line.product_id.id, - 'member_price': line.price_unit, - 'date': time.strftime('%Y-%m-%d'), - 'date_from': date_from, - 'date_to': date_to, - 'account_invoice_line': line.id, - }, context=context) + member_line_obj.create(cr, uid, { + 'partner': line.invoice_id.partner_id.id, + 'membership_id': line.product_id.id, + 'member_price': line.price_unit, + 'date': time.strftime('%Y-%m-%d'), + 'date_from': date_from, + 'date_to': date_to, + 'account_invoice_line': line.id, + }, context=context) if line.product_id and not line.product_id.membership and ml_ids: # Product line has changed to a non membership product member_line_obj.unlink(cr, uid, ml_ids, context=context) @@ -564,7 +563,7 @@ class account_invoice_line(osv.osv): date_to = line.product_id.membership_date_to if line.invoice_id.date_invoice > date_from and line.invoice_id.date_invoice < date_to: date_from = line.invoice_id.date_invoice - line_id = member_line_obj.create(cr, uid, { + member_line_obj.create(cr, uid, { 'partner': line.invoice_id.partner_id and line.invoice_id.partner_id.id or False, 'membership_id': line.product_id.id, 'member_price': line.price_unit, diff --git a/addons/point_of_sale/wizard/pos_box_entries.py b/addons/point_of_sale/wizard/pos_box_entries.py index 243cbc02c7d..059fd755d89 100644 --- a/addons/point_of_sale/wizard/pos_box_entries.py +++ b/addons/point_of_sale/wizard/pos_box_entries.py @@ -116,7 +116,7 @@ class pos_box_entries(osv.osv_memory): }, context=context) vals['statement_id'] = statement_id - valss['journal_id'] = data['journal_id'] + vals['journal_id'] = data['journal_id'] if acc_id: vals['account_id'] = acc_id.id vals['amount'] = data['amount'] or 0.0 diff --git a/addons/point_of_sale/wizard/pos_box_out.py b/addons/point_of_sale/wizard/pos_box_out.py index d2eb7b62509..a9f5da433fb 100644 --- a/addons/point_of_sale/wizard/pos_box_out.py +++ b/addons/point_of_sale/wizard/pos_box_out.py @@ -123,7 +123,7 @@ class pos_box_out(osv.osv_memory): address_u = res_obj.browse(cr, uid, uid, context=context).address_id if address_u: vals['partner_id'] = address_u.partner_id and address_u.partner_id.id or None - statement_line_id = statement_line_obj.create(cr, uid, vals, context=context) + statement_line_obj.create(cr, uid, vals, context=context) return {} pos_box_out() diff --git a/addons/point_of_sale/wizard/pos_confirm.py b/addons/point_of_sale/wizard/pos_confirm.py index f4c53d66297..c55209650ca 100644 --- a/addons/point_of_sale/wizard/pos_confirm.py +++ b/addons/point_of_sale/wizard/pos_confirm.py @@ -21,7 +21,6 @@ import netsvc from osv import osv -from tools.translate import _ class pos_confirm(osv.osv_memory): diff --git a/addons/point_of_sale/wizard/pos_details.py b/addons/point_of_sale/wizard/pos_details.py index 2e272826b4f..79063bbd73d 100644 --- a/addons/point_of_sale/wizard/pos_details.py +++ b/addons/point_of_sale/wizard/pos_details.py @@ -22,8 +22,6 @@ import time from osv import osv, fields -from tools.translate import _ - class pos_details(osv.osv_memory): _name = 'pos.details' diff --git a/addons/point_of_sale/wizard/pos_discount.py b/addons/point_of_sale/wizard/pos_discount.py index d92a545a4ab..f0ea93e3d7a 100644 --- a/addons/point_of_sale/wizard/pos_discount.py +++ b/addons/point_of_sale/wizard/pos_discount.py @@ -20,8 +20,6 @@ ############################################################################## from osv import osv, fields -from tools.translate import _ - class pos_discount(osv.osv_memory): _name = 'pos.discount' @@ -45,12 +43,13 @@ class pos_discount(osv.osv_memory): @param context: A standard dictionary @return: New arch of view with new columns. """ - res = super(pos_discount, self).view_init(cr, uid, fields_list, context=context) + super(pos_discount, self).view_init(cr, uid, fields_list, context=context) record_id = context and context.get('active_id', False) or False order = self.pool.get('pos.order').browse(cr, uid, record_id, context=context) if not order.lines: raise osv.except_osv('Error!','No Order Lines ') True + def apply_discount(self, cr, uid, ids, context=None): """ To give the discount of product and check the. diff --git a/addons/point_of_sale/wizard/pos_payment_report.py b/addons/point_of_sale/wizard/pos_payment_report.py index 893cb3c0fda..e232466da0e 100644 --- a/addons/point_of_sale/wizard/pos_payment_report.py +++ b/addons/point_of_sale/wizard/pos_payment_report.py @@ -20,7 +20,6 @@ ############################################################################## from osv import osv -from tools.translate import _ class pos_payment_report(osv.osv_memory): _name = 'pos.payment.report' diff --git a/addons/point_of_sale/wizard/pos_receipt.py b/addons/point_of_sale/wizard/pos_receipt.py index 74f865ca06c..665ad6a5043 100644 --- a/addons/point_of_sale/wizard/pos_receipt.py +++ b/addons/point_of_sale/wizard/pos_receipt.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (). # @@ -15,7 +15,7 @@ # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . +# along with this program. If not, see . # ############################################################################## @@ -26,10 +26,6 @@ class pos_receipt(osv.osv_memory): _name = 'pos.receipt' _description = 'Point of sale receipt' - _columns = { - - } - def view_init(self, cr, uid, fields_list, context=None): """ Creates view dynamically and adding fields at runtime. @@ -39,10 +35,9 @@ class pos_receipt(osv.osv_memory): @param context: A standard dictionary @return: New arch of view with new columns. """ - order_lst = self. pool.get('pos.order').browse(cr, uid, context['active_id']) + order_lst = self. pool.get('pos.order').browse(cr, uid, context['active_id'], context=context) def print_report(self, cr, uid, ids, context=None): - """ To get the date and print the report @param self: The object pointer. @@ -54,11 +49,10 @@ class pos_receipt(osv.osv_memory): datas = {'ids': context.get('active_ids', [])} res = {} datas['form'] = res - return { 'type': 'ir.actions.report.xml', 'report_name': 'pos.receipt', 'datas': datas, - } + } pos_receipt()