← Back to team overview

credativ team mailing list archive

[Branch ~credativ/openobject-addons/6.1] Rev 7040: [IMP] Add fiscal year filter in journal items. Set fiscal year filter as default filter when link...

 

------------------------------------------------------------
revno: 7040
committer: Craig Gowing (credativ) <craig.gowing@xxxxxxxxxxxxxx>
branch nick: addons
timestamp: Wed 2013-06-19 13:50:47 +0100
message:
  [IMP] Add fiscal year filter in journal items. Set fiscal year filter as default filter when linking from chart of accounts.
modified:
  account/account_move_line.py
  account/account_view.xml


--
lp:~credativ/openobject-addons/6.1
https://code.launchpad.net/~credativ/openobject-addons/6.1

Your team credativ is subscribed to branch lp:~credativ/openobject-addons/6.1.
To unsubscribe from this branch go to https://code.launchpad.net/~credativ/openobject-addons/6.1/+edit-subscription
=== modified file 'account/account_move_line.py'
--- account/account_move_line.py	2013-02-13 16:09:59 +0000
+++ account/account_move_line.py	2013-06-19 12:50:47 +0000
@@ -493,6 +493,7 @@
                                 store = {
                                     'account.move': (_get_move_lines, ['period_id'], 20)
                                 }),
+        'fiscalyear_id': fields.related('period_id', 'fiscalyear_id', string='Fiscal Year', type='many2one', relation='account.fiscalyear', readonly=True),
         'blocked': fields.boolean('Litigation', help="You can check this box to mark this journal item as a litigation with the associated partner"),
         'partner_id': fields.many2one('res.partner', 'Partner', select=1, ondelete='restrict'),
         'date_maturity': fields.date('Due date', select=True ,help="This field is used for payable and receivable journal entries. You can put the limit date for the payment of this line."),

=== modified file 'account/account_view.xml'
--- account/account_view.xml	2012-05-28 06:02:51 +0000
+++ account/account_view.xml	2013-06-19 12:50:47 +0000
@@ -1243,6 +1243,7 @@
                     <group>
                         <field name="journal_id" widget="selection" context="{'journal_id':self}"/>
                         <field name="period_id" context="{'period_id':self}"/>
+                        <field name="fiscalyear_id" context="{'fiscalyear_id':self}"/>
                     </group>
                     <newline/>
                     <group expand="0" string="Group By...">
@@ -1295,7 +1296,7 @@
             <field name="view_mode">tree,form</field>
             <field name="view_id" ref="view_move_line_tree"/>
             <field name="search_view_id" ref="view_account_move_line_filter"/>
-            <field name="context">{'search_default_account_id': [active_id]}</field>
+            <field name="context">{'search_default_account_id': [active_id], 'search_default_fiscalyear_id': [fiscalyear]}</field>
         </record>
 
         <record id="ir_account_move_line_select" model="ir.values">