Skip to content

Commit 693b015

Browse files
committed
Merge PR #2609 into 18.0
Signed-off-by pedrobaeza
2 parents 9e8ac7c + 95d2e99 commit 693b015

File tree

8 files changed

+74
-22
lines changed

8 files changed

+74
-22
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
@@ -577,7 +577,6 @@
577577
<field name="qty_in_progress" />
578578
<field name="qty_done" />
579579
</group>
580-
<newline />
581580
<field name="purchase_lines" nolabel="1" />
582581
</page>
583582
</notebook>

purchase_request/views/purchase_request_view.xml

+54-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" />
@@ -366,11 +366,58 @@
366366
</search>
367367
</field>
368368
</record>
369+
<record id="view_purchase_request_kanban" model="ir.ui.view">
370+
<field name="name">purchase.request.kanban</field>
371+
<field name="model">purchase.request</field>
372+
<field name="arch" type="xml">
373+
<kanban class="o_kanban_mobile" quick_create="false">
374+
<field name="name" />
375+
<field name="requested_by" readonly="1" />
376+
<field name="estimated_cost" />
377+
<field name="state" />
378+
<field name="date_start" />
379+
<field name="currency_id" readonly="1" />
380+
<field name="activity_state" />
381+
<progressbar
382+
field="activity_state"
383+
colors="{&quot;planned&quot;: &quot;success&quot;, &quot;today&quot;: &quot;warning&quot;, &quot;overdue&quot;: &quot;danger&quot;}"
384+
/>
385+
<templates>
386+
<t t-name="card">
387+
<div class="d-flex align-items-baseline">
388+
<field name="requested_by" class="fw-bolder fs-5 me-2" />
389+
<field
390+
name="estimated_cost"
391+
widget="monetary"
392+
class="fw-bolder ms-auto flex-shrink-0"
393+
/>
394+
</div>
395+
<footer class="align-items-end">
396+
<div class="d-flex flex-wrap gap-1 text-nowrap">
397+
<field name="name" />
398+
<field
399+
name="date_start"
400+
options="{'show_time': false}"
401+
/>
402+
<field name="activity_ids" widget="kanban_activity" />
403+
</div>
404+
<field
405+
name="state"
406+
widget="label_selection"
407+
options="{'classes': {'draft': 'default', 'cancel': 'default', 'done': 'success', 'approved': 'warning'}}"
408+
class="ms-auto"
409+
/>
410+
</footer>
411+
</t>
412+
</templates>
413+
</kanban>
414+
</field>
415+
</record>
369416
<record model="ir.actions.act_window" id="purchase_request_form_action">
370417
<field name="name">Purchase Requests</field>
371418
<field name="type">ir.actions.act_window</field>
372419
<field name="res_model">purchase.request</field>
373-
<field name="view_mode">list,form</field>
420+
<field name="view_mode">list,kanban,form</field>
374421
<field name="context">{"search_default_requested_by":uid}</field>
375422
<field name="search_view_id" ref="view_purchase_request_search" />
376423
<field name="help" type="html">

purchase_request_tier_validation/README.rst

+9-9
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@ To use this module, you need to:
6666

6767
Additional features:
6868

69-
- You can filter the Purchase Request requesting your review through the
70-
filter *Needs my Review*.
71-
- User with rights to confirm the Purchase Request (validate all tiers
72-
that would be generated) can directly do the operation, this is, there
73-
is no need for her/him to request a validation.
69+
- You can filter the Purchase Request requesting your review through
70+
the filter *Needs my Review*.
71+
- User with rights to confirm the Purchase Request (validate all tiers
72+
that would be generated) can directly do the operation, this is,
73+
there is no need for her/him to request a validation.
7474

7575
Bug Tracker
7676
===========
@@ -93,18 +93,18 @@ Authors
9393
Contributors
9494
------------
9595

96-
- Adria Gil <[email protected]>
97-
- `Komit <https://komit-consulting.com>`__:
96+
- Adria Gil <[email protected]>
97+
- `Komit <https://komit-consulting.com>`__:
9898

99-
- Quan.nhm <[email protected]>
99+
- Quan.nhm <[email protected]>
100100

101101
Other credits
102102
-------------
103103

104104
Images
105105
~~~~~~
106106

107-
- Enric Tobella (logo)
107+
- Enric Tobella (logo)
108108

109109
Maintainers
110110
-----------

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

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

purchase_request_tier_validation/static/description/index.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -418,11 +418,11 @@ <h1><a class="toc-backref" href="#toc-entry-3">Usage</a></h1>
418418
</ol>
419419
<p>Additional features:</p>
420420
<ul class="simple">
421-
<li>You can filter the Purchase Request requesting your review through the
422-
filter <em>Needs my Review</em>.</li>
421+
<li>You can filter the Purchase Request requesting your review through
422+
the filter <em>Needs my Review</em>.</li>
423423
<li>User with rights to confirm the Purchase Request (validate all tiers
424-
that would be generated) can directly do the operation, this is, there
425-
is no need for her/him to request a validation.</li>
424+
that would be generated) can directly do the operation, this is,
425+
there is no need for her/him to request a validation.</li>
426426
</ul>
427427
</div>
428428
<div class="section" id="bug-tracker">

0 commit comments

Comments
 (0)