Skip to content

Commit 9ed79cf

Browse files
committed
Merge PR #2608 into 17.0
Signed-off-by pedrobaeza
2 parents 18f9a61 + dcc5f27 commit 9ed79cf

File tree

7 files changed

+74
-13
lines changed

7 files changed

+74
-13
lines changed

purchase_request/data/purchase_request_sequence.xml

+1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@
77
<field name="code">purchase.request</field>
88
<field name="prefix">PR</field>
99
<field name="padding">5</field>
10+
<field name="company_id" />
1011
</record>
1112
</odoo>

purchase_request/models/purchase_request_line.py

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ class PurchaseRequestLine(models.Model):
4444
related="request_id.company_id",
4545
string="Company",
4646
store=True,
47+
index=True,
4748
)
4849
requested_by = fields.Many2one(
4950
comodel_name="res.users",

purchase_request/views/purchase_request_line_view.xml

-1
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,6 @@
578578
<field name="qty_in_progress" />
579579
<field name="qty_done" />
580580
</group>
581-
<newline />
582581
<field name="purchase_lines" nolabel="1" />
583582
</page>
584583
</notebook>

purchase_request/views/purchase_request_view.xml

+61-7
Original file line numberDiff line numberDiff line change
@@ -133,14 +133,19 @@
133133
readonly="is_editable == False"
134134
/>
135135
<field name="description" readonly="is_editable == False" />
136-
<field name="group_id" readonly="is_editable == False" />
136+
<field
137+
name="group_id"
138+
readonly="is_editable == False"
139+
groups="base.group_no_one"
140+
/>
137141
</group>
138142
<group>
139143
<field name="date_start" readonly="is_editable == False" />
140144
<field
141145
name="picking_type_id"
142146
readonly="is_editable == False"
143147
/>
148+
<field name="company_id" invisible="1" />
144149
<field
145150
name="company_id"
146151
groups="base.group_multi_company"
@@ -181,11 +186,6 @@
181186
<field name="date_required" />
182187
<field name="estimated_cost" widget="monetary" />
183188
<field name="currency_id" column_invisible="1" />
184-
<field
185-
name="company_id"
186-
groups="base.group_multi_company"
187-
widget="selection"
188-
/>
189189
<field name="cancelled" column_invisible="1" />
190190
<field name="is_editable" column_invisible="1" />
191191
<field name="purchased_qty" />
@@ -371,11 +371,65 @@
371371
</search>
372372
</field>
373373
</record>
374+
<record id="view_purchase_request_kanban" model="ir.ui.view">
375+
<field name="name">purchase.request.kanban</field>
376+
<field name="model">purchase.request</field>
377+
<field name="arch" type="xml">
378+
<kanban class="o_kanban_mobile" quick_create="false">
379+
<field name="name" />
380+
<field name="requested_by" readonly="1" />
381+
<field name="estimated_cost" />
382+
<field name="state" />
383+
<field name="date_start" />
384+
<field name="currency_id" readonly="1" />
385+
<field name="activity_state" />
386+
<progressbar
387+
field="activity_state"
388+
colors="{&quot;planned&quot;: &quot;success&quot;, &quot;today&quot;: &quot;warning&quot;, &quot;overdue&quot;: &quot;danger&quot;}"
389+
/>
390+
<templates>
391+
<t t-name="kanban-box">
392+
<div t-attf-class="oe_kanban_card oe_kanban_global_click">
393+
<div class="o_kanban_record_top mb16">
394+
<div class="o_kanban_record_headings ms-1">
395+
<strong class="o_kanban_record_title"><span><t
396+
t-esc="record.requested_by.value"
397+
/></span></strong>
398+
</div>
399+
<strong><field
400+
name="estimated_cost"
401+
widget="monetary"
402+
/></strong>
403+
</div>
404+
<div class="o_kanban_record_bottom">
405+
<div class="oe_kanban_bottom_left">
406+
<span><t t-esc="record.name.value" /> <t
407+
t-esc="record.date_start.value"
408+
/></span>
409+
<field
410+
name="activity_ids"
411+
widget="kanban_activity"
412+
/>
413+
</div>
414+
<div class="oe_kanban_bottom_right">
415+
<field
416+
name="state"
417+
widget="label_selection"
418+
options="{'classes': {'draft': 'default', 'rejected': 'default', 'done': 'success', 'approved': 'warning'}}"
419+
/>
420+
</div>
421+
</div>
422+
</div>
423+
</t>
424+
</templates>
425+
</kanban>
426+
</field>
427+
</record>
374428
<record model="ir.actions.act_window" id="purchase_request_form_action">
375429
<field name="name">Purchase Requests</field>
376430
<field name="type">ir.actions.act_window</field>
377431
<field name="res_model">purchase.request</field>
378-
<field name="view_mode">tree,form</field>
432+
<field name="view_mode">tree,kanban,form</field>
379433
<field name="context">{"search_default_requested_by":uid}</field>
380434
<field name="search_view_id" ref="view_purchase_request_search" />
381435
<field name="help" type="html">

purchase_request_tier_validation/__manifest__.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
"installable": True,
1414
"depends": ["purchase_request", "base_tier_validation"],
1515
"data": [
16-
"data/purchase_request_tier_definition.xml",
1716
"views/purchase_request_view.xml",
1817
],
18+
"demo": [
19+
"demo/tier_definition.xml",
20+
],
1921
}

purchase_request_tier_validation/data/purchase_request_tier_definition.xml purchase_request_tier_validation/demo/tier_definition.xml

+1
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@
1111
name="reviewer_group_id"
1212
ref='purchase_request.group_purchase_request_manager'
1313
/>
14+
<field name="company_id" /> <!-- no company set by default -->
1415
</record>
1516
</odoo>

purchase_request_tier_validation/static/description/index.html

+7-4
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@
88

99
/*
1010
:Author: David Goodger ([email protected])
11-
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
11+
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
1212
:Copyright: This stylesheet has been placed in the public domain.
1313
1414
Default cascading style sheet for the HTML output of Docutils.
15+
Despite the name, some widely supported CSS2 features are used.
1516
1617
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
1718
customize this style sheet.
@@ -274,7 +275,7 @@
274275
margin-left: 2em ;
275276
margin-right: 2em }
276277

277-
pre.code .ln { color: grey; } /* line numbers */
278+
pre.code .ln { color: gray; } /* line numbers */
278279
pre.code, code { background-color: #eeeeee }
279280
pre.code .comment, code .comment { color: #5C6576 }
280281
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
@@ -300,7 +301,7 @@
300301
span.pre {
301302
white-space: pre }
302303

303-
span.problematic {
304+
span.problematic, pre.problematic {
304305
color: red }
305306

306307
span.section-subtitle {
@@ -458,7 +459,9 @@ <h3><a class="toc-backref" href="#toc-entry-9">Images</a></h3>
458459
<div class="section" id="maintainers">
459460
<h2><a class="toc-backref" href="#toc-entry-10">Maintainers</a></h2>
460461
<p>This module is maintained by the OCA.</p>
461-
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
462+
<a class="reference external image-reference" href="https://odoo-community.org">
463+
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
464+
</a>
462465
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
463466
mission is to support the collaborative development of Odoo features and
464467
promote its widespread use.</p>

0 commit comments

Comments
 (0)