mirror of
https://gitlab.com/sonalarora/tra_backend.git
synced 2025-12-17 18:29:08 +02:00
Merge branch 'master' of https://gitlab.com/sonalarora/tra_backend
This commit is contained in:
1
reports/__init__.py
Normal file
1
reports/__init__.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
from . import account
|
||||||
23
reports/__manifest__.py
Normal file
23
reports/__manifest__.py
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
'name': 'Reports',
|
||||||
|
'version': '13.0.1.0.0',
|
||||||
|
'summary': 'Reports for sale, account etc.',
|
||||||
|
'description': """
|
||||||
|
""",
|
||||||
|
'category': 'tools',
|
||||||
|
'author': "",
|
||||||
|
'company': '',
|
||||||
|
'maintainer': '',
|
||||||
|
'website': "",
|
||||||
|
'depends': [
|
||||||
|
'base', 'account', 'bi_professional_reports_templates'
|
||||||
|
],
|
||||||
|
'data': [
|
||||||
|
'views/invoice_report.xml',
|
||||||
|
],
|
||||||
|
'demo': [],
|
||||||
|
'images': [],
|
||||||
|
'installable': True,
|
||||||
|
'auto_install': False,
|
||||||
|
'application': False,
|
||||||
|
}
|
||||||
BIN
reports/__pycache__/__init__.cpython-36.pyc
Normal file
BIN
reports/__pycache__/__init__.cpython-36.pyc
Normal file
Binary file not shown.
BIN
reports/__pycache__/account.cpython-36.pyc
Normal file
BIN
reports/__pycache__/account.cpython-36.pyc
Normal file
Binary file not shown.
24
reports/account.py
Normal file
24
reports/account.py
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
from odoo import models, api, fields
|
||||||
|
from datetime import date
|
||||||
|
|
||||||
|
|
||||||
|
class AccountMove(models.Model):
|
||||||
|
_inherit = "account.move"
|
||||||
|
txn_id = fields.Char("Transaction ID")
|
||||||
|
signed_by = fields.Char("signed by", compute='compute_signature')
|
||||||
|
print_date = fields.Date("Print date", compute='compute_print_date')
|
||||||
|
|
||||||
|
def compute_print_date(self):
|
||||||
|
for rec in self:
|
||||||
|
if rec.invoice_origin:
|
||||||
|
sale_id = self.env['sale.order'].sudo().search([('name', '=', rec.invoice_origin)])
|
||||||
|
for doc in sale_id:
|
||||||
|
rec.print_date = doc.signed_on
|
||||||
|
|
||||||
|
|
||||||
|
def compute_signature(self):
|
||||||
|
for rec in self:
|
||||||
|
if rec.invoice_origin:
|
||||||
|
sale_id = self.env['sale.order'].sudo().search([('name', '=', rec.invoice_origin)])
|
||||||
|
for doc in sale_id:
|
||||||
|
rec.signed_by = doc.signed_by
|
||||||
94
reports/views/invoice_report.xml
Normal file
94
reports/views/invoice_report.xml
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<odoo>
|
||||||
|
<record id="account_invoice_inherit_form_view2" model="ir.ui.view">
|
||||||
|
<field name="name">account_invoice_inherit.inherit_form_view</field>
|
||||||
|
<field name="model">account.move</field>
|
||||||
|
<field name="inherit_id" ref="account.view_move_form" />
|
||||||
|
<field name="type">form</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<xpath expr="//field[@name='journal_id']" position="after">
|
||||||
|
<field name="txn_id"/>
|
||||||
|
</xpath>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
<template id="report_invoices_inherit1" inherit_id="bi_professional_reports_templates.fency_report_invoice_document">
|
||||||
|
<xpath expr="//t[@t-call='web.external_layout']/div/div[1]" position="before">
|
||||||
|
<strong>TRN#</strong>
|
||||||
|
<span t-esc="o.txn_id"/><br/>
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="//t[@t-call='web.external_layout']/div/div[2]" position="before">
|
||||||
|
<strong>TRN#</strong>
|
||||||
|
<span t-esc="o.txn_id"/><br/>
|
||||||
|
<strong>YOUR ORDER NO:</strong><br/>
|
||||||
|
<div class="text-right"><strong>D.O.NOS</strong><br/></div>
|
||||||
|
<div class="text-right"><strong>M.R.V NO.</strong><br/></div>
|
||||||
|
<strong>Sale Code:</strong>
|
||||||
|
<span t-esc="o.invoice_origin"/>
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="//t[@t-call='web.external_layout']/div/p[last()]" position="after">
|
||||||
|
<p>E & OE</p><br/>
|
||||||
|
<span>Print Date: <span t-esc="o.print_date"/></span><br/>
|
||||||
|
<span>Signed by: <span t-esc="o.signed_by"/></span>
|
||||||
|
</xpath>
|
||||||
|
</template>
|
||||||
|
<template id="report_invoices_inherit2" inherit_id="bi_professional_reports_templates.classic_report_invoice_document">
|
||||||
|
<xpath expr="//t[@t-call='web.external_layout']/div/div[1]" position="before">
|
||||||
|
<strong>TRN#</strong>
|
||||||
|
<span t-esc="o.txn_id"/><br/>
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="//t[@t-call='web.external_layout']/div/div[2]" position="before">
|
||||||
|
<strong>TRN#</strong>
|
||||||
|
<span t-esc="o.txn_id"/><br/>
|
||||||
|
<strong>YOUR ORDER NO:</strong><br/>
|
||||||
|
<div class="text-right"><strong>D.O.NOS</strong><br/></div>
|
||||||
|
<div class="text-right"><strong>M.R.V NO.</strong><br/></div>
|
||||||
|
<strong>Sale Code:</strong>
|
||||||
|
<span t-esc="o.invoice_origin"/>
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="//t[@t-call='web.external_layout']/div/p[last()]" position="after">
|
||||||
|
<p>E & OE</p><br/>
|
||||||
|
<span>Print Date: <span t-esc="o.print_date"/></span><br/>
|
||||||
|
<span>Signed by: <span t-esc="o.signed_by"/></span>
|
||||||
|
</xpath>
|
||||||
|
</template>
|
||||||
|
<template id="report_invoices_inherit3" inherit_id="bi_professional_reports_templates.modern_report_invoice_document">
|
||||||
|
<xpath expr="//t[@t-call='web.external_layout']/div/div[1]" position="before">
|
||||||
|
<strong>TRN#</strong>
|
||||||
|
<span t-esc="o.txn_id"/><br/>
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="//t[@t-call='web.external_layout']/div/div[2]" position="before">
|
||||||
|
<strong>TRN#</strong>
|
||||||
|
<span t-esc="o.txn_id"/><br/>
|
||||||
|
<strong>YOUR ORDER NO:</strong><br/>
|
||||||
|
<div class="text-right"><strong>D.O.NOS</strong><br/></div>
|
||||||
|
<div class="text-right"><strong>M.R.V NO.</strong><br/></div>
|
||||||
|
<strong>Sale Code:</strong>
|
||||||
|
<span t-esc="o.invoice_origin"/>
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="//t[@t-call='web.external_layout']/div/p[last()]" position="after">
|
||||||
|
<p>E & OE</p><br/>
|
||||||
|
<span>Print Date: <span t-esc="o.print_date"/></span><br/>
|
||||||
|
<span>Signed by: <span t-esc="o.signed_by"/></span>
|
||||||
|
</xpath>
|
||||||
|
</template>
|
||||||
|
<template id="report_invoices_inherit4" inherit_id="bi_professional_reports_templates.odoo_std_report_invoice_document">
|
||||||
|
<xpath expr="//t[@t-call='web.external_layout']/div/div[1]" position="before">
|
||||||
|
<strong>TRN#</strong>
|
||||||
|
<span t-esc="o.txn_id"/><br/>
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="//t[@t-call='web.external_layout']/div/div[2]" position="before">
|
||||||
|
<strong>TRN#</strong>
|
||||||
|
<span t-esc="o.txn_id"/><br/>
|
||||||
|
<strong>YOUR ORDER NO:</strong><br/>
|
||||||
|
<div class="text-right"><strong>D.O.NOS</strong><br/></div>
|
||||||
|
<div class="text-right"><strong>M.R.V NO.</strong><br/></div>
|
||||||
|
<strong>Sale Code:</strong>
|
||||||
|
<span t-esc="o.invoice_origin"/>
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="//t[@t-call='web.external_layout']/div/p[last()]" position="after">
|
||||||
|
<p>E & OE</p><br/>
|
||||||
|
<span>Print Date: <span t-esc="o.print_date"/></span><br/>
|
||||||
|
<span>Signed by: <span t-esc="o.signed_by"/></span>
|
||||||
|
</xpath>
|
||||||
|
</template>
|
||||||
|
</odoo>
|
||||||
Reference in New Issue
Block a user