Better view for credit control runs

This commit is contained in:
Guewen Baconnier
2014-10-30 15:43:58 +01:00
parent a782c1a068
commit fe28c5c959
2 changed files with 31 additions and 23 deletions

View File

@@ -32,7 +32,9 @@ class CreditControlRun(models.Model):
_rec_name = 'date'
_description = "Credit control line generator"
date = fields.Date(string='Controlling Date', required=True)
date = fields.Date(string='Controlling Date', required=True,
readonly=True,
states={'draft': [('readonly', False)]})
@api.model
def _get_policies(self):

View File

@@ -6,7 +6,7 @@
<field name="model">credit.control.run</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Credit control run"> <!-- editable="bottom" -->
<tree string="Credit control run">
<field name="date"/>
<field name="state"/>
</tree>
@@ -19,27 +19,33 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Credit control run">
<field name="date"
attrs="{'readonly': [('state', '!=', 'draft')]}"/>
<newline/>
<notebook colspan="4">
<page string="Policies">
<field name="policy_ids" colspan="4" nolabel="1"/>
</page>
<page string="Report and Errors">
<field name="report" colspan="4" nolabel="1"/>
<separator string="Move lines To be treated manually"/>
<field name="manual_ids" colspan="4" nolabel="1"/>
</page>
</notebook>
<group col="3" colspan="4">
<button name="generate_credit_lines"
string="Compute Credit Control Lines"
colspan="1"
type="object" icon="gtk-execute"
attrs="{'invisible': [('state', '!=', 'draft')]}"/>
</group>
<field name="state"/>
<header>
<field name="state" widget="statusbar"
statusbar_visible="draft,done"
statusbar_colors='{}'/>
</header>
<sheet>
<group>
<field name="date"/>
</group>
<notebook>
<page string="Policies">
<field name="policy_ids" colspan="4" nolabel="1"/>
</page>
<page string="Report and Errors">
<field name="report" colspan="4" nolabel="1"/>
<separator string="Move lines To be treated manually"/>
<field name="manual_ids" colspan="4" nolabel="1"/>
</page>
</notebook>
<group col="3" colspan="4">
<button name="generate_credit_lines"
string="Compute Credit Control Lines"
colspan="1"
type="object" icon="gtk-execute"
attrs="{'invisible': [('state', '!=', 'draft')]}"/>
</group>
</sheet>
</form>
</field>
</record>