← Back to team overview

openerp-dev-web team mailing list archive

[Merge] lp:~openerp-dev/openobject-addons/trunk-bug-726296-ara into lp:openobject-addons

 

Ashvin Rathod (OpenERP) has proposed merging lp:~openerp-dev/openobject-addons/trunk-bug-726296-ara into lp:openobject-addons.

Requested reviews:
  OpenERP Core Team (openerp)
Related bugs:
  Bug #726296 in OpenERP Addons: "voucher currency-related issues"
  https://bugs.launchpad.net/openobject-addons/+bug/726296

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-726296-ara/+merge/53765

Hello,

Fix: #726296 voucher currency-related issues

Thanks,
ara
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-726296-ara/+merge/53765
Your team OpenERP R&D Team is subscribed to branch lp:~openerp-dev/openobject-addons/trunk-bug-726296-ara.
=== modified file 'account_voucher/account_voucher.py'
--- account_voucher/account_voucher.py	2011-03-10 13:12:36 +0000
+++ account_voucher/account_voucher.py	2011-03-17 09:41:14 +0000
@@ -191,7 +191,7 @@
             domain=[('type','=','dr')], context={'default_type':'dr'}, readonly=True, states={'draft':[('readonly',False)]}),
         'period_id': fields.many2one('account.period', 'Period', required=True, readonly=True, states={'draft':[('readonly',False)]}),
         'narration':fields.text('Notes', readonly=True, states={'draft':[('readonly',False)]}),
-        'currency_id':fields.many2one('res.currency', 'Currency', readonly=True, states={'draft':[('readonly',False)]}),
+        'currency_id':fields.many2one('res.currency', 'Currency', required=True, readonly=True, states={'draft':[('readonly',False)]}),
 #        'currency_id': fields.related('journal_id','currency', type='many2one', relation='res.currency', string='Currency', store=True, readonly=True, states={'draft':[('readonly',False)]}),
         'company_id': fields.many2one('res.company', 'Company', required=True, readonly=True, states={'draft':[('readonly',False)]}),
         'state':fields.selection(
@@ -977,7 +977,8 @@
     def _check_amount(self, cr, uid, ids, context=None):
         for obj in self.browse(cr, uid, ids, context=context):
             if obj.voucher_id:
-                if not (abs(obj.amount) == obj.voucher_id.amount):
+                diff = abs(obj.amount) - obj.voucher_id.amount
+                if not self.pool.get('res.currency').is_zero(cr, uid, obj.voucher_id.currency_id, diff):
                     return False
         return True
 

=== modified file 'account_voucher/account_voucher_view.xml'
--- account_voucher/account_voucher_view.xml	2011-03-10 08:41:20 +0000
+++ account_voucher/account_voucher_view.xml	2011-03-17 09:41:14 +0000
@@ -69,7 +69,7 @@
                                 <group col="2" colspan="1" >
                                     <separator string="Other Information" colspan="2"/>
                                     <field name="number"/>
-                                    <field name="currency_id" invisible="True"/>
+                                    <field name="currency_id"/>
                                 </group>
                                 <group col="4" colspan="1" attrs="{'invisible':[('type','in',['payment', 'receipt', False])]}">
                                     <separator string="Total" colspan="4"/>

=== modified file 'account_voucher/voucher_payment_receipt_view.xml'
--- account_voucher/voucher_payment_receipt_view.xml	2011-02-14 12:45:21 +0000
+++ account_voucher/voucher_payment_receipt_view.xml	2011-03-17 09:41:14 +0000
@@ -135,7 +135,7 @@
                             </group>
                             <group col="2" colspan="1">
                                 <separator string="Other Information" colspan="2"/>
-                                <field name="currency_id" invisible="True"/>
+                                <field name="currency_id"/>
                                 <field name="number"/>
                             </group>
                         </page>
@@ -214,7 +214,7 @@
                                 </group>
                                 <separator string="Other Information" colspan="2"/>
                                 <group col="4" colspan="1">
-                                  <field name="currency_id" invisible="True"/>
+                                  <field name="currency_id"/>
                                   <field name="number"/>
                                 </group>
                             </group>
@@ -355,7 +355,7 @@
                                 </group>
                                 <separator string="Other Information" colspan="2"/>
                                 <group col="4" colspan="1">
-                                    <field name="currency_id" invisible="True"/>
+                                    <field name="currency_id"/>
                                     <field name="number"/>
                                 </group>
                             </group>

=== modified file 'account_voucher/voucher_sales_purchase_view.xml'
--- account_voucher/voucher_sales_purchase_view.xml	2011-01-14 00:11:01 +0000
+++ account_voucher/voucher_sales_purchase_view.xml	2011-03-17 09:41:14 +0000
@@ -102,7 +102,7 @@
                         <field name="number"/>
                         <field name="name" colspan="4"/>
                         <field name="type" invisible="True"/>
-                        <field name="currency_id" invisible="True" nolabel="1"/>
+                        <field name="currency_id"/>
                     </group>
                     <notebook colspan="4">
                         <page string="Sales Information">
@@ -230,7 +230,7 @@
                         <field name="reference" select="1"/>
                         <field name="account_id" domain="[('type','=','other')]"  invisible="True"/>
                         <field name="type" invisible="True"/>
-                        <field name="currency_id" invisible="True" nolabel="1"/>
+                        <field name="currency_id"/>
                     </group>
                     <notebook colspan="4">
                         <page string="Bill Information">


Follow ups