[REF] account, account_analytic_analysis, account_voucher, membership, pos : Remove warnings Builtbot

bzr revid: psi@tinyerp.co.in-20101027111108-jdby0r68w6qtfidf
This commit is contained in:
psi (Open ERP) 2010-10-27 16:41:08 +05:30
parent dd271353a9
commit 3fcb1cf996
11 changed files with 23 additions and 33 deletions

View File

@ -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):

View File

@ -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

View File

@ -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):

View File

@ -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,

View File

@ -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

View File

@ -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()

View File

@ -21,7 +21,6 @@
import netsvc
from osv import osv
from tools.translate import _
class pos_confirm(osv.osv_memory):

View File

@ -22,8 +22,6 @@
import time
from osv import osv, fields
from tools.translate import _
class pos_details(osv.osv_memory):
_name = 'pos.details'

View File

@ -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.

View File

@ -20,7 +20,6 @@
##############################################################################
from osv import osv
from tools.translate import _
class pos_payment_report(osv.osv_memory):
_name = 'pos.payment.report'

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@ -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 <http://www.gnu.org/licenses/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
@ -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()