From 9ed5746c0cc6328532d40f91e9dd7d395936bfc9 Mon Sep 17 00:00:00 2001 From: Jagdish Panchal Date: Mon, 26 Nov 2012 15:43:53 +0530 Subject: [PATCH 01/15] [IMP] account_asset: rename field, add onchange method on purchase_value, salvage_value and account_check_writing: Move Total Field below Payment Method field bzr revid: jap@tinyerp.com-20121126101353-seazfz9jn10abhat --- addons/account_asset/account_asset.py | 22 ++++++++++++++----- addons/account_asset/account_asset_view.xml | 4 ++-- .../account_voucher_view.xml | 2 +- .../voucher_payment_receipt_view.xml | 2 +- 4 files changed, 20 insertions(+), 10 deletions(-) diff --git a/addons/account_asset/account_asset.py b/addons/account_asset/account_asset.py index a44226e76c8..48fd7567dbb 100644 --- a/addons/account_asset/account_asset.py +++ b/addons/account_asset/account_asset.py @@ -41,7 +41,7 @@ class account_asset_category(osv.osv): 'company_id': fields.many2one('res.company', 'Company', required=True), 'method': fields.selection([('linear','Linear'),('degressive','Degressive')], 'Computation Method', required=True, help="Choose the method to use to compute the amount of depreciation lines.\n"\ " * Linear: Calculated on basis of: Gross Value / Number of Depreciations\n" \ - " * Degressive: Calculated on basis of: Remaining Value * Degressive Factor"), + " * Degressive: Calculated on basis of: Residual Value * Degressive Factor"), 'method_number': fields.integer('Number of Depreciations'), 'method_period': fields.integer('Period Length', help="State here the time between 2 depreciations, in months", required=True), 'method_progress_factor': fields.float('Degressive Factor'), @@ -222,6 +222,16 @@ class account_asset_asset(osv.osv): else: val['currency_id'] = company.currency_id.id return {'value': val} + + def onchange_value_residual(self, cr, uid, ids, purchase_value, salvage_value=False, context=None): + val = {} + asset = self.browse(cr, uid, ids, context=context) + for i in asset: + if purchase_value: + val['value_residual'] = purchase_value - salvage_value + if salvage_value: + val['value_residual'] = purchase_value - salvage_value + return {'value': val} _columns = { 'account_move_line_ids': fields.one2many('account.move.line', 'asset_id', 'Entries', readonly=True, states={'draft':[('readonly',False)]}), @@ -243,9 +253,9 @@ class account_asset_asset(osv.osv): 'partner_id': fields.many2one('res.partner', 'Partner', readonly=True, states={'draft':[('readonly',False)]}), 'method': fields.selection([('linear','Linear'),('degressive','Degressive')], 'Computation Method', required=True, readonly=True, states={'draft':[('readonly',False)]}, help="Choose the method to use to compute the amount of depreciation lines.\n"\ " * Linear: Calculated on basis of: Gross Value / Number of Depreciations\n" \ - " * Degressive: Calculated on basis of: Remaining Value * Degressive Factor"), + " * Degressive: Calculated on basis of: Residual Value * Degressive Factor"), 'method_number': fields.integer('Number of Depreciations', readonly=True, states={'draft':[('readonly',False)]}, help="Calculates Depreciation within specified interval"), - 'method_period': fields.integer('Number of Months in a Period', required=True, readonly=True, states={'draft':[('readonly',False)]}, help="State here the time during 2 depreciations, in months"), + 'method_period': fields.integer('Number of Months in a Period', required=True, readonly=True, states={'draft':[('readonly',False)]}, help="The amount of time between two depreciations, in months"), 'method_end': fields.date('Ending Date', readonly=True, states={'draft':[('readonly',False)]}), 'method_progress_factor': fields.float('Degressive Factor', readonly=True, states={'draft':[('readonly',False)]}), 'value_residual': fields.function(_amount_residual, method=True, digits_compute=dp.get_precision('Account'), string='Residual Value'), @@ -359,8 +369,8 @@ class account_asset_depreciation_line(osv.osv): 'sequence': fields.integer('Sequence', required=True), 'asset_id': fields.many2one('account.asset.asset', 'Asset', required=True), 'parent_state': fields.related('asset_id', 'state', type='char', string='State of Asset'), - 'amount': fields.float('Depreciation Amount', digits_compute=dp.get_precision('Account'), required=True), - 'remaining_value': fields.float('Amount to Depreciate', digits_compute=dp.get_precision('Account'),required=True), + 'amount': fields.float('Current Depreciation', digits_compute=dp.get_precision('Account'), required=True), + 'remaining_value': fields.float('Next Period Depreciation', digits_compute=dp.get_precision('Account'),required=True), 'depreciated_value': fields.float('Amount Already Depreciated', required=True), 'depreciation_date': fields.date('Depreciation Date', select=1), 'move_id': fields.many2one('account.move', 'Depreciation Entry'), @@ -460,7 +470,7 @@ class account_asset_history(osv.osv): help="The method to use to compute the dates and number of depreciation lines.\n"\ "Number of Depreciations: Fix the number of depreciation lines and the time between 2 depreciations.\n" \ "Ending Date: Choose the time between 2 depreciations and the date the depreciations won't go beyond."), - 'method_number': fields.integer('Number of Depreciations'), + 'method_number': fields.integer('Number of Depreciations', help="The number of depreciations needed to depreciate your asset"), 'method_period': fields.integer('Period Length', help="Time in month between two depreciations"), 'method_end': fields.date('Ending date'), 'note': fields.text('Note'), diff --git a/addons/account_asset/account_asset_view.xml b/addons/account_asset/account_asset_view.xml index 520ee733e73..5d611fce7c6 100644 --- a/addons/account_asset/account_asset_view.xml +++ b/addons/account_asset/account_asset_view.xml @@ -108,8 +108,8 @@ - - + + diff --git a/addons/account_check_writing/account_voucher_view.xml b/addons/account_check_writing/account_voucher_view.xml index 520c78009d5..de7ecd327a9 100644 --- a/addons/account_check_writing/account_voucher_view.xml +++ b/addons/account_check_writing/account_voucher_view.xml @@ -9,7 +9,7 @@ account.voucher - + diff --git a/addons/account_voucher/voucher_payment_receipt_view.xml b/addons/account_voucher/voucher_payment_receipt_view.xml index b6f367601ff..19f9348c3db 100644 --- a/addons/account_voucher/voucher_payment_receipt_view.xml +++ b/addons/account_voucher/voucher_payment_receipt_view.xml @@ -139,13 +139,13 @@ - + From 632ab99bf91edc1938eef409ed1e0bce706aba9c Mon Sep 17 00:00:00 2001 From: Saurang Suthar Date: Mon, 26 Nov 2012 16:18:29 +0530 Subject: [PATCH 02/15] [IMP]membership:improved position of tabs as per suggestion in product form view when all modules are installed bzr revid: ssu@tinyerp.com-20121126104829-f30vvo034l8hs1c0 --- addons/membership/membership_view.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/membership/membership_view.xml b/addons/membership/membership_view.xml index 376e0bcaf9b..faab9a4b9e5 100644 --- a/addons/membership/membership_view.xml +++ b/addons/membership/membership_view.xml @@ -84,9 +84,9 @@ Membership Products product.product - + - + @@ -98,7 +98,7 @@ - + From 453ec1ae10b961505f81416d1efe165bd20ee7b1 Mon Sep 17 00:00:00 2001 From: Saurang Suthar Date: Mon, 26 Nov 2012 16:41:16 +0530 Subject: [PATCH 03/15] [IMP]purchase_requisition:set purchase_requisition field after supply_method field bzr revid: ssu@tinyerp.com-20121126111116-cut8h1s6kjv1vo77 --- addons/purchase_requisition/purchase_requisition_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/purchase_requisition/purchase_requisition_view.xml b/addons/purchase_requisition/purchase_requisition_view.xml index 5ee0a007cc9..8c07b8a84f5 100644 --- a/addons/purchase_requisition/purchase_requisition_view.xml +++ b/addons/purchase_requisition/purchase_requisition_view.xml @@ -182,7 +182,7 @@ product.product - + From b49406ab40d9072c191054cb5b89fe7675c68536 Mon Sep 17 00:00:00 2001 From: Saurang Suthar Date: Mon, 26 Nov 2012 16:56:43 +0530 Subject: [PATCH 04/15] [IMP]product:make Sales tab invisible if Can be Sold field is false bzr revid: ssu@tinyerp.com-20121126112643-vm5kj5u147hbi3gs --- addons/product/product_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/product/product_view.xml b/addons/product/product_view.xml index f1554f08346..3e360594b19 100644 --- a/addons/product/product_view.xml +++ b/addons/product/product_view.xml @@ -124,7 +124,7 @@ - +