From 3aa45c830ce9f714645a5bd9e360850e9b7b05da Mon Sep 17 00:00:00 2001 From: "uco (OpenERP)" Date: Tue, 12 Oct 2010 10:21:57 +0530 Subject: [PATCH 001/116] [IMP] mrp: Corrections suggested by buildbot. bzr revid: uco@tinyerp.com-20101012045157-l63wl4fnyfsgf8tr --- addons/mrp/i18n/de.po | 4 ++-- addons/mrp/wizard/change_production_qty.py | 5 ----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/addons/mrp/i18n/de.po b/addons/mrp/i18n/de.po index 2e84ba9f1e2..094b42b8735 100644 --- a/addons/mrp/i18n/de.po +++ b/addons/mrp/i18n/de.po @@ -396,8 +396,8 @@ msgid "" "partner location if you subcontract the manufacturing operations." msgstr "" "Leer lassen, wenn die Produktion an jenen Orten erfolgt, an denen die " -"Fertigprodukte gebraucht werden.\r\n" -"Setze einen Ort, wenn an fixen Orten produziert wird.\r\n" +"Fertigprodukte gebraucht werden.\n" +"Setze einen Ort, wenn an fixen Orten produziert wird.\n" "Das kann auch ein Partner-Ort sein, wenn Sie Subkontrakte haben." #. module: mrp diff --git a/addons/mrp/wizard/change_production_qty.py b/addons/mrp/wizard/change_production_qty.py index f5d62d535c9..0cee5ea60a3 100644 --- a/addons/mrp/wizard/change_production_qty.py +++ b/addons/mrp/wizard/change_production_qty.py @@ -19,11 +19,7 @@ # ############################################################################## -import time -import ir -from osv.osv import except_osv from osv import fields, osv -import netsvc from tools.translate import _ class change_production_qty(osv.osv_memory): @@ -63,7 +59,6 @@ class change_production_qty(osv.osv_memory): record_id = context and context.get('active_id',False) assert record_id, _('Active Id is not found') prod_obj = self.pool.get('mrp.production') - product_lines_obj = self.pool.get('mrp.production.product.line') bom_obj = self.pool.get('mrp.bom') for wiz_qty in self.browse(cr, uid, ids): prod = prod_obj.browse(cr, uid,record_id) From 3704b3de8b3ef496c43a1d8d80666bbb6f3d3a87 Mon Sep 17 00:00:00 2001 From: "uco (OpenERP)" Date: Tue, 12 Oct 2010 11:47:07 +0530 Subject: [PATCH 002/116] [REF] : Corrections suggested by buildbot. bzr revid: uco@tinyerp.com-20101012061707-wi0uph158ahn99ob --- addons/mrp/stock.py | 4 ---- addons/mrp_subproduct/mrp_subproduct.py | 2 +- addons/point_of_sale/report/pos_receipt.py | 1 - addons/procurement/schedulers.py | 7 ------- addons/purchase/purchase.py | 6 ------ addons/sale/stock.py | 3 +-- 6 files changed, 2 insertions(+), 21 deletions(-) diff --git a/addons/mrp/stock.py b/addons/mrp/stock.py index 9f149dda6bd..90f89a16bfa 100644 --- a/addons/mrp/stock.py +++ b/addons/mrp/stock.py @@ -19,13 +19,9 @@ # ############################################################################## -from mx import DateTime from osv import fields from osv import osv -from tools.translate import _ -import ir import netsvc -import time class StockMove(osv.osv): diff --git a/addons/mrp_subproduct/mrp_subproduct.py b/addons/mrp_subproduct/mrp_subproduct.py index 5519bba3a5c..e271e2bfb26 100644 --- a/addons/mrp_subproduct/mrp_subproduct.py +++ b/addons/mrp_subproduct/mrp_subproduct.py @@ -95,7 +95,7 @@ class mrp_production(osv.osv): 'state': 'waiting', 'production_id': production.id } - sub_prod_ids = self.pool.get('stock.move').create(cr, uid, data) + self.pool.get('stock.move').create(cr, uid, data) return picking_id mrp_production() diff --git a/addons/point_of_sale/report/pos_receipt.py b/addons/point_of_sale/report/pos_receipt.py index 9be543fb89b..40924003e1c 100644 --- a/addons/point_of_sale/report/pos_receipt.py +++ b/addons/point_of_sale/report/pos_receipt.py @@ -24,7 +24,6 @@ from report import report_sxw import pooler def titlize(journal_name): - res = [] words = journal_name.split() while words.pop() != 'journal': continue diff --git a/addons/procurement/schedulers.py b/addons/procurement/schedulers.py index 06cbb86957a..2c4d96d73f5 100644 --- a/addons/procurement/schedulers.py +++ b/addons/procurement/schedulers.py @@ -64,7 +64,6 @@ class procurement_order(osv.osv): report_total = 0 report_except = 0 report_later = 0 - allids = self.search(cr, uid, []) while True: cr.execute('select id from procurement_order where state=%s and procure_method=%s order by priority,date_planned limit 500 offset %s', ('confirmed', 'make_to_order', offset)) ids = map(lambda x: x[0], cr.fetchall()) @@ -226,12 +225,6 @@ class procurement_order(osv.osv): qty += op.qty_multiple - reste newdate = DateTime.now() + DateTime.RelativeDateTime( days = int(op.product_id.seller_delay)) - if op.product_id.supply_method == 'buy': - location_id = op.warehouse_id.lot_input_id - elif op.product_id.supply_method == 'produce': - location_id = op.warehouse_id.lot_stock_id - else: - continue if qty <= 0: continue if op.product_id.type not in ('consu'): diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index 1522c4543f3..655e74a74a8 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -26,9 +26,7 @@ from dateutil.relativedelta import relativedelta from osv import osv, fields import netsvc -import ir import pooler -from tools import config from tools.translate import _ import decimal_precision as dp from osv.orm import browse_record, browse_null @@ -284,7 +282,6 @@ class purchase_order(osv.osv): for line in po.order_line: if line.state=='draft': todo.append(line.id) - current_name = self.name_get(cr, uid, ids)[0][1] self.pool.get('purchase.order.line').action_confirm(cr, uid, todo, context) for id in ids: self.write(cr, uid, [id], {'state' : 'confirmed', 'validator' : uid}) @@ -396,8 +393,6 @@ class purchase_order(osv.osv): return False def action_cancel(self, cr, uid, ids, context={}): - ok = True - purchase_order_line_obj = self.pool.get('purchase.order.line') for purchase in self.browse(cr, uid, ids): for pick in purchase.picking_ids: if pick.state not in ('draft','cancel'): @@ -695,7 +690,6 @@ class purchase_order_line(osv.osv): 'product_uom': uom}} domain = {} - partner = self.pool.get('res.partner').browse(cr, uid, partner_id) taxes = self.pool.get('account.tax').browse(cr, uid,map(lambda x: x.id, prod.supplier_taxes_id)) fpos = fiscal_position and self.pool.get('account.fiscal.position').browse(cr, uid, fiscal_position) or False res['value']['taxes_id'] = self.pool.get('account.fiscal.position').map_tax(cr, uid, fpos, taxes) diff --git a/addons/sale/stock.py b/addons/sale/stock.py index 0bb47110213..88792f48bb8 100644 --- a/addons/sale/stock.py +++ b/addons/sale/stock.py @@ -46,7 +46,7 @@ class stock_move(osv.osv): def _create_chained_picking(self, cr, uid, pick_name,picking,ptype,move, context=None): res=super(stock_move, self)._create_chained_picking(cr, uid, pick_name,picking,ptype,move, context=context) if picking.sale_id: - picking_obj = self.pool.get('stock.picking').write(cr,uid,[res],{'sale_id':picking.sale_id.id}) + self.pool.get('stock.picking').write(cr,uid,[res],{'sale_id':picking.sale_id.id}) return res stock_move() @@ -66,7 +66,6 @@ class stock_picking(osv.osv): return super(stock_picking, self).get_currency_id(cursor, user, picking) def _get_payment_term(self, cursor, user, picking): - res = {} if picking.sale_id and picking.sale_id.payment_term: return picking.sale_id.payment_term.id return super(stock_picking, self)._get_payment_term(cursor, From 328b843d2f2fe79de4138617f229b85da6b659fa Mon Sep 17 00:00:00 2001 From: "uco (OpenERP)" Date: Tue, 12 Oct 2010 12:04:58 +0530 Subject: [PATCH 003/116] [IMP] mrp, mrp_operations: View improved. bzr revid: uco@tinyerp.com-20101012063458-2lbszse6pna3vyf0 --- addons/mrp/mrp_view.xml | 10 +++++----- addons/mrp_operations/mrp_operations_view.xml | 11 ++++++----- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml index 7addfbc3194..800511eb14f 100644 --- a/addons/mrp/mrp_view.xml +++ b/addons/mrp/mrp_view.xml @@ -579,8 +579,8 @@ - - + + - - - - - account.invoice.supplier.pay - account.invoice - form - - - - - - + + account.invoice.customer.pay + account.invoice + form + + + + + + + + account.invoice.supplier.pay + account.invoice + form + + + + + diff --git a/addons/account_voucher/account_voucher_report.xml b/addons/account_voucher/account_voucher_report.xml index db1b4279620..785fd91df73 100644 --- a/addons/account_voucher/account_voucher_report.xml +++ b/addons/account_voucher/account_voucher_report.xml @@ -19,6 +19,5 @@ auto="False" header = "False" menu="True"/> - diff --git a/addons/account_voucher/invoice.py b/addons/account_voucher/invoice.py index 7b6d232d702..f48af5cb28d 100644 --- a/addons/account_voucher/invoice.py +++ b/addons/account_voucher/invoice.py @@ -24,6 +24,7 @@ from tools.translate import _ class invoice(osv.osv): _inherit = 'account.invoice' + def invoice_pay_customer(self, cr, uid, ids, context={}): if not ids: return [] inv = self.browse(cr, uid, ids[0], context=context) @@ -49,3 +50,5 @@ class invoice(osv.osv): } invoice() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/account_voucher/report/__init__.py b/addons/account_voucher/report/__init__.py index b451c21b6a0..010f6446338 100644 --- a/addons/account_voucher/report/__init__.py +++ b/addons/account_voucher/report/__init__.py @@ -21,3 +21,5 @@ import account_voucher import account_voucher_print + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/account_voucher/report/account_voucher.py b/addons/account_voucher/report/account_voucher.py index c37d921ecbc..7931daffbac 100644 --- a/addons/account_voucher/report/account_voucher.py +++ b/addons/account_voucher/report/account_voucher.py @@ -69,4 +69,6 @@ report_sxw.report_sxw( 'account.voucher', 'addons/account_voucher/report/account_voucher.rml', parser=report_voucher,header="external" -) \ No newline at end of file +) + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/account_voucher/report/account_voucher_print.py b/addons/account_voucher/report/account_voucher_print.py index d39b77d8374..8bd8644c03c 100644 --- a/addons/account_voucher/report/account_voucher_print.py +++ b/addons/account_voucher/report/account_voucher_print.py @@ -92,3 +92,5 @@ report_sxw.report_sxw( 'addons/account_voucher/report/account_voucher_print.rml', parser=report_voucher_print,header="external" ) + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file From e02663c0e5cf5dbd1a51f0595aeb030a6b0ff1fa Mon Sep 17 00:00:00 2001 From: vra Date: Fri, 15 Oct 2010 11:36:46 +0530 Subject: [PATCH 024/116] [REF]hr_payroll: code cleaning. bzr revid: vra@tinyerp.com-20101015060646-j13hl72gw54m28sk --- addons/hr_payroll/report/__init__.py | 4 +++- addons/hr_payroll/report/report_emp_salary_structure.py | 7 ------- addons/hr_payroll/report/report_payroll_register.py | 2 ++ addons/hr_payroll/report/report_payslip.py | 5 ----- addons/hr_payroll/report/report_year_salary.py | 2 +- addons/hr_payroll/report/rml_parse.py | 2 ++ addons/hr_payroll/wizard/__init__.py | 2 ++ 7 files changed, 10 insertions(+), 14 deletions(-) diff --git a/addons/hr_payroll/report/__init__.py b/addons/hr_payroll/report/__init__.py index c0f35b40bfc..925b5e4c97d 100755 --- a/addons/hr_payroll/report/__init__.py +++ b/addons/hr_payroll/report/__init__.py @@ -27,4 +27,6 @@ import report_payroll_advice import report_year_salary import report_payroll_register import report_employees_detail -import report_emp_salary_structure \ No newline at end of file +import report_emp_salary_structure + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/hr_payroll/report/report_emp_salary_structure.py b/addons/hr_payroll/report/report_emp_salary_structure.py index e875e774b43..5c1fccd8cad 100644 --- a/addons/hr_payroll/report/report_emp_salary_structure.py +++ b/addons/hr_payroll/report/report_emp_salary_structure.py @@ -89,13 +89,6 @@ class salary_structure_report(report_sxw.rml_parse): report_sxw.report_sxw('report.salary.structure', 'hr.employee', 'hr_payroll/report/report_emp_salary_structure.rml', parser=salary_structure_report) - - - - - - - # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/hr_payroll/report/report_payroll_register.py b/addons/hr_payroll/report/report_payroll_register.py index e991ede4903..df8d0c50fad 100644 --- a/addons/hr_payroll/report/report_payroll_register.py +++ b/addons/hr_payroll/report/report_payroll_register.py @@ -82,3 +82,5 @@ report_sxw.report_sxw( 'hr_payroll/report/payroll_register.rml', parser=report_payroll_register ) + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/hr_payroll/report/report_payslip.py b/addons/hr_payroll/report/report_payslip.py index 7de5dfee0d9..9b77a790d66 100755 --- a/addons/hr_payroll/report/report_payslip.py +++ b/addons/hr_payroll/report/report_payslip.py @@ -99,11 +99,6 @@ class payslip_report(report_sxw.rml_parse): report_sxw.report_sxw('report.payslip.pdf', 'hr.payslip', 'hr_payroll/report/payslip.rml', parser=payslip_report) - - - - - # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/hr_payroll/report/report_year_salary.py b/addons/hr_payroll/report/report_year_salary.py index 2db2d7d7e2d..08416db3d5a 100755 --- a/addons/hr_payroll/report/report_year_salary.py +++ b/addons/hr_payroll/report/report_year_salary.py @@ -98,5 +98,5 @@ class year_salary_report(rml_parse.rml_parse): report_sxw.report_sxw('report.year.salary', 'hr.payslip', 'hr_payroll/report/report_year_report.rml', parser=year_salary_report,header='internal landscape') - +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/hr_payroll/report/rml_parse.py b/addons/hr_payroll/report/rml_parse.py index 7abb29711b6..45bff3386b5 100755 --- a/addons/hr_payroll/report/rml_parse.py +++ b/addons/hr_payroll/report/rml_parse.py @@ -169,3 +169,5 @@ class rml_parse(report_sxw.rml_parse): else : found.getparent().replace(found,tag) return True + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/hr_payroll/wizard/__init__.py b/addons/hr_payroll/wizard/__init__.py index 93222a2e343..4fb72fb4695 100755 --- a/addons/hr_payroll/wizard/__init__.py +++ b/addons/hr_payroll/wizard/__init__.py @@ -24,3 +24,5 @@ import hr_payroll_employees_detail #import hr_payroll_create_analytic import hr_payroll_year_salary + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file From da427c55dcdef3c0bba01290d14e1695423bb6ed Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Fri, 15 Oct 2010 11:45:15 +0530 Subject: [PATCH 025/116] [FIX] Account: Account move line => Now it will work if you have filter by dates and with initial balances bzr revid: mra@mra-laptop-20101015061515-jct5lvb5iosc1a7p --- addons/account/account_move_line.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index b10ced65e88..176b1d2a8fb 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -32,11 +32,13 @@ class account_move_line(osv.osv): _name = "account.move.line" _description = "Journal Items" - def _query_get(self, cr, uid, obj='l', context={}): + def _query_get(self, cr, uid, obj='l', context=None): fiscalyear_obj = self.pool.get('account.fiscalyear') fiscalperiod_obj = self.pool.get('account.period') fiscalyear_ids = [] fiscalperiod_ids = [] + if context is None: + context = {} initial_bal = context.get('initial_bal', False) company_clause = "" if context.get('company_id', False): @@ -58,7 +60,7 @@ class account_move_line(osv.osv): if context.get('date_from', False) and context.get('date_to', False): if initial_bal: - where_move_lines_by_date = " AND " +obj+".move_id in ( select id from account_move where date < '"+context['date_from']+"')" + where_move_lines_by_date = " OR " +obj+".move_id in ( select id from account_move where date < '"+context['date_from']+"')" else: where_move_lines_by_date = " AND " +obj+".move_id in ( select id from account_move where date >= '" +context['date_from']+"' AND date <= '"+context['date_to']+"')" @@ -88,7 +90,7 @@ class account_move_line(osv.osv): ids = ','.join([str(x) for x in context['periods']]) query = obj+".state<>'draft' AND "+obj+".period_id in (SELECT id from account_period WHERE fiscalyear_id in (%s) AND id in (%s)) %s %s" % (fiscalyear_clause, ids, where_move_state, where_move_lines_by_date) else: - query = obj+".state<>'draft' AND "+obj+".period_id in (SELECT id from account_period WHERE fiscalyear_id in (%s) %s %s)" % (fiscalyear_clause,where_move_state,where_move_lines_by_date) + query = obj+".state<>'draft' AND "+obj+".period_id in (SELECT id from account_period WHERE fiscalyear_id in (%s) %s %s)" % (fiscalyear_clause, where_move_state, where_move_lines_by_date) if context.get('journal_ids', False): query += ' AND '+obj+'.journal_id in (%s)' % ','.join(map(str, context['journal_ids'])) From db483e11458ff3a8e4a27941c356837d22c1295d Mon Sep 17 00:00:00 2001 From: "psi (Open ERP)" Date: Fri, 15 Oct 2010 11:51:49 +0530 Subject: [PATCH 026/116] [ADD] account: Add yml test for account bank statement bzr revid: psi@tinyerp.co.in-20101015062149-lypn3njs9dd4c5rg --- addons/account/__openerp__.py | 1 + .../account/test/account_bank_statement.yml | 63 +++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 addons/account/test/account_bank_statement.yml diff --git a/addons/account/__openerp__.py b/addons/account/__openerp__.py index 7229f1d3364..851d52294fa 100644 --- a/addons/account/__openerp__.py +++ b/addons/account/__openerp__.py @@ -131,6 +131,7 @@ module named account_voucher. 'test/account_use_model.yml', 'test/account_validate_account_move.yml', 'test/account_fiscalyear_close.yml', + 'test/account_bank_statement.yml', 'test/account_report.yml', ], 'installable': True, diff --git a/addons/account/test/account_bank_statement.yml b/addons/account/test/account_bank_statement.yml new file mode 100644 index 00000000000..b05a4f820f6 --- /dev/null +++ b/addons/account/test/account_bank_statement.yml @@ -0,0 +1,63 @@ +- + In order to test Bank Statement feature of account I create a bank statement line and confirm it and check it's move created +- + I create a bank statement with Opening and Closing balance 0. +- + !record {model: account.bank.statement, id: account_bank_statement_0}: + balance_end_real: 0.0 + balance_start: 0.0 + date: '2010-10-14' + journal_id: account.bank_journal + name: / + period_id: account.period_10 + line_ids: + - account_id: account.a_recv + amount: 1000.0 + date: '2010-10-14' + name: a + partner_id: base.res_partner_4 + sequence: 0.0 + type: general +- + I check that Initially bank statement is in the "Draft" state +- + !assert {model: account.bank.statement, id: account_bank_statement_0}: + - state == 'draft' +- + I compute bank statement using Compute button +- + !python {model: account.bank.statement}: | + self.button_dummy(cr, uid, [ref("account_bank_statement_0")], {"lang": "en_US", + "tz": False, "active_model": "ir.ui.menu", "journal_type": "bank", "section_id": + False, "period_id": 10, "active_ids": [ref("account.menu_bank_statement_tree")], + "active_id": ref("account.menu_bank_statement_tree"), }) + +- + I modify the bank statement and set the Closing Balance. +- + !record {model: account.bank.statement, id: account_bank_statement_0}: + balance_end_real: 1000.0 + +- + I confirm the bank statement using Confirm button +- + !python {model: account.bank.statement}: | + self.button_confirm_bank(cr, uid, [ref("account_bank_statement_0")], {"lang": + "en_US", "tz": False, "active_model": "ir.ui.menu", "journal_type": "bank", + "section_id": False, "period_id": 10, "active_ids": [ref("account.menu_bank_statement_tree")], + "active_id": ref("account.menu_bank_statement_tree"), }) +- + I check that bank statement state is now "Closed" +- + !assert {model: account.bank.statement, id: account_bank_statement_0}: + - state == 'confirm' + +- + I check that move lines created for bank statement and move state is Posted +- + !python {model: account.bank.statement}: | + move_line_obj = self.pool.get('account.move.line') + bank_data = self.browse(cr, uid, ref("account_bank_statement_0")) + assert bank_data.move_line_ids, "Move lines not created for bank statement" + for line in bank_data.move_line_ids: + assert line.move_id.state == 'posted', "Move state is not posted" From 0dc5d800f279c678248ca86998e30084bc74e208 Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Fri, 15 Oct 2010 12:03:48 +0530 Subject: [PATCH 027/116] [REF] cleaing account bzr revid: mra@mra-laptop-20101015063348-1karrzxmopp28zlz --- addons/account/account_move_line.py | 9 ++++----- addons/account/project/project.py | 3 --- addons/account/report/account_aged_partner_balance.py | 1 - addons/account/report/account_balance_sheet.py | 2 -- addons/account/wizard/account_fiscalyear_close.py | 2 -- addons/account/wizard/account_fiscalyear_close_state.py | 2 -- addons/account/wizard/account_report_balance_sheet.py | 1 - addons/account/wizard/account_report_common.py | 6 ------ 8 files changed, 4 insertions(+), 22 deletions(-) diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index 176b1d2a8fb..afc063d3a1d 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -36,7 +36,6 @@ class account_move_line(osv.osv): fiscalyear_obj = self.pool.get('account.fiscalyear') fiscalperiod_obj = self.pool.get('account.period') fiscalyear_ids = [] - fiscalperiod_ids = [] if context is None: context = {} initial_bal = context.get('initial_bal', False) @@ -130,7 +129,7 @@ class account_move_line(osv.osv): 'move_id':obj_line.id, 'user_id': uid } - new_id = self.pool.get('account.analytic.line').create(cr,uid,vals_lines) + self.pool.get('account.analytic.line').create(cr,uid,vals_lines) return True def _default_get_move_form_hook(self, cursor, user, data): @@ -1127,7 +1126,7 @@ class account_move_line(osv.osv): self._update_journal_check(cr, uid, context['journal_id'], context['period_id'], context) move_id = vals.get('move_id', False) journal = self.pool.get('account.journal').browse(cr, uid, context['journal_id']) - is_new_move = False +# is_new_move = False if not move_id: if journal.centralisation: #Check for centralisation @@ -1147,7 +1146,7 @@ class account_move_line(osv.osv): vals['move_id'] = move_id else: raise osv.except_osv(_('No piece number !'), _('Can not create an automatic sequence for this piece !\n\nPut a sequence in the journal definition for automatic numbering or create a sequence manually for this piece.')) - is_new_move = True +# is_new_move = True ok = not (journal.type_control_ids or journal.account_control_ids) if ('account_id' in vals): @@ -1262,7 +1261,7 @@ class account_move_line(osv.osv): if check and ((not context.get('no_store_function')) or journal.entry_posted): tmp = self.pool.get('account.move').validate(cr, uid, [vals['move_id']], context) if journal.entry_posted and tmp: - rs = self.pool.get('account.move').button_validate(cr,uid, [vals['move_id']],context) + self.pool.get('account.move').button_validate(cr,uid, [vals['move_id']],context) return result account_move_line() diff --git a/addons/account/project/project.py b/addons/account/project/project.py index 5a58eca97a4..c5c0d223bef 100644 --- a/addons/account/project/project.py +++ b/addons/account/project/project.py @@ -19,9 +19,6 @@ # ############################################################################## -import time -import operator - from osv import fields from osv import osv diff --git a/addons/account/report/account_aged_partner_balance.py b/addons/account/report/account_aged_partner_balance.py index 95842b92623..082947566bd 100644 --- a/addons/account/report/account_aged_partner_balance.py +++ b/addons/account/report/account_aged_partner_balance.py @@ -21,7 +21,6 @@ import time -import pooler import rml_parse from report import report_sxw from common_report_header import common_report_header diff --git a/addons/account/report/account_balance_sheet.py b/addons/account/report/account_balance_sheet.py index ba2cd97f062..820ddfb473d 100644 --- a/addons/account/report/account_balance_sheet.py +++ b/addons/account/report/account_balance_sheet.py @@ -78,11 +78,9 @@ class report_balancesheet_horizontal(rml_parse.rml_parse, common_report_header): db_pool = pooler.get_pool(self.cr.dbname) #Getting Profit or Loss Balance from profit and Loss report - result_pl = self.obj_pl.get_data(data) self.res_bl = self.obj_pl.final_result() account_pool = db_pool.get('account.account') - year_pool = db_pool.get('account.fiscalyear') types = [ 'liability', diff --git a/addons/account/wizard/account_fiscalyear_close.py b/addons/account/wizard/account_fiscalyear_close.py index cbf1de89a31..d58ef42cf6f 100644 --- a/addons/account/wizard/account_fiscalyear_close.py +++ b/addons/account/wizard/account_fiscalyear_close.py @@ -20,7 +20,6 @@ ############################################################################## from osv import fields, osv from tools.translate import _ -import tools class account_fiscalyear_close(osv.osv_memory): """ @@ -57,7 +56,6 @@ class account_fiscalyear_close(osv.osv_memory): obj_acc_move_line = self.pool.get('account.move.line') obj_acc_account = self.pool.get('account.account') obj_acc_journal_period = self.pool.get('account.journal.period') - obj_rec = self.pool.get('account.move.reconcile') data = self.read(cr, uid, ids, context=context) diff --git a/addons/account/wizard/account_fiscalyear_close_state.py b/addons/account/wizard/account_fiscalyear_close_state.py index 899f3353cbd..4c0a29d6896 100644 --- a/addons/account/wizard/account_fiscalyear_close_state.py +++ b/addons/account/wizard/account_fiscalyear_close_state.py @@ -20,8 +20,6 @@ ############################################################################## from osv import fields, osv -from tools.translate import _ -import tools class account_fiscalyear_close_state(osv.osv_memory): """ diff --git a/addons/account/wizard/account_report_balance_sheet.py b/addons/account/wizard/account_report_balance_sheet.py index 9dc04bdad10..0d64a753f55 100644 --- a/addons/account/wizard/account_report_balance_sheet.py +++ b/addons/account/wizard/account_report_balance_sheet.py @@ -44,7 +44,6 @@ class account_bs_report(osv.osv_memory): } def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): - mod_obj = self.pool.get('ir.model.data') res = super(account_bs_report, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=False) doc = etree.XML(res['arch']) nodes = doc.xpath("//field[@name='journal_ids']") diff --git a/addons/account/wizard/account_report_common.py b/addons/account/wizard/account_report_common.py index 517fbf248e5..307272f42ab 100644 --- a/addons/account/wizard/account_report_common.py +++ b/addons/account/wizard/account_report_common.py @@ -20,8 +20,6 @@ ############################################################################## import time -import datetime -from datetime import timedelta from lxml import etree from osv import fields, osv @@ -46,7 +44,6 @@ class account_common_report(osv.osv_memory): } def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): - mod_obj = self.pool.get('ir.model.data') res = super(account_common_report, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=False) if context.get('active_model', False) == 'account.account' and view_id: doc = etree.XML(res['arch']) @@ -111,8 +108,6 @@ class account_common_report(osv.osv_memory): if context is None: context = {} result = {} - period_obj = self.pool.get('account.period') - fiscal_obj = self.pool.get('account.fiscalyear') result['fiscalyear'] = 'fiscalyear_id' in data['form'] and data['form']['fiscalyear_id'] or False result['journal_ids'] = 'journal_ids' in data['form'] and data['form']['journal_ids'] or False result['chart_account_id'] = 'chart_account_id' in data['form'] and data['form']['chart_account_id'] or False @@ -132,7 +127,6 @@ class account_common_report(osv.osv_memory): def check_report(self, cr, uid, ids, context=None): if context is None: context = {} - obj_move = self.pool.get('account.move.line') data = {} data['ids'] = context.get('active_ids', []) data['model'] = context.get('active_model', 'ir.ui.menu') From 95e6710c847c8a4874a09975cf10ed077e2cc335 Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Fri, 15 Oct 2010 12:15:29 +0530 Subject: [PATCH 028/116] [REF] cleaing account... bzr revid: mra@mra-laptop-20101015064529-ku04s33sy2n8nzb8 --- addons/account_voucher/account_voucher.py | 2 +- addons/analytic/analytic.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index 17bdb1cb977..abe0e5e5708 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -800,7 +800,7 @@ class account_voucher_line(osv.osv): move_line = move_line_pool.browse(cr, user, move_line_id, context=context) if move_line.credit: ttype = 'dr' - amount = move_line.credit +# amount = move_line.credit else: ttype = 'cr' account_id = move_line.account_id.id diff --git a/addons/analytic/analytic.py b/addons/analytic/analytic.py index dd727e993b6..f6263bfeb0d 100644 --- a/addons/analytic/analytic.py +++ b/addons/analytic/analytic.py @@ -236,7 +236,6 @@ class account_analytic_account(osv.osv): if not parent_id: return {} parent = self.read(cr, uid, [parent_id], ['partner_id','code'])[0] - childs = self.search(cr, uid, [('parent_id', '=', parent_id)]) if parent['partner_id']: partner = parent['partner_id'][0] else: From e9848363cef6b6fc5b9f44ac4e8e78a2ee1a2e30 Mon Sep 17 00:00:00 2001 From: vra Date: Fri, 15 Oct 2010 12:23:13 +0530 Subject: [PATCH 029/116] [FIX]account: fixed \r escape problem in po file. bzr revid: vra@tinyerp.com-20101015065313-7f2zbeylq8ff9k3n --- addons/account/i18n/sr.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/account/i18n/sr.po b/addons/account/i18n/sr.po index 7efd4a0b1be..d94fc6cb72d 100644 --- a/addons/account/i18n/sr.po +++ b/addons/account/i18n/sr.po @@ -2682,10 +2682,10 @@ msgid "" "partners accounts (for debit/credit computations), closed for deprecated " "accounts." msgstr "" -"Sintetički zbirni konto, ne sadrži knjiženja\r\n" -"Konsolidacija: Zbirni konto za više preduzeća i paralelne kontne planove\r\n" -"Obveze: Salda konta partnera - dobavljači\r\n" -"Potraživanja: Salda konta partnera - kupci\r\n" +"Sintetički zbirni konto, ne sadrži knjiženja\n" +"Konsolidacija: Zbirni konto za više preduzeća i paralelne kontne planove\n" +"Obveze: Salda konta partnera - dobavljači\n" +"Potraživanja: Salda konta partnera - kupci\n" "Zatvoren: Za konta koja se više ne koriste" #. module: account From 2a77b86cd1418b0d1674578b2101efde55f68180 Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Fri, 15 Oct 2010 12:26:48 +0530 Subject: [PATCH 030/116] [REF] bzr revid: mra@mra-laptop-20101015065648-x63gc3akv68nntwe --- addons/account/account_move_line.py | 42 ++++++++++++++++------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index afc063d3a1d..6ff4f07aa3b 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -18,15 +18,16 @@ # along with this program. If not, see . # ############################################################################## + import time from datetime import datetime +from operator import itemgetter import netsvc from osv import fields, osv from tools.translate import _ import decimal_precision as dp import tools -from operator import itemgetter class account_move_line(osv.osv): _name = "account.move.line" @@ -102,8 +103,8 @@ class account_move_line(osv.osv): return query - def default_get(self, cr, uid, fields, context={}): - data = self._default_get(cr, uid, fields, context) + def default_get(self, cr, uid, fields, context=None): + data = self._default_get(cr, uid, fields, context=context) for f in data.keys(): if f not in fields: del data[f] @@ -498,17 +499,17 @@ class account_move_line(osv.osv): return cur and cur.id or False _defaults = { - 'blocked': lambda *a: False, - 'centralisation': lambda *a: 'normal', + 'blocked': False, + 'centralisation': 'normal', 'date': _get_date, - 'date_created': lambda *a: time.strftime('%Y-%m-%d'), - 'state': lambda *a: 'draft', + 'date_created': time.strftime('%Y-%m-%d'), + 'state': 'draft', 'currency_id': _get_currency, 'journal_id': lambda self, cr, uid, c: c.get('journal_id', False), 'period_id': lambda self, cr, uid, c: c.get('period_id', False), 'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'account.move.line', context=c) } - _order = "date desc,id desc" + _order = "date desc, id desc" _sql_constraints = [ ('credit_debit1', 'CHECK (credit*debit=0)', 'Wrong credit or debit value in accounting entry !'), ('credit_debit2', 'CHECK (credit+debit>=0)', 'Wrong credit or debit value in accounting entry !'), @@ -1033,10 +1034,11 @@ class account_move_line(osv.osv): def write(self, cr, uid, ids, vals, context=None, check=True, update_check=True): if context is None: context={} + move_obj = self.pool.get('account.move') + account_obj = self.pool.get('account.account') if vals.get('account_tax_id', False): raise osv.except_osv(_('Unable to change tax !'), _('You can not change the tax, you should remove and recreate lines !')) self._check_date(cr, uid, vals, context, check) - account_obj = self.pool.get('account.account') if ('account_id' in vals) and not account_obj.read(cr, uid, vals['account_id'], ['active'])['active']: raise osv.except_osv(_('Bad account!'), _('You can not use an inactive account!')) if update_check: @@ -1072,9 +1074,9 @@ class account_move_line(osv.osv): for line in self.browse(cr, uid, ids): if line.move_id.id not in done: done.append(line.move_id.id) - self.pool.get('account.move').validate(cr, uid, [line.move_id.id], context) + move_obj.validate(cr, uid, [line.move_id.id], context) if todo_date: - self.pool.get('account.move').write(cr, uid, [line.move_id.id], {'date': todo_date}, context=context) + move_obj.write(cr, uid, [line.move_id.id], {'date': todo_date}, context=context) return result def _update_journal_check(self, cr, uid, journal_id, period_id, context={}): @@ -1108,7 +1110,9 @@ class account_move_line(osv.osv): def create(self, cr, uid, vals, context=None, check=True): account_obj = self.pool.get('account.account') - tax_obj=self.pool.get('account.tax') + tax_obj = self.pool.get('account.tax') + move_obj = self.pool.get('account.move') + cur_obj = self.pool.get('res.currency') if context is None: context = {} self._check_date(cr, uid, vals, context, check) @@ -1119,7 +1123,7 @@ class account_move_line(osv.osv): if 'period_id' in vals: context['period_id'] = vals['period_id'] if ('journal_id' not in context) and ('move_id' in vals) and vals['move_id']: - m = self.pool.get('account.move').browse(cr, uid, vals['move_id']) + m = move_obj.browse(cr, uid, vals['move_id']) context['journal_id'] = m.journal_id.id context['period_id'] = m.period_id.id @@ -1142,7 +1146,7 @@ class account_move_line(osv.osv): 'period_id': context['period_id'], 'journal_id': context['journal_id'] } - move_id = self.pool.get('account.move').create(cr, uid, v, context) + move_id = move_obj.create(cr, uid, v, context) vals['move_id'] = move_id else: raise osv.except_osv(_('No piece number !'), _('Can not create an automatic sequence for this piece !\n\nPut a sequence in the journal definition for automatic numbering or create a sequence manually for this piece.')) @@ -1167,7 +1171,6 @@ class account_move_line(osv.osv): # the provided values were not already multi-currency if account.currency_id and 'amount_currency' not in vals and account.currency_id.id != account.company_id.currency_id.id: vals['currency_id'] = account.currency_id.id - cur_obj = self.pool.get('res.currency') ctx = {} if 'date' in vals: ctx['date'] = vals['date'] @@ -1189,9 +1192,10 @@ class account_move_line(osv.osv): 'journal_id': journal.analytic_journal_id.id, 'ref': vals.get('ref', False), 'user_id': uid - })] + })] + + result = super(osv.osv, self).create(cr, uid, vals, context=context) - result = super(osv.osv, self).create(cr, uid, vals, context) # CREATE Taxes if vals.get('account_tax_id', False): tax_id = tax_obj.browse(cr, uid, vals['account_tax_id']) @@ -1263,7 +1267,7 @@ class account_move_line(osv.osv): if journal.entry_posted and tmp: self.pool.get('account.move').button_validate(cr,uid, [vals['move_id']],context) return result + account_move_line() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file From af37d56800322a5fd3ac55e28df68d863e465cc8 Mon Sep 17 00:00:00 2001 From: vra Date: Fri, 15 Oct 2010 12:39:29 +0530 Subject: [PATCH 031/116] [REF]hr_payroll: code cleaning. bzr revid: vra@tinyerp.com-20101015070929-k7p1wvy3fl2az1s3 --- .../report/report_emp_salary_structure.py | 1 - .../report/report_payroll_register.py | 1 - addons/hr_payroll/report/report_payslip.py | 1 - .../hr_payroll/report/report_year_salary.py | 3 -- addons/hr_payroll/report/rml_parse.py | 38 ++----------------- 5 files changed, 4 insertions(+), 40 deletions(-) diff --git a/addons/hr_payroll/report/report_emp_salary_structure.py b/addons/hr_payroll/report/report_emp_salary_structure.py index 5c1fccd8cad..6d22ab2a2a2 100644 --- a/addons/hr_payroll/report/report_emp_salary_structure.py +++ b/addons/hr_payroll/report/report_emp_salary_structure.py @@ -24,7 +24,6 @@ import time from report import report_sxw -from tools import amount_to_text_en class salary_structure_report(report_sxw.rml_parse): diff --git a/addons/hr_payroll/report/report_payroll_register.py b/addons/hr_payroll/report/report_payroll_register.py index df8d0c50fad..7ec759cef0a 100644 --- a/addons/hr_payroll/report/report_payroll_register.py +++ b/addons/hr_payroll/report/report_payroll_register.py @@ -1,7 +1,6 @@ import time from datetime import datetime from report import report_sxw -from tools import amount_to_text_en class report_payroll_register(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): diff --git a/addons/hr_payroll/report/report_payslip.py b/addons/hr_payroll/report/report_payslip.py index 9b77a790d66..3ce90114eb3 100755 --- a/addons/hr_payroll/report/report_payslip.py +++ b/addons/hr_payroll/report/report_payslip.py @@ -22,7 +22,6 @@ # ############################################################################## -import time from datetime import datetime from report import report_sxw from tools import amount_to_text_en diff --git a/addons/hr_payroll/report/report_year_salary.py b/addons/hr_payroll/report/report_year_salary.py index 08416db3d5a..f8867f04954 100755 --- a/addons/hr_payroll/report/report_year_salary.py +++ b/addons/hr_payroll/report/report_year_salary.py @@ -1,5 +1,3 @@ -import time -import locale import datetime from report import report_sxw import time @@ -51,7 +49,6 @@ class year_salary_report(rml_parse.rml_parse): def get_employee(self,form): ls1=[] ls = [] - periods = [] tol_mnths=['Total',0,0,0,0,0,0,0,0,0,0,0,0] emp = pooler.get_pool(self.cr.dbname).get('hr.employee') emp_ids = form['employee_ids'] diff --git a/addons/hr_payroll/report/rml_parse.py b/addons/hr_payroll/report/rml_parse.py index 45bff3386b5..b4576f600fe 100755 --- a/addons/hr_payroll/report/rml_parse.py +++ b/addons/hr_payroll/report/rml_parse.py @@ -20,16 +20,10 @@ # ############################################################################## from report import report_sxw -import xml.dom.minidom -import os, time -import osv -import re -import tools -import pooler import re import sys from lxml import etree - +from time import strptime class rml_parse(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): @@ -56,12 +50,14 @@ class rml_parse(report_sxw.rml_parse): return new else: return self.comma_me(new) + def _ellipsis(self, string, maxlen=100, ellipsis = '...'): ellipsis = ellipsis or '' try: return string[:maxlen - len(ellipsis) ] + (ellipsis, '')[len(string) < maxlen] - except Exception, e: + except Exception: return False + def _strip_name(self, name, maxlen=50): return self._ellipsis(name, maxlen, '...') @@ -106,20 +102,9 @@ class rml_parse(report_sxw.rml_parse): return Stringer return Stringer - def explode_this(self,chaine,length): - chaine = rstrip(chaine) - ast = list(chaine) - i = length - while i <= len(ast): - ast.insert(i,'\n') - i = i + length - chaine = str("".join(ast)) - return chaine - def repair_string(self,chaine): ast = list(chaine) UnicodeAst = [] - _previouslyfound = False i = 0 while i < len(ast): elem = ast[i] @@ -136,21 +121,6 @@ class rml_parse(report_sxw.rml_parse): i += i + 1 return "".join(UnicodeAst) - def ReencodeAscii(self,str): - print sys.stdin.encoding - try: - Stringer = str.decode("ascii") - except UnicodeEncodeError: - print "REENCODING ERROR" - return str.encode("ascii") - except UnicodeDecodeError: - print "DECODING ERROR" - return str.encode("ascii") - - else: - print Stringer - return Stringer - def _add_header(self, node, header='external'): if header=='internal': rml_head = self.rml_header2 From d39cd7296c11983d146a9f1a26cc0589b5965a06 Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Fri, 15 Oct 2010 12:44:33 +0530 Subject: [PATCH 032/116] [REF] cleaing account... bzr revid: mra@mra-laptop-20101015071433-p5vxtfo1b0ms4xu7 --- addons/account/partner.py | 11 +++++++---- addons/account/product.py | 4 ++-- addons/account/project/project.py | 9 +++++---- addons/account/sequence.py | 3 ++- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/addons/account/partner.py b/addons/account/partner.py index 6b88f759c21..fb5af0353a5 100644 --- a/addons/account/partner.py +++ b/addons/account/partner.py @@ -18,6 +18,7 @@ # along with this program. If not, see . # ############################################################################## + from operator import itemgetter from osv import fields, osv @@ -58,8 +59,8 @@ class account_fiscal_position(osv.osv): account_id = pos.account_dest_id.id break return account_id -account_fiscal_position() +account_fiscal_position() class account_fiscal_position_tax(osv.osv): _name = 'account.fiscal.position.tax' @@ -70,8 +71,8 @@ class account_fiscal_position_tax(osv.osv): 'tax_src_id': fields.many2one('account.tax', 'Tax Source', required=True), 'tax_dest_id': fields.many2one('account.tax', 'Replacement Tax') } -account_fiscal_position_tax() +account_fiscal_position_tax() class account_fiscal_position_account(osv.osv): _name = 'account.fiscal.position.account' @@ -82,6 +83,7 @@ class account_fiscal_position_account(osv.osv): 'account_src_id': fields.many2one('account.account', 'Account Source', domain=[('type','<>','view')], required=True), 'account_dest_id': fields.many2one('account.account', 'Account Destination', domain=[('type','<>','view')], required=True) } + account_fiscal_position_account() class res_partner(osv.osv): @@ -89,7 +91,7 @@ class res_partner(osv.osv): _inherit = 'res.partner' _description = 'Partner' - def _credit_debit_get(self, cr, uid, ids, field_names, arg, context): + def _credit_debit_get(self, cr, uid, ids, field_names, arg, context=None): query = self.pool.get('account.move.line')._query_get(cr, uid, context=context) cr.execute("""SELECT l.partner_id, a.type, SUM(l.debit-l.credit) FROM account_move_line l @@ -184,6 +186,7 @@ class res_partner(osv.osv): 'Companies that refers to partner'), 'last_reconciliation_date': fields.datetime('Latest Reconciliation Date', help='Date on which the partner accounting entries were reconciled last time') } + res_partner() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/account/product.py b/addons/account/product.py index 56e721dcb06..b8af27b03e5 100644 --- a/addons/account/product.py +++ b/addons/account/product.py @@ -19,8 +19,6 @@ # ############################################################################## -import time -import netsvc from osv import fields, osv class product_category(osv.osv): @@ -75,5 +73,7 @@ class product_template(osv.osv): view_load=True, help="This account will be used for invoices instead of the default one to value expenses for the current product"), } + product_template() +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/project/project.py b/addons/account/project/project.py index c5c0d223bef..ee142903c87 100644 --- a/addons/account/project/project.py +++ b/addons/account/project/project.py @@ -33,10 +33,11 @@ class account_analytic_journal(osv.osv): 'company_id': fields.many2one('res.company', 'Company', required=True), } _defaults = { - 'active': lambda *a: True, - 'type': lambda *a: 'general', + 'active': True, + 'type': 'general', 'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id, } + account_analytic_journal() class account_journal(osv.osv): @@ -45,7 +46,7 @@ class account_journal(osv.osv): _columns = { 'analytic_journal_id':fields.many2one('account.analytic.journal','Analytic Journal',help="Journal for analytic entries"), } + account_journal() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/account/sequence.py b/addons/account/sequence.py index 52c1f5df8c4..1683e5feb06 100644 --- a/addons/account/sequence.py +++ b/addons/account/sequence.py @@ -62,6 +62,7 @@ class ir_sequence(osv.osv): context=context) return super(ir_sequence, self).get_id(cr, uid, sequence_id, test, context=context) + ir_sequence() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file From e73f4cf8609da0e83e9b34987a6192792909dbb2 Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Fri, 15 Oct 2010 12:49:39 +0530 Subject: [PATCH 033/116] [REF] bzr revid: mra@mra-laptop-20101015071939-452zm2j4s2zw1llt --- addons/account/report/account_report.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/addons/account/report/account_report.py b/addons/account/report/account_report.py index dd0ec133598..a85d25efe5a 100644 --- a/addons/account/report/account_report.py +++ b/addons/account/report/account_report.py @@ -22,11 +22,11 @@ import time from datetime import datetime from dateutil.relativedelta import relativedelta + import pooler import tools from osv import fields,osv - def _code_get(self, cr, uid, context={}): acc_type_obj = self.pool.get('account.account.type') ids = acc_type_obj.search(cr, uid, []) @@ -283,5 +283,4 @@ class report_account_sales(osv.osv): )""") report_account_sales() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file From 379e6c75c03c4684597478bde53ba5dd6806d8c4 Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Fri, 15 Oct 2010 12:55:07 +0530 Subject: [PATCH 034/116] [REF] account budget bzr revid: mra@mra-laptop-20101015072507-ye320fvm1hwjpf0j --- addons/account_budget/account_budget_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account_budget/account_budget_view.xml b/addons/account_budget/account_budget_view.xml index d98a487b13c..3faf30299c4 100644 --- a/addons/account_budget/account_budget_view.xml +++ b/addons/account_budget/account_budget_view.xml @@ -185,7 +185,7 @@ - Budget + Budgets crossovered.budget form tree,form From 3cfb9ca9ccf96b8cb76a92203c2943720a1b82bc Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Fri, 15 Oct 2010 13:05:42 +0530 Subject: [PATCH 035/116] [REF] account bzr revid: mra@mra-laptop-20101015073542-pzmc0rz8d0qfcum2 --- addons/account/account_bank_statement.py | 1 - addons/account/account_cash_statement.py | 37 ++++++++++-------------- 2 files changed, 16 insertions(+), 22 deletions(-) diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py index 0b240663943..1ac7fce0037 100644 --- a/addons/account/account_bank_statement.py +++ b/addons/account/account_bank_statement.py @@ -86,7 +86,6 @@ class account_bank_statement(osv.osv): def _end_balance(self, cursor, user, ids, name, attr, context=None): res_currency_obj = self.pool.get('res.currency') res_users_obj = self.pool.get('res.users') - res = {} company_currency_id = res_users_obj.browse(cursor, user, user, diff --git a/addons/account/account_cash_statement.py b/addons/account/account_cash_statement.py index 6431454b715..f88d38734f2 100644 --- a/addons/account/account_cash_statement.py +++ b/addons/account/account_cash_statement.py @@ -19,6 +19,7 @@ # along with this program. If not, see . # ############################################################################## + import time from osv import osv, fields @@ -45,13 +46,13 @@ class account_cashbox_line(osv.osv): res[obj.id] = obj.pieces * obj.number return res - def on_change_sub(self, cr, uid, ids, pieces, number,*a): + def on_change_sub(self, cr, uid, ids, pieces, number, *a): """ Calculates Sub total on change of number @param pieces: Names of fields. @param number: """ - sub=pieces*number + sub = pieces * number return {'value':{'subtotal': sub or 0.0}} _columns = { @@ -61,6 +62,7 @@ class account_cashbox_line(osv.osv): 'starting_id': fields.many2one('account.bank.statement',ondelete='cascade'), 'ending_id': fields.many2one('account.bank.statement',ondelete='cascade'), } + account_cashbox_line() class account_cash_statement(osv.osv): @@ -74,7 +76,7 @@ class account_cash_statement(osv.osv): @param arg: User defined arguments @return: Dictionary of values. """ - res ={} + res = {} for statement in self.browse(cr, uid, ids): amount_total = 0.0 @@ -96,10 +98,10 @@ class account_cash_statement(osv.osv): """ res ={} for statement in self.browse(cr, uid, ids): - amount_total=0.0 + amount_total = 0.0 for line in statement.ending_details_ids: - amount_total+= line.pieces * line.number - res[statement.id]=amount_total + amount_total += line.pieces * line.number + res[statement.id] = amount_total return res def _get_sum_entry_encoding(self, cr, uid, ids, name, arg, context=None): @@ -113,14 +115,13 @@ class account_cash_statement(osv.osv): for statement in self.browse(cr, uid, ids): encoding_total=0.0 for line in statement.line_ids: - encoding_total+= line.amount - res2[statement.id]=encoding_total + encoding_total += line.amount + res2[statement.id] = encoding_total return res2 def _end_balance(self, cursor, user, ids, name, attr, context=None): res_currency_obj = self.pool.get('res.currency') res_users_obj = self.pool.get('res.users') - res = {} company_currency_id = res_users_obj.browse(cursor, user, user, @@ -232,8 +233,8 @@ class account_cash_statement(osv.osv): 'user_id':fields.many2one('res.users', 'Responsible', required=False), } _defaults = { - 'state': lambda *a: 'draft', - 'date': lambda *a:time.strftime("%Y-%m-%d %H:%M:%S"), + 'state': 'draft', + 'date': time.strftime("%Y-%m-%d %H:%M:%S"), 'user_id': lambda self, cr, uid, context=None: uid, 'starting_details_ids':_get_cash_open_box_lines, 'ending_details_ids':_get_default_cash_close_box_lines @@ -295,10 +296,8 @@ class account_cash_statement(osv.osv): @param journal_id: Changed journal_id @return: Dictionary of changed values """ - cash_pool = self.pool.get('account.cashbox.line') statement_pool = self.pool.get('account.bank.statement') - res = {} balance_start = 0.0 @@ -307,8 +306,7 @@ class account_cash_statement(osv.osv): 'balance_start': balance_start }) return res - res = super(account_cash_statement, self).onchange_journal_id(cr, uid, statement_id, journal_id, context=context) - return res + return super(account_cash_statement, self).onchange_journal_id(cr, uid, statement_id, journal_id, context=context) def _equal_balance(self, cr, uid, cash_id, context=None): statement = self.browse(cr, uid, cash_id, context=context) @@ -329,7 +327,6 @@ class account_cash_statement(osv.osv): """ cash_pool = self.pool.get('account.cashbox.line') statement_pool = self.pool.get('account.bank.statement') - statement = statement_pool.browse(cr, uid, ids[0]) vals = {} @@ -347,9 +344,7 @@ class account_cash_statement(osv.osv): 'state':'open', }) - - self.write(cr, uid, ids, vals) - return True + return self.write(cr, uid, ids, vals) def balance_check(self, cr, uid, cash_id, journal_type='bank', context=None): if journal_type == 'bank': @@ -363,7 +358,7 @@ class account_cash_statement(osv.osv): return super(account_cash_statement, self).statement_close(cr, uid, ids, journal_type, context) vals = { 'state':'confirm', - 'closing_date':time.strftime("%Y-%m-%d %H:%M:%S") + 'closing_date': time.strftime("%Y-%m-%d %H:%M:%S") } return self.write(cr, uid, ids, vals, context=context) @@ -386,4 +381,4 @@ class account_cash_statement(osv.osv): account_cash_statement() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file From 0963e97c52e1867fc3366f29da0387b821cbc101 Mon Sep 17 00:00:00 2001 From: pso Date: Fri, 15 Oct 2010 13:35:33 +0530 Subject: [PATCH 036/116] [IMP] account: Assigned group to menus and improved access rights bzr revid: pso@tinyerp.com-20101015080533-hcg57qhtk3cduif3 --- addons/account/account_end_fy.xml | 2 +- addons/account/account_menuitem.xml | 16 ++++++++-------- addons/account/account_report.xml | 2 +- addons/account/account_view.xml | 16 ++++++++-------- addons/account/project/project_view.xml | 10 +++++----- .../wizard/account_analytic_chart_view.xml | 2 +- .../account_analytic_entries_report_view.xml | 2 +- addons/account/security/ir.model.access.csv | 10 +++++----- .../wizard/account_automatic_reconcile_view.xml | 2 +- .../wizard/account_report_balance_sheet_view.xml | 2 +- .../account_report_general_ledger_view.xml | 2 +- .../account_report_partner_ledger_view.xml | 2 +- addons/account/wizard/account_tax_chart_view.xml | 2 +- 13 files changed, 35 insertions(+), 35 deletions(-) diff --git a/addons/account/account_end_fy.xml b/addons/account/account_end_fy.xml index 76d40bc89dc..d0c966898d6 100644 --- a/addons/account/account_end_fy.xml +++ b/addons/account/account_end_fy.xml @@ -14,7 +14,7 @@ action="action_account_period_tree" id="menu_action_account_period_close_tree" parent="account.menu_account_end_year_treatments" - sequence="0" groups="base.group_extended"/> + sequence="0" groups="base.group_extended,group_account_manager,group_account_user"/> diff --git a/addons/account/account_menuitem.xml b/addons/account/account_menuitem.xml index dde71f4efc1..77b49a36b8f 100644 --- a/addons/account/account_menuitem.xml +++ b/addons/account/account_menuitem.xml @@ -7,8 +7,8 @@ - + groups="group_account_user,group_account_manager"/> + @@ -21,16 +21,16 @@ - + - + - - + + - + @@ -43,7 +43,7 @@ diff --git a/addons/account/account_report.xml b/addons/account/account_report.xml index c9f7cc6cf66..6090fe6fbc9 100644 --- a/addons/account/account_report.xml +++ b/addons/account/account_report.xml @@ -45,7 +45,7 @@ tree,form - + @@ -1442,7 +1442,7 @@ action="action_move_journal_line" id="menu_action_move_journal_line_form" parent="account.menu_finance_entries" - groups="group_account_user" + groups="group_account_user,group_account_manager" sequence="5"/> @@ -1709,7 +1709,7 @@ + parent="account.menu_configuration_misc" groups="base.group_extended,group_account_manager"/> + + + mrp.workorder.tree + mrp.workorder + tree + + + + + + + + + + + + + + + + + + + + + mrp.workorder.graph + mrp.workorder + graph + + + + + + + + + + mrp.workorder.select + mrp.workorder + search + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Work Order + mrp.workorder + form + graph,tree + + + {'search_default_Workcenter': 1,'search_default_month':1,'group_by_no_leaf':1,'group_by':[]} + + + + + tree + + + + + + + graph + + + + + + + + diff --git a/addons/mrp_operations/security/ir.model.access.csv b/addons/mrp_operations/security/ir.model.access.csv index f0ee723292f..c27d8fd66e5 100755 --- a/addons/mrp_operations/security/ir.model.access.csv +++ b/addons/mrp_operations/security/ir.model.access.csv @@ -7,3 +7,4 @@ "access_mrp_production_manager","mrp_production_manager","model_mrp_production","mrp.group_mrp_manager",1,0,0,0 "access_mrp_production_workcenter_line","mrp.production.workcenter.line","mrp.model_mrp_production_workcenter_line","mrp.group_mrp_user",1,1,1,1 "access_mrp_production_workcenter_line_manager","mrp.production.workcenter.line.manager","mrp.model_mrp_production_workcenter_line","mrp.group_mrp_manager",1,0,0,0 +"access_mrp_workorder_manager","mrp.workorder.manager","model_mrp_workorder","mrp.group_mrp_manager",1,1,1,1 From b94c27993cde5af545e73aab859e526104e3bdbd Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Fri, 15 Oct 2010 15:57:00 +0530 Subject: [PATCH 045/116] [REF] sale bzr revid: mra@mra-laptop-20101015102700-d45i9oimk2khcek9 --- addons/sale/sale.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/sale/sale.py b/addons/sale/sale.py index baf0b194d62..2b87fa3dc50 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -478,7 +478,7 @@ class sale_order(osv.osv): result = mod_obj._get_id(cr, uid, 'account', 'invoice_form') res = mod_obj.read(cr, uid, result, ['res_id']) result = { - 'name': 'Invoices', + 'name': 'Customer Invoices', 'view_type': 'form', 'view_mode': 'form', 'view_id': [res['res_id']], @@ -489,7 +489,6 @@ class sale_order(osv.osv): 'target': 'new', 'res_id': inv_ids and inv_ids[0] or False, } - return result def action_invoice_create(self, cr, uid, ids, grouped=False, states=['confirmed', 'done', 'exception'], date_inv = False, context=None): From c1217dcfb08acf2f8dc78301e6888f78f0db95ba Mon Sep 17 00:00:00 2001 From: "uco (OpenERP)" Date: Fri, 15 Oct 2010 16:20:24 +0530 Subject: [PATCH 046/116] [IMP,FIX] mrp: Fixed required field error on Workcenter. Improved search view. bzr revid: uco@tinyerp.com-20101015105024-a21zcfjx1omtv2ko --- addons/mrp/mrp_view.xml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml index b27399d2b84..69b7e6f27a2 100644 --- a/addons/mrp/mrp_view.xml +++ b/addons/mrp/mrp_view.xml @@ -128,7 +128,6 @@ - @@ -184,14 +183,14 @@ + + - - From 300f2ac79c5b87af364e5ecaeda6edd149b43e6e Mon Sep 17 00:00:00 2001 From: "ARA (OpenERP)" Date: Fri, 15 Oct 2010 16:27:57 +0530 Subject: [PATCH 047/116] [IMP] account,payment,auction,base_setup,hr_payroll,l10n_ch,mrp,report_intrastate:currency code replace with currency symbol bzr revid: ara@tinyerp.com-20101015105757-d3ta729on08q3czm --- addons/account/report/account_central_journal.py | 6 +++--- addons/account/report/account_general_journal.py | 6 +++--- addons/account/report/account_journal.py | 2 +- addons/account_payment/report/payment_order.py | 2 +- addons/auction/report/buyer_list.rml | 4 ++-- addons/base_setup/todo.py | 4 ++-- addons/hr_payroll/report/payslip.rml | 6 +++--- .../hr_payroll/report/report_payroll_advice.rml | 2 +- addons/l10n_ch/report/bvr_invoice_report.rml | 8 ++++---- addons/l10n_ch/wizard/create_dta.py | 2 +- addons/mrp/report/price.py | 12 ++++++------ addons/report_intrastat/report/invoice.rml | 16 ++++++++-------- 12 files changed, 35 insertions(+), 35 deletions(-) diff --git a/addons/account/report/account_central_journal.py b/addons/account/report/account_central_journal.py index 4e28e2d5140..6ab5b38d03d 100644 --- a/addons/account/report/account_central_journal.py +++ b/addons/account/report/account_central_journal.py @@ -72,15 +72,15 @@ class journal_print(report_sxw.rml_parse, common_report_header): if self.target_move == 'posted': move_state = ['posted'] - self.cr.execute('SELECT a.currency_id, a.code, a.name, c.code AS currency_code, l.currency_id, l.amount_currency, SUM(debit) AS debit, SUM(credit) AS credit \ + self.cr.execute('SELECT a.currency_id, a.code, a.name, c.symbol AS currency_code, l.currency_id, l.amount_currency, SUM(debit) AS debit, SUM(credit) AS credit \ from account_move_line l \ LEFT JOIN account_move am ON (l.move_id=am.id) \ LEFT JOIN account_account a ON (l.account_id=a.id) \ - LEFT JOIN res_currency c on (l.currency_id=c.id) WHERE am.state IN %s AND l.period_id=%s AND l.journal_id=%s '+self.query_get_clause+' GROUP BY a.id, a.code, a.name,l.amount_currency,c.code, a.currency_id,l.currency_id', (tuple(move_state), period_id, journal_id)) + LEFT JOIN res_currency c on (l.currency_id=c.id) WHERE am.state IN %s AND l.period_id=%s AND l.journal_id=%s '+self.query_get_clause+' GROUP BY a.id, a.code, a.name,l.amount_currency,c.symbol, a.currency_id,l.currency_id', (tuple(move_state), period_id, journal_id)) return self.cr.dictfetchall() def _set_get_account_currency_code(self, account_id): - self.cr.execute("SELECT c.code as code "\ + self.cr.execute("SELECT c.symbol as code "\ "FROM res_currency c,account_account as ac "\ "WHERE ac.id = %s AND ac.currency_id = c.id"%(account_id)) result = self.cr.fetchone() diff --git a/addons/account/report/account_general_journal.py b/addons/account/report/account_general_journal.py index 843bedaaf63..4a20ac9ebc4 100644 --- a/addons/account/report/account_general_journal.py +++ b/addons/account/report/account_general_journal.py @@ -87,19 +87,19 @@ class journal_print(report_sxw.rml_parse, common_report_header): move_state = ['draft','posted'] if self.target_move == 'posted': move_state = ['posted'] - self.cr.execute('SELECT j.code, j.name, l.amount_currency,c.code AS currency_code,l.currency_id, ' + self.cr.execute('SELECT j.code, j.name, l.amount_currency,c.symbol AS currency_code,l.currency_id, ' 'SUM(l.debit) AS debit, SUM(l.credit) AS credit ' 'FROM account_move_line l ' 'LEFT JOIN account_move am ON (l.move_id=am.id) ' 'LEFT JOIN account_journal j ON (l.journal_id=j.id) ' 'LEFT JOIN res_currency c on (l.currency_id=c.id)' 'WHERE am.state IN %s AND l.period_id=%s AND l.journal_id IN %s ' + self.query_get_clause + ' ' - 'GROUP BY j.id, j.code, j.name, l.amount_currency, c.code, l.currency_id ', + 'GROUP BY j.id, j.code, j.name, l.amount_currency, c.symbol, l.currency_id ', (tuple(move_state), period_id, tuple(self.journal_ids))) return self.cr.dictfetchall() def _set_get_account_currency_code(self, account_id): - self.cr.execute("SELECT c.code AS code "\ + self.cr.execute("SELECT c.symbol AS code "\ "FROM res_currency c, account_account AS ac "\ "WHERE ac.id = %s AND ac.currency_id = c.id" % (account_id)) result = self.cr.fetchone() diff --git a/addons/account/report/account_journal.py b/addons/account/report/account_journal.py index ab7b6211064..a53da3fc08e 100644 --- a/addons/account/report/account_journal.py +++ b/addons/account/report/account_journal.py @@ -126,7 +126,7 @@ class journal_print(report_sxw.rml_parse, common_report_header): return obj_mline.browse(self.cr, self.uid, ids) def _set_get_account_currency_code(self, account_id): - self.cr.execute("SELECT c.code AS code "\ + self.cr.execute("SELECT c.symbol AS code "\ "FROM res_currency c,account_account AS ac "\ "WHERE ac.id = %s AND ac.currency_id = c.id" % (account_id)) result = self.cr.fetchone() diff --git a/addons/account_payment/report/payment_order.py b/addons/account_payment/report/payment_order.py index e0b0713c614..f0f6030b0f3 100644 --- a/addons/account_payment/report/payment_order.py +++ b/addons/account_payment/report/payment_order.py @@ -70,7 +70,7 @@ class payment_order(report_sxw.rml_parse): def _get_company_currency(self): pool = pooler.get_pool(self.cr.dbname) user = pool.get('res.users').browse(self.cr, self.uid, self.uid) - return user.company_id and user.company_id.currency_id and user.company_id.currency_id.code or False + return user.company_id and user.company_id.currency_id and user.company_id.currency_id.symbol or False def _get_company_currency_symbol(self): pool = pooler.get_pool(self.cr.dbname) diff --git a/addons/auction/report/buyer_list.rml b/addons/auction/report/buyer_list.rml index 4ac6e6694e1..c5e9ef9ca7b 100644 --- a/addons/auction/report/buyer_list.rml +++ b/addons/auction/report/buyer_list.rml @@ -75,13 +75,13 @@ Lot - Adj.([[ company.currency_id.code ]]) + Adj.([[ company.currency_id.symbol ]]) Buyer costs([[ o['amount' ]*100 ]]%) - To pay ([[ company.currency_id.code ]]) + To pay ([[ company.currency_id.symbol ]]) diff --git a/addons/base_setup/todo.py b/addons/base_setup/todo.py index ae16f260876..8f16a491bc7 100644 --- a/addons/base_setup/todo.py +++ b/addons/base_setup/todo.py @@ -164,8 +164,8 @@ class res_currency(osv.osv): return [] if isinstance(ids, (int, long)): ids = [ids] - reads = self.read(cr, uid, ids, ['name','code'], context, load='_classic_write') - return [(x['id'], tools.ustr(x['name']) + ' (' + tools.ustr(x['code']) + ')') for x in reads] + reads = self.read(cr, uid, ids, ['name','symbol'], context, load='_classic_write') + return [(x['id'], tools.ustr(x['name']) + ' (' + tools.ustr(x['symbol']) + ')') for x in reads] res_currency() diff --git a/addons/hr_payroll/report/payslip.rml b/addons/hr_payroll/report/payslip.rml index cdbbe6bd5f4..18a2bc7230c 100755 --- a/addons/hr_payroll/report/payslip.rml +++ b/addons/hr_payroll/report/payslip.rml @@ -505,13 +505,13 @@ - Total Earnings([[ o.company_id and o.company_id.currency_id.code or '' ]]) + Total Earnings([[ o.company_id and o.company_id.currency_id.symbol or '' ]]) [[ formatLang(o.allounce + o.basic) ]] [[ o.company_id and o.company_id.currency_id.symbol ]] - Total Deductions([[ o.company_id and o.company_id.currency_id.code or '' ]]) + Total Deductions([[ o.company_id and o.company_id.currency_id.symbol or '' ]]) [[ formatLang(o.deduction) ]] [[ o.company_id and o.company_id.currency_id.symbol or '' ]] @@ -558,7 +558,7 @@ - Net Amount([[ o.company_id and o.company_id.currency_id.code or '' ]]) + Net Amount([[ o.company_id and o.company_id.currency_id.symbol or '' ]]) [[ formatLang(o.net) ]] [[ o.company_id and o.company_id.currency_id.symbol or '' ]] diff --git a/addons/hr_payroll/report/report_payroll_advice.rml b/addons/hr_payroll/report/report_payroll_advice.rml index 8fe18772c2f..c879a362228 100644 --- a/addons/hr_payroll/report/report_payroll_advice.rml +++ b/addons/hr_payroll/report/report_payroll_advice.rml @@ -257,7 +257,7 @@ - Total([[ company.currency_id.code ]]): + Total([[ company.currency_id.symbol ]]): [[ formatLang(get_total()) ]] [[ company.currency_id.symbol ]] diff --git a/addons/l10n_ch/report/bvr_invoice_report.rml b/addons/l10n_ch/report/bvr_invoice_report.rml index 46798ae7da4..ee69eedee2e 100755 --- a/addons/l10n_ch/report/bvr_invoice_report.rml +++ b/addons/l10n_ch/report/bvr_invoice_report.rml @@ -241,7 +241,7 @@ [[ round(l.discount) ]] - [[ comma_me(l.price_subtotal) ]] [[o.currency_id.code ]] + [[ comma_me(l.price_subtotal) ]] [[o.currency_id.symbol ]] @@ -293,7 +293,7 @@ Total (excl. taxes): - [[ comma_me(o.amount_untaxed) ]] [[o.currency_id.code ]] + [[ comma_me(o.amount_untaxed) ]] [[o.currency_id.symbol ]] @@ -301,7 +301,7 @@ Taxes: - [[ comma_me(o.amount_tax) ]] [[o.currency_id.code ]] + [[ comma_me(o.amount_tax) ]] [[o.currency_id.symbol ]] @@ -309,7 +309,7 @@ Total (incl. taxes): - [[ comma_me(o.amount_total) ]] [[o.currency_id.code ]] + [[ comma_me(o.amount_total) ]] [[o.currency_id.symbol ]] diff --git a/addons/l10n_ch/wizard/create_dta.py b/addons/l10n_ch/wizard/create_dta.py index d3e2856387d..5de49008ae2 100644 --- a/addons/l10n_ch/wizard/create_dta.py +++ b/addons/l10n_ch/wizard/create_dta.py @@ -405,7 +405,7 @@ def _create_dta(obj, cr, uid, data, context=None): v['sequence'] = str(seq).rjust(5).replace(' ', '0') v['amount_to_pay']= str(pline.amount_currency).replace('.', ',') v['number'] = pline.name - v['currency'] = pline.currency.code + v['currency'] = pline.currency.symbol v['partner_bank_name'] = pline.bank_id.bank.name or False v['partner_bank_clearing'] = pline.bank_id.bank.clearing or False diff --git a/addons/mrp/report/price.py b/addons/mrp/report/price.py index 52bcf3bcd4a..53271ef68fc 100644 --- a/addons/mrp/report/price.py +++ b/addons/mrp/report/price.py @@ -120,7 +120,7 @@ class report_custom(report_rml): %s - """ % (_('Work Center name'), _('Cycles Cost')+'('+company_currency.code+')', _('Hourly Cost')+'('+company_currency.code+')',_('Work Cost')+'('+company_currency.code+')') + """ % (_('Work Center name'), _('Cycles Cost')+'('+company_currency.symbol+')', _('Hourly Cost')+'('+company_currency.symbol+')',_('Work Cost')+'('+company_currency.symbol+')') prod_header = """ %s @@ -129,7 +129,7 @@ class report_custom(report_rml): %s %s - """ % (_('Component'), _('Component suppliers'), _('Quantity'),_('Cost Price per Uom')+'('+company_currency.code+')', _('Supplier Price per Uom')+'('+company_currency.code+')') + """ % (_('Component'), _('Component suppliers'), _('Quantity'),_('Cost Price per Uom')+'('+company_currency.symbol+')', _('Supplier Price per Uom')+'('+company_currency.symbol+')') purchase_price_digits = rml_obj.get_digits(dp='Purchase Price') @@ -149,7 +149,7 @@ class report_custom(report_rml): - """ xml += """ - """ + _('Total Cost ') + _('of ') + str(number) +' '+ product.uom_id.name +'('+company_currency.code+')'+ """: + """ + _('Total Cost ') + _('of ') + str(number) +' '+ product.uom_id.name +'('+company_currency.symbol+')'+ """: """+ rml_obj.formatLang(total_strd, digits=purchase_price_digits) +' '+ company_currency.symbol + """ @@ -176,7 +176,7 @@ class report_custom(report_rml): xml += "" + xml_tmp + '' xml += """ - """ + _('Cost ') + _('of ') + str(number) +' '+ product.uom_id.name +'(' + company_currency.code +')'+ """: + """ + _('Cost ') + _('of ') + str(number) +' '+ product.uom_id.name +'(' + company_currency.symbol +')'+ """: """+ rml_obj.formatLang(total_strd, digits=purchase_price_digits) +' '+ company_currency.symbol + """ @@ -193,14 +193,14 @@ class report_custom(report_rml): xml += workcenter_header xml += "" + xml_tmp + '' xml += """ - """ + _('Work Cost ') + _('of ') + str(number) +' '+ product.uom_id.name +'('+company_currency.code+')'+""": + """ + _('Work Cost ') + _('of ') + str(number) +' '+ product.uom_id.name +'('+company_currency.symbol+')'+""": """+ rml_obj.formatLang(total2, digits=purchase_price_digits) +' '+ company_currency.symbol +""" '""" xml += """ - """ + _('Total Cost ') + _('of ') + str(number) +' '+ product.uom_id.name +'('+company_currency.code+')'+ """: + """ + _('Total Cost ') + _('of ') + str(number) +' '+ product.uom_id.name +'('+company_currency.symbol+')'+ """: """+ rml_obj.formatLang(total_strd+total2, digits=purchase_price_digits) +' '+ company_currency.symbol + """ diff --git a/addons/report_intrastat/report/invoice.rml b/addons/report_intrastat/report/invoice.rml index 08a1ab14fe0..ac9eeef69c3 100644 --- a/addons/report_intrastat/report/invoice.rml +++ b/addons/report_intrastat/report/invoice.rml @@ -330,7 +330,7 @@
[[ repeatIn(o.invoice_line,'l') ]] - + [[ l.name ]] @@ -360,7 +360,7 @@ [[ formatLang(l.price_subtotal) ]] - [[ o.currency_id.code ]] + [[ o.currency_id.symbol ]] @@ -437,7 +437,7 @@ - + Total (excl. taxes): @@ -446,14 +446,14 @@ [[ formatLang(o.amount_untaxed) ]] - [[ o.currency_id.code ]] + [[ o.currency_id.symbol ]] - + Taxes: @@ -462,14 +462,14 @@ [[ formatLang(o.amount_tax) ]] - [[ o.currency_id.code ]] + [[ o.currency_id.symbol ]] - + Total (inclu. taxes): @@ -478,7 +478,7 @@ [[ formatLang(o.amount_total) ]] - [[ o.currency_id.code ]] + [[ o.currency_id.symbol ]] From a9622693c3fdbc41f7011a740b42b36c6790f616 Mon Sep 17 00:00:00 2001 From: "psi (Open ERP)" Date: Fri, 15 Oct 2010 16:43:30 +0530 Subject: [PATCH 048/116] [ADD] account: Add YML test for Cash Statement bzr revid: psi@tinyerp.co.in-20101015111330-xww41v0tnhoex42o --- addons/account/__openerp__.py | 1 + .../account/test/account_cash_statement.yml | 82 +++++++++++++++++++ 2 files changed, 83 insertions(+) create mode 100644 addons/account/test/account_cash_statement.yml diff --git a/addons/account/__openerp__.py b/addons/account/__openerp__.py index 851d52294fa..6b145f6e974 100644 --- a/addons/account/__openerp__.py +++ b/addons/account/__openerp__.py @@ -132,6 +132,7 @@ module named account_voucher. 'test/account_validate_account_move.yml', 'test/account_fiscalyear_close.yml', 'test/account_bank_statement.yml', + 'test/account_cash_statement.yml', 'test/account_report.yml', ], 'installable': True, diff --git a/addons/account/test/account_cash_statement.yml b/addons/account/test/account_cash_statement.yml new file mode 100644 index 00000000000..0932e214560 --- /dev/null +++ b/addons/account/test/account_cash_statement.yml @@ -0,0 +1,82 @@ +- + In order to test Cash statement I create a Cash statement and and confirm it and check it's move created +- + !record {model: account.bank.statement, id: account_bank_statement_1}: + date: '2010-10-16' + journal_id: account.cash_journal + name: / + period_id: account.period_10 + user_id: base.user_root + starting_details_ids: + - pieces: 10.0 + number: 2 + subtotal: 20.0 + - pieces: 100.0 + number: 1 + subtotal: 200.0 + balance_start: 220.0 + balance_end: 220.0 +- + I check that Initially bank statement is in the "Draft" state +- + !assert {model: account.bank.statement, id: account_bank_statement_1}: + - state == 'draft' + +- + I clicked on Open CashBox button to open the cashbox +- + !python {model: account.bank.statement}: | + self.button_open(cr, uid, [ref("account_bank_statement_1")], {"lang": "en_US", "tz": False, "active_model": "account.bank.statement", "active_ids": [ref("account_bank_statement_1")], "active_id": ref("account_bank_statement_1"), }) + +- + I check that now bank statement is in the "Open" state +- + !assert {model: account.bank.statement, id: account_bank_statement_1}: + - state == 'open' + +- + I enter values in Closing balance before close the cashbox +- + !record {model: account.bank.statement, id: account_bank_statement_1}: + line_ids: + - account_id: account.a_recv + amount: 1000.0 + date: '2010-10-16' + name: test + partner_id: base.res_partner_4 + sequence: 0.0 + type: general + balance_end: 1220.0 + ending_details_ids: + - pieces: 10.0 + number: 2 + subtotal: 20.0 + - pieces: 100.0 + number: 1 + subtotal: 200.0 + - pieces: 500.0 + number: 2 + subtotal: 1000.0 + balance_end_cash: 1220.0 + +- + I clicked on Close CashBox button to close the cashbox +- + !python {model: account.bank.statement}: | + self.button_confirm_cash(cr, uid, [ref("account_bank_statement_1")], {"lang": "en_US", "tz": False, "active_model": "account.bank.statement", "active_ids": [ref("account_bank_statement_1")], "active_id": ref("account_bank_statement_1"), }) + +- + I check that bank statement state is now "Closed" +- + !assert {model: account.bank.statement, id: account_bank_statement_1}: + - state == 'confirm' + +- + I check that move lines created for bank statement and move state is Posted +- + !python {model: account.bank.statement}: | + move_line_obj = self.pool.get('account.move.line') + bank_data = self.browse(cr, uid, ref("account_bank_statement_1")) + assert bank_data.move_line_ids, "Move lines not created for bank statement" + for line in bank_data.move_line_ids: + assert line.move_id.state == 'posted', "Move state is not posted" From b59066644a99d4101d6f832f86c06d2580118093 Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Fri, 15 Oct 2010 16:47:20 +0530 Subject: [PATCH 049/116] [REF, ADD] hr_payrol: remove warnings, add licence on py of report bzr revid: mra@mra-laptop-20101015111720-owtnjv75jqousig7 --- .../report/report_payroll_advice.py | 25 +++++++++++++++++++ addons/hr_payroll/report/report_payslip.py | 11 +------- addons/hr_payroll/report/rml_parse.py | 7 +++--- 3 files changed, 29 insertions(+), 14 deletions(-) diff --git a/addons/hr_payroll/report/report_payroll_advice.py b/addons/hr_payroll/report/report_payroll_advice.py index 1c7fbd91357..ec79d2a85e1 100644 --- a/addons/hr_payroll/report/report_payroll_advice.py +++ b/addons/hr_payroll/report/report_payroll_advice.py @@ -1,5 +1,30 @@ +#!/usr/bin/env python +#-*- coding:utf-8 -*- + +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 Tiny SPRL (). All Rights Reserved +# d$ +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +############################################################################## + import time from datetime import datetime + from report import report_sxw from tools import amount_to_text_en diff --git a/addons/hr_payroll/report/report_payslip.py b/addons/hr_payroll/report/report_payslip.py index 3ce90114eb3..e3e8e0577b2 100755 --- a/addons/hr_payroll/report/report_payslip.py +++ b/addons/hr_payroll/report/report_payslip.py @@ -98,13 +98,4 @@ class payslip_report(report_sxw.rml_parse): report_sxw.report_sxw('report.payslip.pdf', 'hr.payslip', 'hr_payroll/report/payslip.rml', parser=payslip_report) -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - - - - - - - - - +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/hr_payroll/report/rml_parse.py b/addons/hr_payroll/report/rml_parse.py index b4576f600fe..2fc04bb688b 100755 --- a/addons/hr_payroll/report/rml_parse.py +++ b/addons/hr_payroll/report/rml_parse.py @@ -21,9 +21,8 @@ ############################################################################## from report import report_sxw import re -import sys from lxml import etree -from time import strptime +from time import strptime class rml_parse(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): @@ -50,14 +49,14 @@ class rml_parse(report_sxw.rml_parse): return new else: return self.comma_me(new) - + def _ellipsis(self, string, maxlen=100, ellipsis = '...'): ellipsis = ellipsis or '' try: return string[:maxlen - len(ellipsis) ] + (ellipsis, '')[len(string) < maxlen] except Exception: return False - + def _strip_name(self, name, maxlen=50): return self._ellipsis(name, maxlen, '...') From 5d631c99de74e71861f2b44668bcf0ccc2b91a85 Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Fri, 15 Oct 2010 16:56:51 +0530 Subject: [PATCH 050/116] [REM] sale: remove unit_test folder unused bzr revid: mra@mra-laptop-20101015112651-4wpjbleqgcumg1a6 --- addons/sale/unit_test/__init__.py | 24 ----- addons/sale/unit_test/test.py | 160 ------------------------------ 2 files changed, 184 deletions(-) delete mode 100644 addons/sale/unit_test/__init__.py delete mode 100644 addons/sale/unit_test/test.py diff --git a/addons/sale/unit_test/__init__.py b/addons/sale/unit_test/__init__.py deleted file mode 100644 index f96719c920e..00000000000 --- a/addons/sale/unit_test/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (). All Rights Reserved -# $Id$ -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# -############################################################################## - - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/sale/unit_test/test.py b/addons/sale/unit_test/test.py deleted file mode 100644 index 0378bc56531..00000000000 --- a/addons/sale/unit_test/test.py +++ /dev/null @@ -1,160 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (). All Rights Reserved -# $Id$ -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# -############################################################################## -import unittest -import pooler -import netsvc -from cStringIO import StringIO -from osv import osv - -cr = None -uid = None -order_id = None - -class sale_order_test_case(unittest.TestCase): - def setUp(self): - try: - self.pool = pooler.get_pool(cr.dbname) - self.sale_order = self.pool.get('sale.order') - except osv.except_osv,e: - self.fail(e.name + e.value) - except Exception,e: - self.fail(e) - - - def tearDown(self): - try: - self.pool = None - self.sale_order = None - except osv.except_osv,e: - self.fail(e.name + e.value) - except Exception,e: - self.fail(e) - - - def test_1_Create(self): - - try: - global order_id - model_obj = self.pool.get('ir.model.data') - - ### SALE ORDER - shop = model_obj._get_id(cr, uid, 'sale', 'shop') - shop_id = model_obj.browse(cr, uid, shop).res_id - partner = model_obj._get_id(cr, uid, 'base', 'res_partner_9') - partner_id = model_obj.browse(cr, uid, partner,).res_id - partner_invoice = model_obj._get_id(cr, uid, 'base', 'res_partner_address_9') - partner_invoice_id = model_obj.browse(cr, uid, partner_invoice).res_id - pricelist_id = self.pool.get('res.partner').browse(cr, uid, partner_id).property_product_pricelist.id - order_id = self.sale_order.create(cr, uid, - {'shop_id': shop_id, 'pricelist_id': pricelist_id, 'user_id': uid, - 'partner_id': partner_id, 'partner_invoice_id': partner_invoice_id, - 'partner_shipping_id': partner_invoice_id, 'partner_order_id': partner_invoice_id}) - ### SALE ORDER LINE - product = model_obj._get_id(cr, uid, 'product', 'product_product_pc2') - product_id = model_obj.browse(cr, uid, product).res_id - product_uom = model_obj._get_id(cr, uid, 'product', 'product_uom_unit') - product_uom_id = model_obj.browse(cr, uid, product_uom).res_id - self.pool.get('sale.order.line').create(cr, uid, - {'order_id': order_id, 'name': '[PC2] Computer assembled on demand', - 'product_id': product_id, 'product_uom': product_uom_id, 'price_unit': 600, - 'type': 'make_to_order'}) - except osv.except_osv,e: - self.fail(e.name + e.value) - except Exception,e: - self.fail(e) - - def test_2_ConfirmOrder(self): - try: - self.failUnless(order_id,"No Sale Order Created !") - wf_service = netsvc.LocalService("workflow") - res = wf_service.trg_validate(uid, 'sale.order', order_id, 'order_confirm', cr) - except osv.except_osv,e: - self.fail(e.name + e.value) - except Exception,e: - self.fail(e) - - def test_3_CreateInvoice(self): - - try: - self.failUnless(order_id,"No Sale Order Created !") - wf_service = netsvc.LocalService("workflow") - res = wf_service.trg_validate(uid, 'sale.order', order_id, 'manual_invoice', cr) - except osv.except_osv,e: - self.fail(e.name + e.value) - except Exception,e: - self.fail(e) - - def test_4_CancelPicking(self): - try: - self.failUnless(order_id,"No Sale Order Created !") - picking_obj = self.pool.get('stock.picking') - pickings = picking_obj.search(cr, uid, [('sale_id', '=', order_id)]) - picking_obj.action_cancel(cr, uid, pickings) - except osv.except_osv,e: - self.fail(e.name + e.value) - except Exception,e: - self.fail(e) - - def test_5_PrintOrder(self): - try: - self.failUnless(order_id,"No Sale Order Created !") - report_service = netsvc.ExportService.getService('report') - model_obj = self.pool.get('ir.model.data') - passwd = self.pool.get('res.users').browse(cr, uid, uid).password - report = model_obj._get_id(cr, uid, 'sale', 'report_sale_order') - report_id = model_obj.browse(cr, uid, report).res_id - report_service.exp_report(cr.dbname, uid, 'sale.order', [order_id]) - except osv.except_osv,e: - self.fail(e.name + e.value) - except Exception,e: - self.fail(e) - - def test_6_CancelOrder(self): - try: - self.failUnless(order_id,"No Sale Order Created !") - self.sale_order.action_cancel(cr, uid, [order_id]) - except osv.except_osv,e: - self.fail(e.name + e.value) - except Exception,e: - self.fail(e) - - def test_7_Unlink(self): - try: - self.failUnless(order_id,"No Sale Order Created !") - self.sale_order.unlink(cr, uid, [order_id]) - except osv.except_osv,e: - self.fail(e.name + e.value) - except Exception,e: - self.fail(e) - - -def runTest(cursor=None, user=None): - global cr - global uid - cr = cursor - uid = user - out = StringIO() - suite = unittest.TestLoader().loadTestsFromTestCase(sale_order_test_case) - res = unittest.TextTestRunner(stream=out, verbosity=2).run(suite) - if res.wasSuccessful(): - return (True, out.getvalue()) - return (res, out.getvalue()) From 06beea3369fd08a1c3fc2bc410559e01fd6af856 Mon Sep 17 00:00:00 2001 From: "psi (Open ERP)" Date: Fri, 15 Oct 2010 17:13:59 +0530 Subject: [PATCH 051/116] [REF] hr_payroll bzr revid: psi@tinyerp.co.in-20101015114359-mcqv5oywfkxeqya0 --- .../report/report_employees_detail.py | 26 +++- .../report/report_payroll_register.py | 52 ++++++-- addons/hr_payroll/report/report_payslip.py | 122 +++++++++--------- .../hr_payroll/report/report_year_salary.py | 24 ++++ addons/hr_payroll/report/rml_parse.py | 4 +- 5 files changed, 151 insertions(+), 77 deletions(-) diff --git a/addons/hr_payroll/report/report_employees_detail.py b/addons/hr_payroll/report/report_employees_detail.py index 67481dc1a7d..a71fda1492c 100644 --- a/addons/hr_payroll/report/report_employees_detail.py +++ b/addons/hr_payroll/report/report_employees_detail.py @@ -1,3 +1,27 @@ +#!/usr/bin/env python +#-*- coding:utf-8 -*- + +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 Tiny SPRL (). All Rights Reserved +# d$ +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +############################################################################## + import time import locale import datetime @@ -48,7 +72,7 @@ class employees_salary_report(rml_parse.rml_parse): m = datetime.date(cy, cm, 1).strftime('%b') mnth_name.append(m) self.mnths.append(str(cm)+'-'+str(cy)) - + if cm == 12: cm = 0 cy = ly diff --git a/addons/hr_payroll/report/report_payroll_register.py b/addons/hr_payroll/report/report_payroll_register.py index 7ec759cef0a..a67fc1e6b70 100644 --- a/addons/hr_payroll/report/report_payroll_register.py +++ b/addons/hr_payroll/report/report_payroll_register.py @@ -1,3 +1,27 @@ +#!/usr/bin/env python +#-*- coding:utf-8 -*- + +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 Tiny SPRL (). All Rights Reserved +# d$ +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +############################################################################## + import time from datetime import datetime from report import report_sxw @@ -5,7 +29,7 @@ from report import report_sxw class report_payroll_register(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): super(report_payroll_register, self).__init__(cr, uid, name, context) - + self.total_amount = 0.00 self.total_bysal = 0.00 self.localcontext.update({ @@ -27,7 +51,7 @@ class report_payroll_register(report_sxw.rml_parse): self.grows = 0.0 self.deduct = 0.0 self.net = 0.0 - + def add_line(self, line): self.basic += line.basic self.other += line.other_pay @@ -35,37 +59,37 @@ class report_payroll_register(report_sxw.rml_parse): self.grows += line.grows self.deduct += line.deduction self.net += line.net - + def get_basic(self,obj): for line in obj.line_ids: self.basic += line.basic return self.basic - + def get_other(self,obj): for line in obj.line_ids: self.other += line.other_pay return self.other - + def get_allow(self,obj): for line in obj.line_ids: self.allow += line.allounce return self.allow - + def get_grows(self,obj): for line in obj.line_ids: self.grows += line.grows return self.grows - + def get_deduct(self,obj): for line in obj.line_ids: self.deduct += line.deduction return self.deduct - + def get_net(self,obj): for line in obj.line_ids: self.net += line.net return self.net - + def get_month(self, indate): new_date = datetime.strptime(indate, '%Y-%m-%d') out_date = new_date.strftime('%B')+'-'+new_date.strftime('%Y') @@ -74,12 +98,12 @@ class report_payroll_register(report_sxw.rml_parse): def get_no(self): self.no += 1 return self.no - + report_sxw.report_sxw( - 'report.hr.payroll.register.sheet', - 'hr.payroll.register', - 'hr_payroll/report/payroll_register.rml', + 'report.hr.payroll.register.sheet', + 'hr.payroll.register', + 'hr_payroll/report/payroll_register.rml', parser=report_payroll_register -) +) # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/hr_payroll/report/report_payslip.py b/addons/hr_payroll/report/report_payslip.py index e3e8e0577b2..3d6a4fc550a 100755 --- a/addons/hr_payroll/report/report_payslip.py +++ b/addons/hr_payroll/report/report_payslip.py @@ -23,78 +23,78 @@ ############################################################################## from datetime import datetime + from report import report_sxw from tools import amount_to_text_en class payslip_report(report_sxw.rml_parse): - def __init__(self, cr, uid, name, context): - super(payslip_report, self).__init__(cr, uid, name, context) - self.localcontext.update({ - 'convert' : self.convert, - 'get_month' : self.get_month, - 'get_earnings': self.get_earnings, - 'get_deductions':self.get_deductions, - 'get_leave':self.get_leave, - 'get_others':self.get_others, - }) + def __init__(self, cr, uid, name, context): + super(payslip_report, self).__init__(cr, uid, name, context) + self.localcontext.update({ + 'convert': self.convert, + 'get_month': self.get_month, + 'get_earnings': self.get_earnings, + 'get_deductions':self.get_deductions, + 'get_leave':self.get_leave, + 'get_others':self.get_others, + }) + def convert(self, amount, cur): + amt_en = amount_to_text_en.amount_to_text(amount, 'en', cur) + return amt_en - def convert(self,amount, cur): - amt_en = amount_to_text_en.amount_to_text(amount,'en',cur) - return amt_en + def get_others(self, obj): + payslip_line = self.pool.get('hr.payslip.line') + res = [] + ids = [] + for id in range(len(obj)): + if obj[id].category_id.type in ('advance', 'loan', 'otherpay', 'otherdeduct', 'installment'): + ids.append(obj[id].id) + if len(ids): + res = payslip_line.browse(self.cr, self.uid, ids) + return res - def get_others(self,obj): - res = [] - ids = [] - for id in range(len(obj)): - if obj[id].category_id.type in ('advance','loan','otherpay','otherdeduct','installment'): - ids.append(obj[id].id) - payslip_line = self.pool.get('hr.payslip.line') - if len(ids): - res = payslip_line.browse(self.cr, self.uid, ids) - return res + def get_leave(self, obj): + payslip_line = self.pool.get('hr.payslip.line') + res = [] + ids = [] + for id in range(len(obj)): + if obj[id].type == 'leaves': + ids.append(obj[id].id) + if len(ids): + res = payslip_line.browse(self.cr, self.uid, ids) + return res - def get_leave(self,obj): - res = [] - ids = [] - for id in range(len(obj)): - if obj[id].type == 'leaves': - ids.append(obj[id].id) - payslip_line = self.pool.get('hr.payslip.line') - if len(ids): - res = payslip_line.browse(self.cr, self.uid, ids) - return res + def get_earnings(self, obj): + payslip_line = self.pool.get('hr.payslip.line') + res = [] + ids = [] + for id in range(len(obj)): + if obj[id].category_id.type == 'allowance' and obj[id].type != 'leaves': + ids.append(obj[id].id) + if len(ids): + res = payslip_line.browse(self.cr, self.uid, ids) + return res - def get_earnings(self,obj): - res = [] - ids = [] - for id in range(len(obj)): - if obj[id].category_id.type == 'allowance' and obj[id].type != 'leaves': - ids.append(obj[id].id) - payslip_line = self.pool.get('hr.payslip.line') - if len(ids): - res = payslip_line.browse(self.cr, self.uid, ids) - return res + def get_deductions(self, obj): + payslip_line = self.pool.get('hr.payslip.line') + res = [] + ids = [] + for id in range(len(obj)): + if obj[id].category_id.type == 'deduction' and obj[id].type != 'leaves': + ids.append(obj[id].id) + if len(ids): + res = payslip_line.browse(self.cr, self.uid, ids) + return res - def get_deductions(self,obj): - res = [] - ids = [] - for id in range(len(obj)): - if obj[id].category_id.type == 'deduction' and obj[id].type != 'leaves': - ids.append(obj[id].id) - payslip_line = self.pool.get('hr.payslip.line') - if len(ids): - res = payslip_line.browse(self.cr, self.uid, ids) - return res - - def get_month(self,obj): - res = { - 'mname':'' - } - date = datetime.strptime(obj.date, '%Y-%m-%d') - res['mname']= date.strftime('%B')+"-"+date.strftime('%Y') - return res['mname'] + def get_month(self, obj): + res = { + 'mname':'' + } + date = datetime.strptime(obj.date, '%Y-%m-%d') + res['mname']= date.strftime('%B')+"-"+date.strftime('%Y') + return res['mname'] report_sxw.report_sxw('report.payslip.pdf', 'hr.payslip', 'hr_payroll/report/payslip.rml', parser=payslip_report) diff --git a/addons/hr_payroll/report/report_year_salary.py b/addons/hr_payroll/report/report_year_salary.py index f8867f04954..f084eb2d340 100755 --- a/addons/hr_payroll/report/report_year_salary.py +++ b/addons/hr_payroll/report/report_year_salary.py @@ -1,3 +1,27 @@ +#!/usr/bin/env python +#-*- coding:utf-8 -*- + +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 Tiny SPRL (). All Rights Reserved +# d$ +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +############################################################################## + import datetime from report import report_sxw import time diff --git a/addons/hr_payroll/report/rml_parse.py b/addons/hr_payroll/report/rml_parse.py index 2fc04bb688b..6d5f9d7ed3b 100755 --- a/addons/hr_payroll/report/rml_parse.py +++ b/addons/hr_payroll/report/rml_parse.py @@ -19,10 +19,12 @@ # along with this program. If not, see . # ############################################################################## +from time import strptime + from report import report_sxw import re from lxml import etree -from time import strptime + class rml_parse(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): From 6262f527a7c1bb05eff2cc4ceacc422cab21dde7 Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Fri, 15 Oct 2010 17:29:07 +0530 Subject: [PATCH 052/116] [REF] bzr revid: mra@mra-laptop-20101015115907-u3w52nzz7ugd3nkp --- addons/account/report/account_partner_ledger.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/addons/account/report/account_partner_ledger.py b/addons/account/report/account_partner_ledger.py index 44a90decf94..1fe6618dda1 100644 --- a/addons/account/report/account_partner_ledger.py +++ b/addons/account/report/account_partner_ledger.py @@ -46,8 +46,6 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header): 'get_start_date': self._get_start_date, 'get_end_date': self._get_end_date, 'get_fiscalyear': self._get_fiscalyear, - 'get_start_date':self._get_start_date, - 'get_end_date': self._get_end_date, 'get_journal': self._get_journal, 'get_partners':self._get_partners, 'get_intial_balance':self._get_intial_balance, From e3fb322e9a4229e2f48bed6a33a82c8f864febb1 Mon Sep 17 00:00:00 2001 From: "qdp-launchpad@tinyerp.com" <> Date: Fri, 15 Oct 2010 14:03:45 +0200 Subject: [PATCH 053/116] [IMP] resource: usability improvement in form view of resource bzr revid: qdp-launchpad@tinyerp.com-20101015120345-u2kvqtcdbv5cv0yt --- addons/resource/resource_view.xml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/addons/resource/resource_view.xml b/addons/resource/resource_view.xml index a0db745efb4..a77bd88efbf 100644 --- a/addons/resource/resource_view.xml +++ b/addons/resource/resource_view.xml @@ -168,13 +168,19 @@ form
- - - - - - + + + + + + + + + + + + From e92e56634f4ed4c3374b51869537ace34f7706df Mon Sep 17 00:00:00 2001 From: "qdp-launchpad@tinyerp.com" <> Date: Fri, 15 Oct 2010 14:05:18 +0200 Subject: [PATCH 054/116] [IMP] mrp: usability improvements bzr revid: qdp-launchpad@tinyerp.com-20101015120518-r4hn9cvwshd7wkrh --- addons/mrp/mrp_view.xml | 85 ++++++++++++++++++++--------------------- 1 file changed, 41 insertions(+), 44 deletions(-) diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml index 69b7e6f27a2..7c99c14e38f 100644 --- a/addons/mrp/mrp_view.xml +++ b/addons/mrp/mrp_view.xml @@ -143,31 +143,31 @@ + + - - - + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - @@ -220,6 +220,7 @@ + @@ -236,7 +237,7 @@ - + @@ -251,16 +252,18 @@ form
- - - - + + + + + + - - - - - + + + + + @@ -564,8 +567,9 @@ - +