← Back to team overview

openerp-dev-web team mailing list archive

[Merge] lp:~openerp-commiter/openobject-addons/trunk-dev-addons3-ara into lp:~openerp-dev/openobject-addons/trunk-dev-addons3

 

ARA(OpenERP) has proposed merging lp:~openerp-commiter/openobject-addons/trunk-dev-addons3-ara into lp:~openerp-dev/openobject-addons/trunk-dev-addons3.

Requested reviews:
  OpenERP R&D Team (openerp-dev)
Related bugs:
  #615522 Report Of Invoice  : Payment Term + Due date not printed
  https://bugs.launchpad.net/bugs/615522
  #649029 [sale] incoterm field poorly implemented [direct sql / not translatable]
  https://bugs.launchpad.net/bugs/649029
  #672553 opening entries from chart of account doesn't use context
  https://bugs.launchpad.net/bugs/672553
  #674480 [6.0 RC2] incorrect creation of Accounting Journals is some localizations prevents multiple charts from being installed
  https://bugs.launchpad.net/bugs/674480


hello,
   
      I have completed following task.

      * Add a domain on the Bank statement wizard.
   
      *Add a constraint on the statement lines: if there is a voucher_id, then the amount of the voucher must be the same amount as the one on the statement line.

      *Add a constraint instead, on the validation of bank statement.

      *Improve the configuration wizard Generate your chart of account.
          --"Company", "# of digits", "Separated journal sequences" should be visible only in extended view.

Thank you,
ara
-- 
https://code.launchpad.net/~openerp-commiter/openobject-addons/trunk-dev-addons3-ara/+merge/42719
Your team OpenERP R&D Team is requested to review the proposed merge of lp:~openerp-commiter/openobject-addons/trunk-dev-addons3-ara into lp:~openerp-dev/openobject-addons/trunk-dev-addons3.
=== modified file 'account/account_bank_statement.py'
--- account/account_bank_statement.py	2010-11-26 15:14:46 +0000
+++ account/account_bank_statement.py	2010-12-04 05:41:57 +0000
@@ -298,14 +298,24 @@
     def get_next_st_line_number(self, cr, uid, st_number, st_line, context=None):
         return st_number + '/' + str(st_line.sequence)
 
-    def balance_check(self, cr, uid, st_id, journal_type='bank', context=None):
-        st = self.browse(cr, uid, st_id, context)
-        if not (abs((st.balance_end or 0.0) - st.balance_end_real) < 0.0001):
-            raise osv.except_osv(_('Error !'),
-                    _('The statement balance is incorrect !\n') +
-                    _('The expected balance (%.2f) is different than the computed one. (%.2f)') % (st.balance_end_real, st.balance_end))
+#    def balance_check(self, cr, uid, st_id, journal_type='bank', context=None):
+#        st = self.browse(cr, uid, st_id, context)
+#        if not (abs((st.balance_end or 0.0) - st.balance_end_real) < 0.0001):
+#            raise osv.except_osv(_('Error !'),
+#                    _('The statement balance is incorrect !\n') +
+#                    _('The expected balance (%.2f) is different than the computed one. (%.2f)') % (st.balance_end_real, st.balance_end))
+#        return True
+
+    def _balance_check(self, cr, uid, ids, context=None):
+        for st in self.browse(cr, uid, ids):
+            if not (abs((st.balance_end or 0.0) - st.balance_end_real) < 0.0001):
+                return False
         return True
 
+    _constraints = [
+        (_balance_check, 'The statement balance is incorrect !\n The expected balance is different than the computed one.', ['balance_end','balance_end_real']),
+    ]
+
     def statement_close(self, cr, uid, ids, journal_type='bank', context=None):
         return self.write(cr, uid, ids, {'state':'confirm'}, context=context)
 
@@ -324,7 +334,7 @@
             if not self.check_status_condition(cr, uid, st.state, journal_type=j_type):
                 continue
 
-            self.balance_check(cr, uid, st.id, journal_type=j_type, context=context)
+#            self.balance_check(cr, uid, st.id, journal_type=j_type, context=context)
             if (not st.journal_id.default_credit_account_id) \
                     or (not st.journal_id.default_debit_account_id):
                 raise osv.except_osv(_('Configuration Error !'),

=== modified file 'account/account_view.xml'
--- account/account_view.xml	2010-11-26 15:14:46 +0000
+++ account/account_view.xml	2010-12-04 05:41:57 +0000
@@ -2437,7 +2437,7 @@
                           <attribute name='string'></attribute>
                   </xpath>
                 <group string="res_config_contents" position="replace">
-                    <field name="company_id" widget="selection"/>
+                    <field name="company_id" widget="selection" groups="base.group_extended"/>
                     <field name ="code_digits" groups="base.group_extended"/>
                     <field name="chart_template_id" widget="selection" on_change="onchange_chart_template_id(chart_template_id)"/>
                     <field name ="seq_journal" groups="base.group_extended"/>

=== modified file 'account_voucher/account_voucher.py'
--- account_voucher/account_voucher.py	2010-11-24 12:13:47 +0000
+++ account_voucher/account_voucher.py	2010-12-04 05:41:57 +0000
@@ -826,7 +826,6 @@
     _defaults = {
         'name': ''
     }
-
     def onchange_move_line_id(self, cr, user, ids, move_line_id, context={}):
         """
         Returns a dict that contains new values and context
@@ -949,6 +948,17 @@
                 res[line.id] = 0.0
         return res
 
+    def _check_amount(self, cr, uid, ids, context=None):
+        obj = self.browse(cr, uid, ids[0])
+        if obj.voucher_id:
+            if not (obj.amount == obj.voucher_id.amount):
+                return False
+            return True
+
+    _constraints = [
+        (_check_amount, 'The amount of the voucher must be the same amount as the one on the statement line', ['statement_id']),
+    ]
+
     _columns = {
         'amount_reconciled': fields.function(_amount_reconciled,
             string='Amount reconciled', method=True, type='float'),
@@ -968,4 +978,4 @@
 
 account_bank_statement_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

=== modified file 'account_voucher/wizard/account_statement_from_invoice_view.xml'
--- account_voucher/wizard/account_statement_from_invoice_view.xml	2010-10-06 05:20:59 +0000
+++ account_voucher/wizard/account_statement_from_invoice_view.xml	2010-12-04 05:41:57 +0000
@@ -38,7 +38,7 @@
                 <form string="Import Entries">
                     <group colspan="4" expand="1">
                         <separator string="Payable and Receivables" colspan="4"/>
-                        <field height="300" width="700" name="line_ids" colspan="4" nolabel="1" domain="[('account_id.type','in',['receivable','payable']),('reconcile_id','=',False), ('reconcile_partial_id','=',False)]"/>
+                        <field height="300" width="700" name="line_ids" colspan="4" nolabel="1" domain="[('account_id.type','in',['receivable','payable']),('reconcile_id','=',False), ('reconcile_partial_id','=',False), ('state', '=', 'valid')]"/>
                     </group>
                     <group colspan="4" col="6">
                         <label string ="" colspan="2"/>