|
24 | 24 | <field
|
25 | 25 | name="partner_id"
|
26 | 26 | string="Supplier"
|
27 |
| - attrs="{'invisible': [('request_type','=','customer')]}" |
| 27 | + invisible="request_type == 'customer'" |
28 | 28 | />
|
29 | 29 | </xpath>
|
30 | 30 | <xpath
|
|
34 | 34 | <field
|
35 | 35 | name="partner_id"
|
36 | 36 | string="Customer"
|
37 |
| - attrs="{'invisible': [('request_type','!=','customer')]}" |
| 37 | + invisible="request_type != 'customer'" |
38 | 38 | />
|
39 | 39 | </xpath>
|
40 | 40 | <field name="user_id" position="attributes">
|
|
52 | 52 | <field name="view_mode">form</field>
|
53 | 53 | <field
|
54 | 54 | name="context"
|
55 |
| - >{'search_default_partner_id': active_id, 'default_partner_id': active_id}</field> |
56 |
| - <field name="groups_id" eval="[(4, ref('purchase.group_purchase_user'))]" /> |
| 55 | + >{'search_default_partner_id': id, 'default_partner_id': id}</field> |
57 | 56 | </record>
|
58 | 57 |
|
59 | 58 | <record id="crm_case_form_view_oppor" model="ir.ui.view">
|
|
65 | 64 | expr="//button[@name='action_sale_quotations_new']"
|
66 | 65 | position="attributes"
|
67 | 66 | >
|
| 67 | + <!-- addition to `type == 'lead' or probability == 0 and not active` --> |
68 | 68 | <attribute
|
69 |
| - name="attrs" |
70 |
| - >{'invisible': ['|', ('request_type', '=', 'supplier'), '|', ('type', '=', 'lead'), '&', ('probability', '=', 0), ('active', '=', False)]}</attribute> |
| 69 | + name="invisible" |
| 70 | + add="request_type == 'supplier'" |
| 71 | + separator="or" |
| 72 | + /> |
71 | 73 | </xpath>
|
72 | 74 | <xpath expr="//button[@name='action_set_won_rainbowman']" position="before">
|
73 | 75 | <button
|
74 | 76 | string="New RFQ"
|
75 | 77 | name="action_lead_rfq_new"
|
76 | 78 | type="object"
|
77 | 79 | class="oe_highlight"
|
78 |
| - attrs="{'invisible': ['|', ('request_type', '!=', 'supplier'), '|', ('type', '=', 'lead'), '&', ('probability', '=', 0), ('active', '=', False)]}" |
| 80 | + invisible="request_type != 'supplier' or type == 'lead' or (probability == 0 and not active)" |
| 81 | + groups="purchase.group_purchase_user" |
79 | 82 | />
|
80 | 83 | </xpath>
|
81 | 84 | <xpath
|
82 | 85 | expr="//button[@name='action_view_sale_quotation']"
|
83 | 86 | position="attributes"
|
84 | 87 | >
|
| 88 | + <!-- addition to `type == 'lead'` --> |
85 | 89 | <attribute
|
86 |
| - name="attrs" |
87 |
| - >{'invisible': ['|', ('request_type', '=', 'supplier'), ('type', '=', 'lead')]}</attribute> |
| 90 | + name="invisible" |
| 91 | + add="request_type == 'supplier'" |
| 92 | + separator="or" |
| 93 | + /> |
88 | 94 | </xpath>
|
89 | 95 | <xpath
|
90 | 96 | expr="//button[@name='action_view_sale_order']"
|
91 | 97 | position="attributes"
|
92 | 98 | >
|
| 99 | + <!-- addition to `sale_order_count == 0 or type == 'lead'` --> |
93 | 100 | <attribute
|
94 |
| - name="attrs" |
95 |
| - >{'invisible': ['|', '|', ('request_type', '=', 'supplier'), ('sale_order_count', '=', 0), ('type', '=', 'lead')]}</attribute> |
| 101 | + name="invisible" |
| 102 | + add="request_type == 'supplier'" |
| 103 | + separator="or" |
| 104 | + /> |
96 | 105 | </xpath>
|
97 | 106 |
|
98 | 107 | <button name="action_schedule_meeting" position="after">
|
|
101 | 110 | type="object"
|
102 | 111 | name="action_view_sale_quotation"
|
103 | 112 | icon="fa-pencil-square-o"
|
104 |
| - attrs="{'invisible': [('type', '=', 'lead')]}" |
| 113 | + invisible="type == 'lead'" |
105 | 114 | >
|
106 | 115 | <field
|
107 | 116 | name="request_for_quotation_count"
|
|
112 | 121 | <button
|
113 | 122 | class="oe_stat_button"
|
114 | 123 | type="object"
|
115 |
| - attrs="{'invisible': ['|', ('purchase_amount_total', '=', 0), ('type', '=', 'lead')]}" |
| 124 | + invisible="purchase_amount_total == 0 or type == 'lead'" |
116 | 125 | name="action_view_sale_order"
|
117 | 126 | icon="fa-usd"
|
118 | 127 | >
|
|
146 | 155 | <record id="srm_lead_action_pipeline" model="ir.actions.act_window">
|
147 | 156 | <field name="name">Srm: Pipeline</field>
|
148 | 157 | <field name="res_model">crm.lead</field>
|
149 |
| - <field name="view_mode">kanban,tree,graph,pivot,form,calendar,activity</field> |
| 158 | + <field name="view_mode">kanban,list,graph,pivot,form,calendar,activity</field> |
150 | 159 | <field
|
151 | 160 | name="domain"
|
152 | 161 | >[('type','=','opportunity'), ('request_type','=', 'supplier')]</field>
|
|
162 | 171 | <field name="name">Srm: My Pipeline</field>
|
163 | 172 | <field name="model_id" ref="crm.model_crm_team" />
|
164 | 173 | <field name="state">code</field>
|
165 |
| - <field name="groups_id" eval="[(4, ref('base.group_user'))]" /> |
166 | 174 | <field
|
167 | 175 | name="code"
|
168 | 176 | >action = model.with_context(request_type='supplier').action_your_pipeline()</field>
|
|
172 | 180 | <record id="srm_lead_all_leads" model="ir.actions.act_window">
|
173 | 181 | <field name="name">Leads</field>
|
174 | 182 | <field name="res_model">crm.lead</field>
|
175 |
| - <field name="view_mode">tree,kanban,graph,pivot,calendar,form,activity</field> |
| 183 | + <field name="view_mode">list,kanban,graph,pivot,calendar,form,activity</field> |
176 | 184 | <field
|
177 | 185 | name="domain"
|
178 | 186 | >['&','|', ('type','=','lead'), ('type','=',False), ('request_type', '=', 'supplier')]</field>
|
|
190 | 198 | <record id="srm_lead_action_dashboard" model="ir.actions.act_window">
|
191 | 199 | <field name="name">Srm Leads Analysis</field>
|
192 | 200 | <field name="res_model">crm.lead</field>
|
193 |
| - <field name="view_mode">dashboard,pivot,graph,tree</field> |
| 201 | + <field name="view_mode">pivot,graph,list</field> |
194 | 202 | <field
|
195 | 203 | name="domain"
|
196 | 204 | >['&', ('request_type','=', 'supplier'), '|', ('active','=',True), ('active','=',False)]</field>
|
|
201 | 209 | <record id="srm_opportunity_action_dashboard" model="ir.actions.act_window">
|
202 | 210 | <field name="name">Pipeline Analysis</field>
|
203 | 211 | <field name="res_model">crm.lead</field>
|
204 |
| - <field name="view_mode">dashboard,pivot,graph,tree,form,cohort</field> |
| 212 | + <field name="view_mode">pivot,graph,list,form,cohort</field> |
205 | 213 | <field name="domain">[('request_type','=', 'supplier')]</field>
|
206 | 214 | <field
|
207 | 215 | name="context"
|
208 | 216 | eval="{
|
209 |
| - 'tree_view_ref': 'crm.crm_case_tree_view_oppor', |
| 217 | + 'list_view_ref': 'crm.crm_case_tree_view_oppor', |
210 | 218 | 'default_type': 'opportunity',
|
211 | 219 | 'search_default_opportunity': True,
|
212 | 220 | 'search_default_filter_create_date': 1}"
|
213 | 221 | />
|
214 |
| - <field name="search_view_id" ref="crm_enterprise.crm_opportunity_view_search" /> |
| 222 | + <field name="search_view_id" ref="crm.crm_opportunity_report_view_search" /> |
215 | 223 | </record>
|
216 | 224 |
|
217 | 225 | <!-- menuitem -->
|
|
233 | 241 |
|
234 | 242 | <record id="menu_srm_opportunities" model="ir.ui.menu">
|
235 | 243 | <field name="action" ref="srm.action_your_pipeline" />
|
| 244 | + <field name="groups_id" eval="[Command.link(ref('base.group_user'))]" /> |
236 | 245 | </record>
|
237 | 246 | </odoo>
|
0 commit comments