[IMP] account_budget: default value
authorAntoine Huvelle <antoine.huvelle@gmail.com>
Wed, 27 Aug 2014 14:03:23 +0000 (16:03 +0200)
committerMartin Trigaux <mat@openerp.com>
Wed, 27 Aug 2014 15:16:45 +0000 (17:16 +0200)
Adding a context which ease budget encoding as really often, creating a budget means the associated budget lines will follow the same start and end dates. Passing the context allow budget lines automatically have the budget's start and end date

addons/account_budget/account_budget_view.xml

index 55d5e44..1b71d72 100644 (file)
                         </group>
                         <notebook>
                             <page string="Budget Lines">
-                                <field name="crossovered_budget_line" colspan="4" nolabel="1" attrs="{'readonly':[('state','!=','draft')]}">
+                                <field name="crossovered_budget_line" context="{'default_date_from': date_from,'default_date_to': date_to}" colspan="4" nolabel="1" attrs="{'readonly':[('state','!=','draft')]}">
                                     <tree string="Budget Lines">
                                         <field name="analytic_account_id" groups="analytic.group_analytic_accounting"/>
                                         <field name="general_budget_id"/>