|
4 | 4 | <field name="name">Estate Property Model Action</field>
|
5 | 5 | <field name="res_model">estate_property</field>
|
6 | 6 | <field name="view_mode">list,form</field>
|
| 7 | + <field name="context">{'search_default_available': True}</field> |
7 | 8 | </record>
|
8 | 9 | <record id="estate_property_model_list" model="ir.ui.view">
|
9 | 10 | <field name="name">estate_property_list</field>
|
10 | 11 | <field name="model">estate_property</field>
|
11 | 12 | <field name="arch" type="xml">
|
12 |
| - <list string='Properties'> |
| 13 | + <list string='Properties' |
| 14 | + decoration-success="state == 'offer_received' or state == 'offer_accepted'" |
| 15 | + decoration-bf="state == 'offer_accepted'" |
| 16 | + decoration-muted="state == 'sold' or state == 'cancelled'" |
| 17 | + > |
13 | 18 | <field name='name'/>
|
14 |
| - <field name='property_type_id'/> |
15 |
| - <field name='tag_ids' widget="many2many_tags"/> |
| 19 | + <field name='property_type_id' options="{'no_create': true}"/> |
| 20 | + <field name='state' optional="1"/> |
| 21 | + <field name='tag_ids' widget="many2many_tags" options="{'color_field': 'color'}"/> |
16 | 22 | <field name='postcode'/>
|
17 |
| - <field name='bedrooms'/> |
18 |
| - <field name='living_area'/> |
19 |
| - <field name='expected_price'/> |
20 |
| - <field name='selling_price'/> |
21 |
| - <field name='date_availability'/> |
| 23 | + <field name='bedrooms' optional="1"/> |
| 24 | + <field name='living_area' optional="1"/> |
| 25 | + <field name='expected_price' optional="1"/> |
| 26 | + <field name='selling_price' optional="1"/> |
| 27 | + <field name='date_availability' optional="1"/> |
22 | 28 | </list>
|
23 | 29 | </field>
|
24 | 30 | </record>
|
|
28 | 34 | <field name="arch" type="xml">
|
29 | 35 | <form>
|
30 | 36 | <header>
|
31 |
| - <button name='mark_sold' type='object' string='Sell'/> |
32 |
| - <button name='mark_cancelled' type='object' string='Cancel'/> |
| 37 | + <button name='mark_sold' type='object' string='Sell' invisible="state != 'offer_accepted'"/> |
| 38 | + <button name='mark_cancelled' type='object' string='Cancel' invisible="state == 'sold' or state == 'cancelled'"/> |
| 39 | + <field name='state' widget='statusbar' statusbar_visible='new, offer_received, offer_accepted, sold'/> |
33 | 40 | </header>
|
34 | 41 | <h1><field name='name'/></h1>
|
35 |
| - <field name='tag_ids' widget="many2many_tags"/> |
| 42 | + <field name='tag_ids' widget="many2many_tags" options="{'color_field': 'color'}"/> |
36 | 43 | <group>
|
37 | 44 | <group>
|
38 | 45 | <field name='postcode'/>
|
|
49 | 56 | <page string='Description'>
|
50 | 57 | <group>
|
51 | 58 | <field name='description'/>
|
52 |
| - <field name='property_type_id'/> |
| 59 | + <field name='property_type_id' options="{'no_create': true}"/> |
53 | 60 | <field name='bedrooms'/>
|
54 | 61 | <field name='living_area'/>
|
55 | 62 | <field name='facades'/>
|
56 | 63 | <field name='garden'/>
|
57 | 64 | <field name='garage'/>
|
58 |
| - <field name='garden_area'/> |
59 |
| - <field name='garden_orientation'/> |
| 65 | + <field name='garden_area' invisible="not garden"/> |
| 66 | + <field name='garden_orientation' invisible="not garden"/> |
60 | 67 | <field name='total_area'/>
|
61 | 68 | </group>
|
62 | 69 | </page>
|
63 | 70 | <page string='Offers'>
|
64 |
| - <field name='offer_ids'/> |
| 71 | + <field name='offer_ids' readonly="state == 'offer_accepted' or state == 'sold' or state == 'cancelled'"/> |
65 | 72 | </page>
|
66 | 73 | <page string='Other'>
|
67 | 74 | <group>
|
|
87 | 94 | <field name='expected_price'/>
|
88 | 95 | <field name='facades'/>
|
89 | 96 | <field name='tag_ids'/>
|
| 97 | + <field name="living_area" filter_domain="[('living_area', '>=', self)]"/> |
90 | 98 | <separator/>
|
91 | 99 | <filter string="Include archived" name="archived" domain="['|', ('active', '=', True), ('active', '=', False)]"/>
|
92 | 100 | <filter string="Available Properties" name="available" domain="['|', ('state', '=', 'new'), ('state', '=', 'offer_received')]"/>
|
93 | 101 | <separator/>
|
| 102 | + <filter string='State' name='state' context="{'group_by':'state', 'residual_visible':True}"/> |
94 | 103 | <filter string='Postcode' name='postcode' context="{'group_by':'postcode', 'residual_visible':True}"/>
|
95 | 104 | <filter string='Property Type' name='property_type_id' context="{'group_by':'property_type_id', 'residual_visible':True}"/>
|
96 | 105 | </search>
|
|
0 commit comments