-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMP] joint_buying_product_food : display frozen / cold / etc.. on jo…
…int.buying.tour report
- Loading branch information
1 parent
2c0c8a2
commit 8764760
Showing
9 changed files
with
75 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import joint_buying_transport_request_line |
30 changes: 30 additions & 0 deletions
30
joint_buying_product_food/models/joint_buying_transport_request_line.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Copyright (C) 2023-Today: GRAP (http://www.grap.coop) | ||
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
from odoo import models | ||
|
||
|
||
class JointBuyingTransportRequestLine(models.Model): | ||
_inherit = "joint.buying.transport.request.line" | ||
|
||
def get_report_information(self): | ||
self.ensure_one() | ||
res = super().get_report_information() | ||
if self.request_id.order_id: | ||
return { | ||
"normal": [ | ||
x for x in filter(lambda x: x[0].storage_method, res["all"]) | ||
], | ||
"cool": [ | ||
x | ||
for x in filter(lambda x: x[0].storage_method == "cool", res["all"]) | ||
], | ||
"frozen": [ | ||
x | ||
for x in filter( | ||
lambda x: x[0].storage_method == "frozen", res["all"] | ||
) | ||
], | ||
} | ||
return res | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
* https://www.flaticon.com/fr/icone-gratuite/thermometres_2756893 | ||
by https://www.flaticon.com/fr/auteurs/fauzidea | ||
|
||
* https://www.flaticon.com/fr/icone-gratuite/temperature_2322701 | ||
by https://www.flaticon.com/fr/auteurs/nawicon | ||
|
||
* https://www.flaticon.com/fr/icone-gratuite/bonhomme-de-neige_1331175 | ||
by https://www.flaticon.com/fr/auteurs/freepik |
30 changes: 30 additions & 0 deletions
30
joint_buying_product_food/reports/report_joint_buying_tour.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Copyright (C) 2023 - Today: GRAP (http://www.grap.coop) | ||
@author: Sylvain LE GAL (https://twitter.com/legalsylvain) | ||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
--> | ||
<odoo> | ||
|
||
<template id="report_joint_buying_tour_document_request_lines" inherit_id="joint_buying_product.report_joint_buying_tour_document_request_lines"> | ||
|
||
<xpath expr="//t[@t-as='line_info']" position="before"> | ||
<span t-if="all_infos[key] and key == 'normal'" style="float:left;"> | ||
<img style="width:32px;height:32px;" | ||
t-att-src="'/joint_buying_product_food/static/description/normal.png'"/> | ||
</span> | ||
|
||
<span t-if="all_infos[key] and key == 'cool'" style="float:left;"> | ||
<img style="width:32px;height:32px;" | ||
t-att-src="'/joint_buying_product_food/static/description/cool.png'"/> | ||
</span> | ||
|
||
<span t-if="all_infos[key] and key == 'frozen'" style="float:left;"> | ||
<img style="width:32px;height:32px;" | ||
t-att-src="'/joint_buying_product_food/static/description/frozen.png'"/> | ||
</span> | ||
</xpath> | ||
|
||
</template> | ||
|
||
</odoo> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.