From 9de90eb54c9826904e75041bb40c2b5d30331d80 Mon Sep 17 00:00:00 2001 From: "sbh (Open ERP)" Date: Wed, 4 Aug 2010 10:49:25 +0530 Subject: [PATCH 02/15] [IMP] account : Rename the label bzr revid: sbh@tinyerp.com-20100804051925-zvnkvwgiopw725bp --- addons/account/report/account_general_ledger.rml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/addons/account/report/account_general_ledger.rml b/addons/account/report/account_general_ledger.rml index 212c8bfc819..675046c16fc 100644 --- a/addons/account/report/account_general_ledger.rml +++ b/addons/account/report/account_general_ledger.rml @@ -9,10 +9,8 @@ - - @@ -20,12 +18,9 @@ - - - @@ -194,12 +189,10 @@ - [[ repeatIn(objects, 'a') ]] - - Chat Account + Chart Account Fiscal Year Journals Display Account From bc45451a8e5138176d3d779c8030ffdfce00b317 Mon Sep 17 00:00:00 2001 From: "sbh (Open ERP)" Date: Wed, 4 Aug 2010 11:05:07 +0530 Subject: [PATCH 03/15] [IMP] account : Improve the report bzr revid: sbh@tinyerp.com-20100804053507-yswuc1eysxd4il97 --- addons/account/report/account_general_ledger.rml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/report/account_general_ledger.rml b/addons/account/report/account_general_ledger.rml index 675046c16fc..ee6f35c0389 100644 --- a/addons/account/report/account_general_ledger.rml +++ b/addons/account/report/account_general_ledger.rml @@ -190,7 +190,7 @@ [[ repeatIn(objects, 'a') ]] - + Chart Account Fiscal Year From ba2611239993b58c2772a0c0813caf89f39eb9e4 Mon Sep 17 00:00:00 2001 From: "Harry (OpenERP)" Date: Wed, 4 Aug 2010 11:10:39 +0530 Subject: [PATCH 04/15] [FIX] outlook: corrected bzr revid: hmo@tinyerp.com-20100804054039-g4mkhmk1hhepg8uz --- addons/outlook/__openerp__.py | 58 ++++++++++++----------------------- 1 file changed, 19 insertions(+), 39 deletions(-) diff --git a/addons/outlook/__openerp__.py b/addons/outlook/__openerp__.py index 1ff9b3b310b..b59f158e5e0 100644 --- a/addons/outlook/__openerp__.py +++ b/addons/outlook/__openerp__.py @@ -19,46 +19,26 @@ # ############################################################################## { - "name" : "Accounting and Financial Management", - "version" : "1.1", + "name" : "Outlook Interface", + "version" : "1.0", "author" : "OpenERP SA", - "category": 'Generic Modules/Accounting', - "description": """Financial and accounting module that covers: - General accountings - Cost / Analytic accounting - Third party accounting - Taxes management - Budgets - Customer and Supplier Invoices - Bank statements - Reconciliation process by partner - Creates a dashboards for accountants that includes: - * List of uninvoiced quotations - * Graph of aged receivables - * Graph of aged incomes + "website" : "http://www.openerp.com/", + "depends" : ["base"], + "category" : "Generic Modules/Outlook interface", + "description": ''' + This module provide the Outlook plug-in. + + Outlook plug-in allows you to select an object that you’d like to add + to your email and its attachments from MS Outlook. You can select a partner, a task, + a project, an analytical account, or any other object and attach selected + mail as .eml file in attachment of selected record. + + ''', + "init_xml" : [], + "demo_xml" : [], + "update_xml" : [], + "active": False, + "installable": True -The processes like maintaining of general ledger is done through the defined financial Journals (entry move line or -grouping is maintained through journal) for a particular financial year and for preparation of vouchers there is a -module named account_vouchers - """, - 'website': 'http://www.openerp.com', - 'init_xml': [], - "depends" : ["product", "analytic", "process","board"], - 'update_xml': [], - 'demo_xml': [], - 'test': [ -# 'test/account_customer_invoice.yml', -# 'test/account_supplier_invoice.yml', -# 'test/account_change_currency.yml', -# 'test/chart_of_account.yml', -# 'test/account_period_close.yml', -# 'test/account_fiscalyear_close_state.yml', -# #'test/account_invoice_state.yml', -# 'test/account_use_model.yml', -# 'test/account_validate_account_move.yml', -# 'test/account_fiscalyear_close.yml', - ], - 'installable': True, - 'active': False, } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: From cd3cb10ca6285ebe45811172fe380280fc88d899 Mon Sep 17 00:00:00 2001 From: "sbh (Open ERP)" Date: Wed, 4 Aug 2010 11:15:13 +0530 Subject: [PATCH 05/15] [IMP] account : Improve the report bzr revid: sbh@tinyerp.com-20100804054513-37gdhujrk3h741p7 --- addons/account/report/account_balance.rml | 4 ++-- addons/account/report/account_general_ledger.rml | 2 +- addons/account/report/account_general_ledger_landscape.rml | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/account/report/account_balance.rml b/addons/account/report/account_balance.rml index a5b4e211b33..c19a28cf480 100644 --- a/addons/account/report/account_balance.rml +++ b/addons/account/report/account_balance.rml @@ -209,9 +209,9 @@ - + - Company [[ data['model']=='account.account' or removeParentNode('para') ]] + [[ data['model']=='account.account' and 'Company'or removeParentNode('para') ]] [[ data['model']=='ir.ui.menu' and 'Chart of Account' or removeParentNode('para') ]] Fiscal Year diff --git a/addons/account/report/account_general_ledger.rml b/addons/account/report/account_general_ledger.rml index ee6f35c0389..2a99b643bff 100644 --- a/addons/account/report/account_general_ledger.rml +++ b/addons/account/report/account_general_ledger.rml @@ -192,7 +192,7 @@ [[ repeatIn(objects, 'a') ]] - Chart Account + Chart of Account Fiscal Year Journals Display Account diff --git a/addons/account/report/account_general_ledger_landscape.rml b/addons/account/report/account_general_ledger_landscape.rml index 07b16bb11ce..fe090650d40 100644 --- a/addons/account/report/account_general_ledger_landscape.rml +++ b/addons/account/report/account_general_ledger_landscape.rml @@ -204,10 +204,10 @@ - + - Company [[ data['model']=='account.account' or removeParentNode('para') ]] - Chart of Account [[ data['model']=='ir.ui.menu' or removeParentNode('para') ]] + [[ data['model']=='account.account' and 'Company' or removeParentNode('para') ]] + [[ data['model']=='ir.ui.menu' and 'Chart of Account' or removeParentNode('para') ]] Fiscal Year Journals Display Account From 4eca2c4091b0fc6d1bfd95fbd732df0385f1a497 Mon Sep 17 00:00:00 2001 From: "sbh (Open ERP)" Date: Wed, 4 Aug 2010 11:44:53 +0530 Subject: [PATCH 06/15] [IMP] account : Improve the report layout bzr revid: sbh@tinyerp.com-20100804061453-1n30uvqo57q177ls --- addons/account/report/account_balance.rml | 2 +- addons/account/report/account_central_journal.rml | 4 ++-- addons/account/report/account_general_journal.rml | 4 ++-- addons/account/report/account_journal.rml | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/addons/account/report/account_balance.rml b/addons/account/report/account_balance.rml index c19a28cf480..e11a0d7b44c 100644 --- a/addons/account/report/account_balance.rml +++ b/addons/account/report/account_balance.rml @@ -211,7 +211,7 @@ - [[ data['model']=='account.account' and 'Company'or removeParentNode('para') ]] + [[ data['model']=='account.account' and 'Company'or removeParentNode('para') ]] [[ data['model']=='ir.ui.menu' and 'Chart of Account' or removeParentNode('para') ]] Fiscal Year diff --git a/addons/account/report/account_central_journal.rml b/addons/account/report/account_central_journal.rml index 816afa59cb8..f31ae1d50ab 100644 --- a/addons/account/report/account_central_journal.rml +++ b/addons/account/report/account_central_journal.rml @@ -244,8 +244,8 @@ - Company [[ data['model']=='account.journal.period' or removeParentNode('para') ]] - Chart of Account [[ data['model']=='ir.ui.menu' or removeParentNode('para') ]] + [[ data['model']=='account.journal.period' and 'Company' or removeParentNode('para') ]] + [[ data['model']=='ir.ui.menu' and 'Chart of Account' or removeParentNode('para') ]] Fiscal Year Journal Filter By [[get_filter(data)!='No Filter' and get_filter(data) ]] diff --git a/addons/account/report/account_general_journal.rml b/addons/account/report/account_general_journal.rml index 77f750196d4..c8f23e7631f 100644 --- a/addons/account/report/account_general_journal.rml +++ b/addons/account/report/account_general_journal.rml @@ -224,8 +224,8 @@ - Company [[ data['model']=='account.journal.period' or removeParentNode('para') ]] - Chart of Account [[ data['model']=='ir.ui.menu' or removeParentNode('para') ]] + [[ data['model']=='account.journal.period' and 'Company' or removeParentNode('para') ]] + [[ data['model']=='ir.ui.menu' and 'Chart of Account' or removeParentNode('para') ]] Fiscal Year Journals Filter By [[ get_filter(data)!='No Filter' and get_filter(data) ]] diff --git a/addons/account/report/account_journal.rml b/addons/account/report/account_journal.rml index a308331a8fd..75d2fa2070b 100644 --- a/addons/account/report/account_journal.rml +++ b/addons/account/report/account_journal.rml @@ -205,8 +205,8 @@ - Company [[ data['model']=='account.journal.period' or removeParentNode('para') ]] - Chart of Account [[ data['model']=='ir.ui.menu' or removeParentNode('para') ]] + [[ data['model']=='account.journal.period'and 'Company' or removeParentNode('para') ]] + [[ data['model']=='ir.ui.menu' and 'Chart of Account' or removeParentNode('para') ]] Fiscal Year Journal Filters By From 35ce122ca978df50cde0a36cd97de6c0082e4e1f Mon Sep 17 00:00:00 2001 From: "sbh (Open ERP)" Date: Wed, 4 Aug 2010 11:48:08 +0530 Subject: [PATCH 07/15] [IMP] account : Improve the header of report bzr revid: sbh@tinyerp.com-20100804061808-iot390p3tohj2q2m --- addons/account/report/account_partner_balance.rml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/report/account_partner_balance.rml b/addons/account/report/account_partner_balance.rml index fba666fe319..7ee04a79e2b 100644 --- a/addons/account/report/account_partner_balance.rml +++ b/addons/account/report/account_partner_balance.rml @@ -189,7 +189,7 @@ - + Chart of Account Fiscal Year From 6704953f03aa4ec9511e41ab5451b22d0fb640f6 Mon Sep 17 00:00:00 2001 From: "sbh (Open ERP)" Date: Wed, 4 Aug 2010 11:53:39 +0530 Subject: [PATCH 08/15] [IMP] account : Improve partner_ledger report bzr revid: sbh@tinyerp.com-20100804062339-xnx64rmdwnvty68z --- addons/account/report/account_partner_ledger.rml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/addons/account/report/account_partner_ledger.rml b/addons/account/report/account_partner_ledger.rml index 206b5f3052d..b6e564d26d0 100644 --- a/addons/account/report/account_partner_ledger.rml +++ b/addons/account/report/account_partner_ledger.rml @@ -178,6 +178,9 @@ + + + @@ -227,7 +230,18 @@ - + + + + + + + + + + + + [[ display_currency(data) == False or removeParentNode('blockTable') ]] From 697372ae38d9f9f6829932ac2c59d0dee639fdc0 Mon Sep 17 00:00:00 2001 From: "sbh (Open ERP)" Date: Wed, 4 Aug 2010 12:14:30 +0530 Subject: [PATCH 09/15] [Fix] purchase: Fix the yml, stock:Remove the sale_id bzr revid: sbh@tinyerp.com-20100804064430-u38z7eqie2f26v5e --- addons/purchase/__openerp__.py | 2 +- addons/stock/stock.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/purchase/__openerp__.py b/addons/purchase/__openerp__.py index 423bd090d24..c7b4de7decc 100644 --- a/addons/purchase/__openerp__.py +++ b/addons/purchase/__openerp__.py @@ -57,7 +57,7 @@ 'test': [ 'test/purchase_from_order.yml', 'test/purchase_from_manual.yml', -# 'test/purchase_from_picking.yml', + 'test/purchase_from_picking.yml', 'purchase_unit_test.xml', 'test/procurement_buy.yml', ], diff --git a/addons/stock/stock.py b/addons/stock/stock.py index c46a9210aad..db2652eefb4 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -897,7 +897,7 @@ class stock_picking(osv.osv): 'origin': (invoice.origin or '') + ', ' + (picking.name or '') + (picking.origin and (':' + picking.origin) or ''), 'comment': (comment and (invoice.comment and invoice.comment+"\n"+comment or comment)) or (invoice.comment and invoice.comment or ''), 'date_invoice':context.get('date_inv',False), - 'user_id':picking.sale_id.user_id and picking.sale_id.user_id.id or False + 'user_id':uid } invoice_obj.write(cr, uid, [invoice_id], invoice_vals, context=context) else: @@ -914,7 +914,7 @@ class stock_picking(osv.osv): 'fiscal_position': partner.property_account_position.id, 'date_invoice': context.get('date_inv',False), 'company_id': picking.company_id.id, - 'user_id':picking.sale_id.user_id and picking.sale_id.user_id.id or False + 'user_id':uid } cur_id = self.get_currency_id(cr, uid, picking) if cur_id: From bd1d14b7753c617e91f897fc056646a7f2fa9f9c Mon Sep 17 00:00:00 2001 From: "sbh (Open ERP)" Date: Wed, 4 Aug 2010 12:29:46 +0530 Subject: [PATCH 10/15] [Fix] stock : Fix the picking report bzr revid: sbh@tinyerp.com-20100804065946-hwmsapwo50thgw2j --- addons/stock/report/picking.rml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/stock/report/picking.rml b/addons/stock/report/picking.rml index c5b4237a1d8..ddc4f3461da 100644 --- a/addons/stock/report/picking.rml +++ b/addons/stock/report/picking.rml @@ -242,7 +242,7 @@
[[ repeatIn([line for line in picking.move_lines if (line.state == 'assigned' )],'move_lines') ]] - + [[ picking.move_lines or removeParentNode('blockTable')]] [ [[ (move_lines.product_id.default_code) or removeParentNode('font') ]] ] [[ move_lines.product_id.name ]] [[ move_lines.product_id.variants or '']] @@ -274,7 +274,7 @@
[[ repeatIn([line for line in picking.move_lines if (line.state != 'assigned' )],'move_lines') and removeParentNode('section') ]] - + [[ picking.move_lines or removeParentNode('blockTable')]] [ [[ (move_lines.product_id.default_code) or removeParentNode('font') ]] ] [[ move_lines.product_id.name ]] [[ move_lines.product_id.variants or '']] From 5843e3f439b7560ebca7f7441c5ca307ce8a43a1 Mon Sep 17 00:00:00 2001 From: "sbh (Open ERP)" Date: Wed, 4 Aug 2010 12:36:49 +0530 Subject: [PATCH 11/15] [REF]: Remove the comment code bzr revid: sbh@tinyerp.com-20100804070649-iqe2u1kaof8e5uk8 --- addons/stock/stock.py | 42 ------------------------------------------ 1 file changed, 42 deletions(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index db2652eefb4..0f613b5e47d 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -112,7 +112,6 @@ class stock_location(osv.osv): res[id] = {}.fromkeys(field_names, 0.0) if ('product_id' not in context) or not ids: return res - #location_ids = self.search(cr, uid, [('location_id', 'child_of', ids)]) for loc in ids: context['location'] = [loc] prod = self.pool.get('product.product').browse(cr, uid, context['product_id'], context) @@ -176,7 +175,6 @@ class stock_location(osv.osv): 'stock_real': fields.function(_product_qty_available, method=True, type='float', string='Real Stock', multi="stock"), 'stock_virtual': fields.function(_product_qty_available, method=True, type='float', string='Virtual Stock', multi="stock"), - #'account_id': fields.many2one('account.account', string='Inventory Account', domain=[('type', '!=', 'view')]), 'location_id': fields.many2one('stock.location', 'Parent Location', select=True, ondelete='cascade'), 'child_ids': fields.one2many('stock.location', 'location_id', 'Contains'), @@ -308,7 +306,6 @@ class stock_location(osv.osv): # Choose the right filed standard_price to read amount_unit = product.price_get(pricetype.field, context)[product.id] price = qty[product_id] * amount_unit - # price = qty[product_id] * product.standard_price total_price += price result['product'].append({ @@ -360,13 +357,6 @@ class stock_location(osv.osv): def _product_virtual_get(self, cr, uid, id, product_ids=False, context=None, states=['done']): return self._product_all_get(cr, uid, id, product_ids, context, ['confirmed', 'waiting', 'assigned', 'done']) - # - # TODO: - # Improve this function - # - # Returns: - # [ (tracking_id, product_qty, location_id) ] - # def _product_reserve(self, cr, uid, ids, product_id, product_qty, context=None): """ @param product_id: Id of product @@ -629,13 +619,6 @@ class stock_picking(osv.osv): # TODO: Check locations to see if in the same location ? return True -# def button_confirm(self, cr, uid, ids, *args): -# for id in ids: -# wf_service = netsvc.LocalService("workflow") -# wf_service.trg_validate(uid, 'stock.picking', id, 'button_confirm', cr) -# self.force_assign(cr, uid, ids, *args) -# return True - def action_assign(self, cr, uid, ids, *args): """ Changes state of picking to available if all moves are confirmed. @return: True @@ -654,7 +637,6 @@ class stock_picking(osv.osv): wf_service = netsvc.LocalService("workflow") for pick in self.browse(cr, uid, ids): move_ids = [x.id for x in pick.move_lines if x.state in ['confirmed','waiting']] -# move_ids = [x.id for x in pick.move_lines] self.pool.get('stock.move').force_assign(cr, uid, move_ids) wf_service.trg_write(uid, 'stock.picking', pick.id, cr) return True @@ -669,9 +651,6 @@ class stock_picking(osv.osv): raise osv.except_osv(_('Error !'),_('You can not process picking without stock moves')) wf_service.trg_validate(uid, 'stock.picking', pick.id, 'button_confirm', cr) - #move_ids = [x.id for x in pick.move_lines] - #self.pool.get('stock.move').force_assign(cr, uid, move_ids) - #wf_service.trg_write(uid, 'stock.picking', pick.id, cr) return True def draft_validate(self, cr, uid, ids, *args): @@ -1377,7 +1356,6 @@ class stock_move(osv.osv): 'prodlot_id': fields.many2one('stock.production.lot', 'Production Lot', help="Production lot is used to put a serial number on the production"), 'tracking_id': fields.many2one('stock.tracking', 'Pack', select=True, help="This is the code that will be put on the logistical unit: pallet, box, pack."), -# 'lot_id': fields.many2one('stock.lot', 'Consumer lot', select=True, readonly=True), 'auto_validate': fields.boolean('Auto Validate'), @@ -1576,7 +1554,6 @@ class stock_move(osv.osv): """ Confirms stock move. @return: List of ids. """ -# ids = map(lambda m: m.id, moves) moves = self.browse(cr, uid, ids) self.write(cr, uid, ids, {'state': 'confirmed'}) i = 0 @@ -1692,7 +1669,6 @@ class stock_move(osv.osv): r = res.pop(0) move_id = self.copy(cr, uid, move.id, {'product_qty': r[0], 'location_id': r[1]}) done.append(move_id) - #cr.execute('insert into stock_move_history_ids values (%s,%s)', (move.id,move_id)) if done: count += len(done) self.write(cr, uid, done, {'state': 'assigned'}) @@ -1745,7 +1721,6 @@ class stock_move(osv.osv): wf_service = netsvc.LocalService("workflow") for id in ids: wf_service.trg_trigger(uid, 'stock.move', id, cr) - #self.action_cancel(cr,uid, ids2, context) return True def _get_accounting_values(self, cr, uid, move, context=None): @@ -1789,7 +1764,6 @@ class stock_move(osv.osv): pricetype = price_type_obj.browse(cr,uid,move.company_id.property_valuation_price_type.id) amount_unit = move.product_id.price_get(pricetype.field, context)[move.product_id.id] amount = amount_unit * q or 1.0 - # amount = q * move.product_id.standard_price return journal_id, acc_src, acc_dest, acc_variation, amount def action_done(self, cr, uid, ids, context=None): @@ -1816,7 +1790,6 @@ class stock_move(osv.osv): wf_service.trg_write(uid, 'stock.picking', move.move_dest_id.picking_id.id, cr) else: pass - # self.action_done(cr, uid, [move.move_dest_id.id]) if move.move_dest_id.auto_validate: self.action_done(cr, uid, [move.move_dest_id.id], context=context) @@ -1857,15 +1830,6 @@ class stock_move(osv.osv): 'ref': move.picking_id and move.picking_id.name, }) - # This can be removed - #tracking_lot = False - #if context: - # tracking_lot = context.get('tracking_lot', False) - # if tracking_lot: - # rec_id = context and context.get('active_id', False) - # tracking = self.pool.get('stock.tracking') - # tracking_lot = tracking.get_create_tracking_lot(cr, uid,[rec_id], tracking_lot) - self.write(cr, uid, ids, {'state': 'done', 'date_planned': time.strftime('%Y-%m-%d %H:%M:%S')}) wf_service = netsvc.LocalService("workflow") for id in ids: @@ -1947,7 +1911,6 @@ class stock_move(osv.osv): 'location_dest_id': location_id } new_move = self.copy(cr, uid, move.id, default_val) - #self.write(cr, uid, [new_move], {'move_history_ids':[(4,move.id)]}) #TODO : to track scrap moves res += [new_move] product_obj = self.pool.get('product.product') for (id, name) in product_obj.name_get(cr, uid, [move.product_id.id]): @@ -2170,7 +2133,6 @@ class stock_move(osv.osv): 'state': 'assigned', 'move_dest_id': False, 'price_unit': move.price_unit, - #'tracking_id': tracking_lot, }) complete.append(self.browse(cr, uid, new_move)) self.write(cr, uid, move.id, @@ -2185,7 +2147,6 @@ class stock_move(osv.osv): { 'product_qty': move.product_qty, 'product_uos_qty': move.product_qty, - #'tracking_id': tracking_lot }) complete.append(move) @@ -2249,7 +2210,6 @@ class stock_inventory(osv.osv): for line in inv.inventory_line_id: pid = line.product_id.id - # price = line.product_id.standard_price or 0.0 amount = self.pool.get('stock.location')._product_get(cr, uid, line.location_id.id, [pid], {'uom': line.product_uom.id})[pid] #TOCHECK: Why put restriction like new inventory qty should greater available qty ? change = line.product_qty - amount @@ -2348,7 +2308,6 @@ class stock_warehouse(osv.osv): _description = "Warehouse" _columns = { 'name': fields.char('Name', size=60, required=True), -# 'partner_id': fields.many2one('res.partner', 'Owner'), 'company_id': fields.many2one('res.company','Company',required=True,select=1), 'partner_address_id': fields.many2one('res.partner.address', 'Owner Address'), 'lot_input_id': fields.many2one('stock.location', 'Location Input', required=True, domain=[('usage','<>','view')]), @@ -2385,7 +2344,6 @@ class stock_picking_move_wizard(osv.osv_memory): _columns = { 'name': fields.char('Name', size=64, invisible=True), - #'move_lines': fields.one2many('stock.move', 'picking_id', 'Move lines',readonly=True), 'move_ids': fields.many2many('stock.move', 'picking_move_wizard_rel', 'picking_move_wizard_id', 'move_id', 'Entry lines', required=True), 'address_id': fields.many2one('res.partner.address', 'Dest. Address', invisible=True), 'picking_id': fields.many2one('stock.picking', 'Picking list', select=True, invisible=True), From 6f84f3a1b7da46f9ded5e1fa7f2b77a199895e3f Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Wed, 4 Aug 2010 13:04:06 +0530 Subject: [PATCH 12/15] [REM] remove some unused files [IMP] Aged partner balance: converted to common report+wizard bzr revid: mra@mra-laptop-20100804073406-lprz9rteprirj58y --- addons/account/report/aged_trial_balance.py | 148 ++++----- .../account/report/wizard_account_journal.rml | 194 ------------ .../account/report/wizard_central_journal.rml | 277 ---------------- .../account/report/wizard_general_journal.rml | 298 ------------------ .../account_general_ledger_report_view.xml | 102 ------ .../account_report_aged_partner_balance.py | 76 ++--- ...count_report_aged_partner_balance_view.xml | 43 +-- 7 files changed, 126 insertions(+), 1012 deletions(-) delete mode 100644 addons/account/report/wizard_account_journal.rml delete mode 100644 addons/account/report/wizard_central_journal.rml delete mode 100644 addons/account/report/wizard_general_journal.rml delete mode 100644 addons/account/wizard/account_general_ledger_report_view.xml diff --git a/addons/account/report/aged_trial_balance.py b/addons/account/report/aged_trial_balance.py index 43db65f25c9..2971173ac7d 100644 --- a/addons/account/report/aged_trial_balance.py +++ b/addons/account/report/aged_trial_balance.py @@ -18,20 +18,20 @@ # along with this program. If not, see . # ############################################################################## + import time import pooler import rml_parse from report import report_sxw +from common_report_header import common_report_header -class aged_trial_report(rml_parse.rml_parse): +class aged_trial_report(rml_parse.rml_parse, common_report_header): def __init__(self, cr, uid, name, context): super(aged_trial_report, self).__init__(cr, uid, name, context=context) - self.line_query = '' + self.query_line = '' self.total_account = [] - - self.localcontext.update({ 'time': time, 'get_lines': self._get_lines, @@ -40,11 +40,17 @@ class aged_trial_report(rml_parse.rml_parse): 'get_for_period': self._get_for_period, 'get_company': self._get_company, 'get_currency': self._get_currency, - }) + def set_context(self, objects, data, ids, report_type=None): + self.query = data['form'].get('query_line', '') + self.direction_selection = data['form'].get('direction_selection', 'past') + self.date_from = data['form'].get('date_from', time.strftime('%Y-%m-%d')) + return super(aged_trial_report, self).set_context(objects, data, ids, report_type=report_type) def _get_lines(self, form): + res = [] + account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line') if (form['result_selection'] == 'customer' ): self.ACCOUNT_TYPE = ['receivable'] elif (form['result_selection'] == 'supplier'): @@ -52,74 +58,68 @@ class aged_trial_report(rml_parse.rml_parse): else: self.ACCOUNT_TYPE = ['payable','receivable'] - - res = [] - account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line') - self.line_query = account_move_line_obj._query_get(self.cr, self.uid, obj='line', - context={'fiscalyear': form['fiscalyear']}) - self.cr.execute("""SELECT DISTINCT res_partner.id AS id, - res_partner.name AS name - FROM res_partner,account_move_line AS line, account_account - WHERE (line.account_id=account_account.id) - AND ((reconcile_id IS NULL) - OR (reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s ))) - AND (line.partner_id=res_partner.id) - AND (account_account.company_id = %s) - ORDER BY res_partner.name""" , (form['date1'],form['company_id'])) + self.cr.execute('SELECT DISTINCT res_partner.id AS id,\ + res_partner.name AS name \ + FROM res_partner,account_move_line AS l, account_account\ + WHERE (l.account_id=account_account.id)\ + AND ((reconcile_id IS NULL)\ + OR (reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\ + AND (l.partner_id=res_partner.id)\ + AND ' + self.query + ' \ + ORDER BY res_partner.name' , (self.date_from,)) partners = self.cr.dictfetchall() ## mise a 0 du total for i in range(7): self.total_account.append(0) # - # Build a string like (1,2,3) for easy use in SQL query partner_ids = [x['id'] for x in partners] # This dictionary will store the debit-credit for all partners, using partner_id as key. totals = {} - self.cr.execute("""SELECT partner_id, SUM(debit-credit) - FROM account_move_line AS line, account_account - WHERE (line.account_id = account_account.id) - AND (account_account.type IN %s) - AND (partner_id IN %s) - AND ((reconcile_id IS NULL) - OR (reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s ))) - AND (account_account.company_id = %s) - AND account_account.active - GROUP BY partner_id""" , (tuple(self.ACCOUNT_TYPE), tuple(partner_ids),form['date1'],form['company_id'],)) + self.cr.execute('SELECT partner_id, SUM(debit-credit) \ + FROM account_move_line AS l, account_account\ + WHERE (l.account_id = account_account.id)\ + AND (account_account.type IN %s)\ + AND (partner_id IN %s)\ + AND ((reconcile_id IS NULL)\ + OR (reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\ + AND ' + self.query + '\ + AND account_account.active\ + GROUP BY partner_id ' , (tuple(self.ACCOUNT_TYPE), tuple(partner_ids), self.date_from,)) t = self.cr.fetchall() for i in t: totals[i[0]] = i[1] # This dictionary will store the future or past of all partners future_past = {} - if form['direction_selection'] == 'future': - self.cr.execute("""SELECT partner_id, SUM(debit-credit) - FROM account_move_line AS line, account_account - WHERE (line.account_id=account_account.id) - AND (account_account.type IN %s) - AND (COALESCE(date_maturity,date) < %s) - AND (partner_id IN %s) - AND ((reconcile_id IS NULL) - OR (reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s ))) - AND (account_account.company_id = %s) - AND account_account.active - GROUP BY partner_id""", (tuple(self.ACCOUNT_TYPE), form['date1'], tuple(partner_ids),form['date1'], form['company_id'],)) + if self.direction_selection == 'future': + self.cr.execute('SELECT partner_id, SUM(debit-credit) \ + FROM account_move_line AS l, account_account\ + WHERE (l.account_id=account_account.id)\ + AND (account_account.type IN %s)\ + AND (COALESCE(date_maturity, date) < %s)\ + AND (partner_id IN %s)\ + AND ((reconcile_id IS NULL)\ + OR (reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\ + AND '+ self.query + '\ + AND account_account.active\ + GROUP BY partner_id', (tuple(self.ACCOUNT_TYPE), self.date_from, tuple(partner_ids),self.date_from,)) t = self.cr.fetchall() for i in t: future_past[i[0]] = i[1] - elif form['direction_selection'] == 'past': # Using elif so people could extend without this breaking - self.cr.execute("""SELECT partner_id, SUM(debit-credit) - FROM account_move_line AS line, account_account - WHERE (line.account_id=account_account.id) - AND (account_account.type IN %s) - AND (COALESCE(date_maturity,date) > %s) - AND (partner_id IN %s) - AND ((reconcile_id IS NULL) - OR (reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s ))) - AND (account_account.company_id = %s) - AND account_account.active - GROUP BY partner_id""" , (tuple(self.ACCOUNT_TYPE), form['date1'], tuple(partner_ids), form['date1'], form['company_id'],)) + elif self.direction_selection == 'past': # Using elif so people could extend without this breaking + self.cr.execute('SELECT partner_id, SUM(debit-credit) \ + FROM account_move_line AS l, account_account\ + WHERE (l.account_id=account_account.id)\ + AND (account_account.type IN %s)\ + AND (COALESCE(date_maturity,date) > %s)\ + AND (partner_id IN %s)\ + AND ((reconcile_id IS NULL)\ + OR (reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\ + AND '+ self.query + '\ + AND account_account.active\ + GROUP BY partner_id' , (tuple(self.ACCOUNT_TYPE), self.date_from, tuple(partner_ids), self.date_from,)) t = self.cr.fetchall() for i in t: future_past[i[0]] = i[1] @@ -128,18 +128,17 @@ class aged_trial_report(rml_parse.rml_parse): # Each history will contain : history[1] = {'': } history = [] for i in range(5): - self.cr.execute("""SELECT partner_id, SUM(debit-credit) - FROM account_move_line AS line, account_account - WHERE (line.account_id=account_account.id) - AND (account_account.type IN %s) - AND (COALESCE(date_maturity,date) BETWEEN %s AND %s) - AND (partner_id IN %s) - AND ((reconcile_id IS NULL) - OR (reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s ))) - AND (account_account.company_id = %s) - AND account_account.active - GROUP BY partner_id""" , (tuple(self.ACCOUNT_TYPE), form[str(i)]['start'], form[str(i)]['stop'], tuple(partner_ids) ,form['date1'] ,form['company_id'],)) - + self.cr.execute('SELECT partner_id, SUM(debit-credit)\ + FROM account_move_line AS l, account_account\ + WHERE (l.account_id = account_account.id)\ + AND (account_account.type IN %s)\ + AND (COALESCE(date_maturity,date) BETWEEN %s AND %s)\ + AND (partner_id IN %s)\ + AND ((reconcile_id IS NULL)\ + OR (reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\ + AND '+ self.query + '\ + AND account_account.active\ + GROUP BY partner_id' , (tuple(self.ACCOUNT_TYPE), form[str(i)]['start'], form[str(i)]['stop'], tuple(partner_ids) ,self.date_from,)) t = self.cr.fetchall() d = {} for i in t: @@ -149,16 +148,14 @@ class aged_trial_report(rml_parse.rml_parse): for partner in partners: values = {} ## If choise selection is in the future - if form['direction_selection'] == 'future': + if self.direction_selection == 'future': # Query here is replaced by one query which gets the all the partners their 'before' value before = False if future_past.has_key(partner['id']): before = [ future_past[partner['id']] ] - self.total_account[6] = self.total_account[6] + (before and before[0] or 0.0) - values['direction'] = before and before[0] or 0.0 - elif form['direction_selection'] == 'past': # Changed this so people could in the future create new direction_selections + elif self.direction_selection == 'past': # Changed this so people could in the future create new direction_selections # Query here is replaced by one query which gets the all the partners their 'after' value after = False if future_past.has_key(partner['id']): # Making sure this partner actually was found by the query @@ -211,15 +208,8 @@ class aged_trial_report(rml_parse.rml_parse): period = self.total_account[int(pos)] return period - def _get_company(self, form): - return pooler.get_pool(self.cr.dbname).get('res.company').browse(self.cr, self.uid, form['company_id']).name - - def _get_currency(self, form): - return pooler.get_pool(self.cr.dbname).get('res.company').browse(self.cr, self.uid, form['company_id']).currency_id.name - - report_sxw.report_sxw('report.account.aged_trial_balance', 'res.partner', - 'addons/account/report/aged_trial_balance.rml',parser=aged_trial_report,header=False) + 'addons/account/report/aged_trial_balance.rml',parser=aged_trial_report, header=False) -# 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/report/wizard_account_journal.rml b/addons/account/report/wizard_account_journal.rml deleted file mode 100644 index 28c6df89a9a..00000000000 --- a/addons/account/report/wizard_account_journal.rml +++ /dev/null @@ -1,194 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- [[ repeatIn(objects, 'o') ]] - - [[repeatIn(lines(data['form']['periods'],data['form']['journal_ids'],data['form']['sort_selection']), 'line') ]] - - - Date - - - Voucher No - - - A/c No. - - - Third party - - - Entry label - - - Debit - - - Credit - - - - - [[ line[0].period_id.name ]] - - - [[line[0].journal_id.code ]] - - - - - [[ formatLang(sum_debit(line[0].period_id.id, line[0].journal_id.id)) ]] - - - [[ formatLang(sum_credit(line[0].period_id.id, line[0].journal_id.id)) ]] - - - - [[repeatIn(line,'l')]] - - [[ formatLang(l.date,date=True) ]] - - - [[ l.ref ]] - - - [[ l.account_id.code ]] - - - [[ l.partner_id and l.partner_id.name ]] - - - [[ l.name ]] - - - [[ formatLang(l.debit) ]] - - - [[ formatLang(l.credit) ]] - - - - - - - -
-
-
\ No newline at end of file diff --git a/addons/account/report/wizard_central_journal.rml b/addons/account/report/wizard_central_journal.rml deleted file mode 100644 index 1a8d9b62187..00000000000 --- a/addons/account/report/wizard_central_journal.rml +++ /dev/null @@ -1,277 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [[ repeatIn(objects, 'o') ]] - - - - - - - - Central Journal - - - - - - - - [[ repeatIn(lines(data['form']['periods'],data['form']['journal_ids']), 'line') ]] - - - Start Period - End Period - - Journal Code - - - Journal Name - - - Printing Date - - - - - - [[ get_start_date(data['form']) ]] - [[ get_end_date(data['form']) ]] - - [[ line[0]['journal'].code or '' ]] - - - [[ line[0]['journal'].name ]] - - - [[ formatLang(time.strftime('%Y-%m-%d %H:%M:%S'),date_time = True) ]] - - - - - - - - - - - - - Account Num. - - - Account Name - - - Debit - - - Credit - - - - - - - - - Total: - - - - - - - - [[ formatLang(sum_debit(line[0]['period'].id, line[0]['journal'].id)) ]] - - - [[ formatLang(sum_credit(line[0]['period'].id, line[0]['journal'].id)) ]] - - - - - - - [[repeatIn(line,'l')]] - - d[[ l['code'] ]] - - - [[ l['name'] ]] - - - [[ formatLang(l['debit']) ]] - - - [[ formatLang(l['credit']) ]] - - - - - - - - - - - - - - - diff --git a/addons/account/report/wizard_general_journal.rml b/addons/account/report/wizard_general_journal.rml deleted file mode 100644 index d436ae87bed..00000000000 --- a/addons/account/report/wizard_general_journal.rml +++ /dev/null @@ -1,298 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - General Journal - - - - - - - - - - - - Start Period - End Period - Printing Date - - - - - [[ get_start_date(data['form']) ]] - [[ get_end_date(data['form']) ]] - [[ formatLang(time.strftime('%Y-%m-%d %H:%M:%S'),date_time = True) ]] - - - - - -
- - - - - - - Jrl Code - - - Journal Name - - - Period - - - Debit Trans. - - - Credit Trans. - - - - - - - - Total: - - - - - - - - - - - - - [[ formatLang(sum_debit(data['form']['periods'],data['form']['journal_ids'])) ]] - - - [[ formatLang(sum_credit(data['form']['periods'],data['form']['journal_ids'])) ]] - - - - - - - - - - [[ repeatIn( lines( data['form']['periods'], data['form']['journal_ids'] ),'line')]] - - - - [[ line[0]['period_name'] ]] : - - - - - - - - - - - - - [[ formatLang(sum_debit_period( line[0]['pid'],data['form']['journal_ids'])) ]] - - - [[ formatLang(sum_credit_period(line[0]['pid'],data['form']['journal_ids'])) ]] - - - - - - - - [[ repeatIn(line,'l') ]] - [[ l['code'] ]] - - - [[ l['name'] ]] - - - [[ line[0]['period_name'] ]] - - - [[ formatLang(l['debit'])]] - - - [[ formatLang(l['credit']) ]] - - - - - - - - - -
- - - -
-
diff --git a/addons/account/wizard/account_general_ledger_report_view.xml b/addons/account/wizard/account_general_ledger_report_view.xml deleted file mode 100644 index f98e80fb81f..00000000000 --- a/addons/account/wizard/account_general_ledger_report_view.xml +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - General Ledger - account.general.ledger.report - form - -
- - - -