Jagdish Panchal (Open ERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-addons26-atp-account_assets_improvement-jap
 into lp:~openerp-dev/openobject-addons/trunk-addons26-atp.

Requested reviews:
  Atul Patel(OpenERP) (atp-openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-addons26-atp-account_assets_improvement-jap/+merge/136131

Hello Sir,

I have done following changes:
 1) account_assest:
     => Residual Value field should be updated automatically when Gross Value 
and Salvage Value  fields have been filled.
     => Rename field Depreciation Amount and Amount to Depreciate.
     => Change tool tip of Number of Months in a Period tooltip and Computation 
Method field
 2) account_check_writing:
     =>     Move "Total" Field below "Payment Method" field

Thanks
JAP
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-addons26-atp-account_assets_improvement-jap/+merge/136131
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-addons26-atp.
=== modified file 'account_asset/account_asset.py'
--- account_asset/account_asset.py	2012-11-15 15:09:45 +0000
+++ account_asset/account_asset.py	2012-11-26 10:28:02 +0000
@@ -41,7 +41,7 @@
         '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 @@
             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 @@
         '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 @@
         '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 @@
                                   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'),

=== modified file 'account_asset/account_asset_view.xml'
--- account_asset/account_asset_view.xml	2012-10-10 12:52:31 +0000
+++ account_asset/account_asset_view.xml	2012-11-26 10:28:02 +0000
@@ -108,8 +108,8 @@
                         <page string="General">
                             <group>
                                 <group>
-                                    <field name="purchase_value" widget="monetary" options="{'currency_field': 'currency_id'}"/>
-                                    <field name="salvage_value" widget="monetary" options="{'currency_field': 'currency_id'}"/>
+                                    <field name="purchase_value" widget="monetary" options="{'currency_field': 'currency_id'}" on_change="onchange_value_residual(purchase_value)"/>
+                                    <field name="salvage_value" widget="monetary" options="{'currency_field': 'currency_id'}" on_change="onchange_value_residual(purchase_value,salvage_value)"/>
                                     <field name="value_residual" widget="monetary" options="{'currency_field': 'currency_id'}"/>
                                     <field name="partner_id"/>
                                 </group>

=== modified file 'account_check_writing/account_voucher_view.xml'
--- account_check_writing/account_voucher_view.xml	2012-08-08 10:59:07 +0000
+++ account_check_writing/account_voucher_view.xml	2012-11-26 10:28:02 +0000
@@ -9,7 +9,7 @@
             <field name="model">account.voucher</field>
             <field name="inherit_id" ref="account_voucher.view_vendor_payment_form" />
             <field name="arch" type="xml">
-                <field name="journal_id" position="after">
+                <field name="amount" position="after">
                     <newline/>
                     <field name="allow_check" invisible="1"/>
                     <field name="amount_in_word" attrs="{'invisible':[('allow_check','!=',1)]}" nolabel="1" colspan="6"/>

=== modified file 'account_voucher/voucher_payment_receipt_view.xml'
--- account_voucher/voucher_payment_receipt_view.xml	2012-11-15 12:38:51 +0000
+++ account_voucher/voucher_payment_receipt_view.xml	2012-11-26 10:28:02 +0000
@@ -139,13 +139,13 @@
                         <group>
                             <field name="partner_id" required="1" invisible="context.get('line_type', False)" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date, context)" context="{'invoice_currency':currency_id, 'default_customer': 0, 'search_default_supplier': 1, 'default_supplier': 1}"  string="Supplier"/>
                             <field name="currency_id" invisible="1"/>
-                            <field name="amount" invisible="context.get('line_type', False)" on_change="onchange_amount(amount, payment_rate, partner_id, journal_id, currency_id, type, date, payment_rate_currency_id, company_id, context)" class="oe_inline" widget='monetary' options='{"currency_field": "currency_id"}'/>
                             <field name="journal_id"
                                 domain="[('type','in',['bank', 'cash'])]"
                                 invisible="context.get('line_type', False)"
                                 widget="selection"
                                 on_change="onchange_journal(journal_id, line_dr_ids, False, partner_id, date, amount, type, company_id, context)"
                                 string="Payment Method"/>
+                            <field name="amount" invisible="context.get('line_type', False)" on_change="onchange_amount(amount, payment_rate, partner_id, journal_id, currency_id, type, date, payment_rate_currency_id, company_id, context)" class="oe_inline" widget='monetary' options='{"currency_field": "currency_id"}'/>                                
                         </group>
                         <group>
                             <field name="date" invisible="context.get('line_type', False)" on_change="onchange_date(date, currency_id, payment_rate_currency_id, amount, company_id, context)"/>

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to