[ADD]Reconcile function which return the full or partial reconcile depending on which...
authorDenis Ledoux dle@openerp.com <>
Thu, 22 Nov 2012 09:23:02 +0000 (10:23 +0100)
committerDenis Ledoux dle@openerp.com <>
Thu, 22 Nov 2012 09:23:02 +0000 (10:23 +0100)
bzr revid: dle@openerp.com-20121122092302-rji8z8bgbb3p8k14

addons/account/account_move_line.py
addons/account/account_view.xml

index 9a67a3c..bbdf246 100644 (file)
@@ -477,6 +477,15 @@ class account_move_line(osv.osv):
                 result.append(line.id)
         return result
 
+    def _get_reconcile(self, cr, uid, ids,name, unknow_none, context=None):
+        res = dict.fromkeys(ids, False)
+        for line in self.browse(cr, uid, ids, context=context):
+            if line.reconcile_id:
+                res[line.id] = str(line.reconcile_id.name)
+            elif line.reconcile_partial_id:
+                res[line.id] = str(line.reconcile_partial_id.name)
+        return res
+
     _columns = {
         'name': fields.char('Name', size=64, required=True),
         'quantity': fields.float('Quantity', digits=(16,2), help="The optional quantity expressed by this line, eg: number of product sold. The quantity is not a legal requirement but is very useful for some reports."),
@@ -491,6 +500,7 @@ class account_move_line(osv.osv):
         'statement_id': fields.many2one('account.bank.statement', 'Statement', help="The bank statement used for bank reconciliation", select=1),
         'reconcile_id': fields.many2one('account.move.reconcile', 'Reconcile', readonly=True, ondelete='set null', select=2),
         'reconcile_partial_id': fields.many2one('account.move.reconcile', 'Partial Reconcile', readonly=True, ondelete='set null', select=2),
+        'reconcile': fields.function(_get_reconcile, type='char', string='Reconcile'),
         'amount_currency': fields.float('Amount Currency', help="The amount expressed in an optional other currency if it is a multi-currency entry.", digits_compute=dp.get_precision('Account')),
         'amount_residual_currency': fields.function(_amount_residual, string='Residual Amount', multi="residual", help="The residual amount on a receivable or payable of a journal entry expressed in its currency (maybe different of the company currency)."),
         'amount_residual': fields.function(_amount_residual, string='Residual Amount', multi="residual", help="The residual amount on a receivable or payable of a journal entry expressed in the company currency."),
index 19e0f22..c9c95cd 100644 (file)
                     <field name="move_id" required="0"/>
                     <field name="debit" sum="Total Debit"/>
                     <field name="credit" sum="Total Credit"/>
-                    <field name="reconcile_partial_id"/>
-                    <field name="reconcile_id"/>
+                    <field name="reconcile"/>
                     <field name="invoice" invisible="1"/>
                     <field name="amount_currency" readonly="True" invisible="not context.get('currency',False)"/>
                     <field name="currency_id" readonly="True" invisible="not context.get('currency',False)" />
             <field name="search_view_id" ref="view_account_move_line_filter"/>
             <field name="help" type="html">
               <p class="oe_view_nocontent_create">
-                Click to register a new journal item.
+                Select the period and the journal you want to fill.
               </p><p>
                 This view can be used by accountants in order to quickly record
                 entries in OpenERP. If you want to record a supplier invoice,