-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[14.0][ADD] pos_custom_report_session
- Loading branch information
1 parent
0fe6c8e
commit 78b3d69
Showing
8 changed files
with
112 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Copyright 2023 Akretion (https://www.akretion.com). | ||
# @author Chafique Delli <[email protected]> | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
{ | ||
"name": "POS Custom Report Session", | ||
"version": "14.0.1.0.0", | ||
"category": "Point Of Sale", | ||
"author": "Akretion", | ||
"website": "https://github.com/akretion/ak-odoo-incubator", | ||
"license": "AGPL-3", | ||
"depends": [ | ||
"pos_report_session_summary", | ||
"pos_sale_order", | ||
], | ||
"data": [ | ||
"views/report_session_summary.xml", | ||
], | ||
"qweb": [], | ||
"installable": True, | ||
} |
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,2 @@ | ||
from . import account_statement_line | ||
from . import pos_payment |
13 changes: 13 additions & 0 deletions
13
pos_custom_report_session/models/account_statement_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,13 @@ | ||
# Copyright 2023 Akretion (https://www.akretion.com). | ||
# @author Chafique Delli <[email protected]> | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import fields, models | ||
|
||
|
||
class AccountBankStatementLine(models.Model): | ||
_inherit = "account.bank.statement.line" | ||
|
||
pos_payment_ids = fields.One2many( | ||
"pos.payment", "statement_line_id", "Pos Payments" | ||
) |
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,13 @@ | ||
# Copyright 2023 Akretion (https://www.akretion.com). | ||
# @author Chafique Delli <[email protected]> | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import fields, models | ||
|
||
|
||
class AccountBankStatementLine(models.Model): | ||
_inherit = "account.bank.statement.line" | ||
|
||
pos_payment_ids = fields.One2many( | ||
"pos.payment", "statement_line_id", "Pos Payments" | ||
) |
55 changes: 55 additions & 0 deletions
55
pos_custom_report_session/views/report_session_summary.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,55 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<odoo> | ||
<template | ||
id="report_session_summary" | ||
inherit_id="pos_report_session_summary.report_session_summary" | ||
> | ||
<xpath expr="//div/t/table" position="replace"> | ||
<table class="table table-sm o_main_table" t-if="statement.line_ids"> | ||
<thead> | ||
<tr> | ||
<th>Date</th> | ||
<th>Description</th> | ||
<th>Reference</th> | ||
<th>Partner</th> | ||
<th class="text-right">Amount</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<t t-foreach="statement.line_ids" t-as="line"> | ||
<t t-if="line.pos_payment_ids"> | ||
<tr t-foreach="line.pos_payment_ids" t-as="payment"> | ||
|
||
<td><span t-field="payment.payment_date" /></td> | ||
<td><span t-field="line.name" /></td> | ||
<td> | ||
<span t-field="payment.name" /> | ||
<span t-field="payment.pos_sale_order_id.name" /> | ||
</td> | ||
<td><span t-field="payment.partner_id" /></td> | ||
<td class="text-right"> | ||
<span | ||
t-field="payment.amount" | ||
t-field-options='{"widget": "monetary", "display_currency": "statement.currency_id"}' | ||
/> | ||
</td> | ||
</tr> | ||
</t> | ||
<tr t-else=""> | ||
<td><span t-field="line.date" /></td> | ||
<td><span t-field="line.name" /></td> | ||
<td><span t-field="line.payment_ref" /></td> | ||
<td><span t-field="line.partner_id" /></td> | ||
<td class="text-right"> | ||
<span | ||
t-field="line.amount" | ||
t-field-options='{"widget": "monetary", "display_currency": "statement.currency_id"}' | ||
/> | ||
</td> | ||
</tr> | ||
</t> | ||
</tbody> | ||
</table> | ||
</xpath> | ||
</template> | ||
</odoo> |
1 change: 1 addition & 0 deletions
1
setup/pos_custom_report_session/odoo/addons/pos_custom_report_session
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 @@ | ||
../../../../pos_custom_report_session |
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,6 @@ | ||
import setuptools | ||
|
||
setuptools.setup( | ||
setup_requires=['setuptools-odoo'], | ||
odoo_addon=True, | ||
) |