mirror of
https://gitlab.com/sonalarora/tra_backend.git
synced 2025-12-18 02:39:10 +02:00
add new module of template
This commit is contained in:
@@ -1,27 +1,19 @@
|
|||||||
from odoo import models, api, fields
|
from odoo import models, api, fields
|
||||||
import datetime
|
|
||||||
from datetime import date
|
from datetime import date
|
||||||
|
|
||||||
|
|
||||||
class AccountMove(models.Model):
|
class AccountMove(models.Model):
|
||||||
_inherit = "account.move"
|
_inherit = "account.move"
|
||||||
txn_id = fields.Char("Transaction ID")
|
txn_id = fields.Char("Transaction ID")
|
||||||
signed_by = fields.Char("signed by", compute='compute_signature')
|
signed_by = fields.Char("Printed by", compute='compute_signature')
|
||||||
print_date = fields.Date("Print date", compute='compute_print_date')
|
print_date = fields.Date("Print date", compute='compute_print_date')
|
||||||
|
note = fields.Text("Note")
|
||||||
|
|
||||||
def compute_print_date(self):
|
def compute_print_date(self):
|
||||||
for rec in self:
|
for rec in self:
|
||||||
if rec.invoice_origin:
|
rec.print_date = date.today()
|
||||||
sale_id = self.env['sale.order'].sudo().search([('name', '=', rec.invoice_origin)])
|
|
||||||
for doc in sale_id:
|
|
||||||
rec.print_date = doc.signed_on
|
|
||||||
else:
|
|
||||||
rec.print_date = date.today()
|
|
||||||
|
|
||||||
|
|
||||||
def compute_signature(self):
|
def compute_signature(self):
|
||||||
for rec in self:
|
for rec in self:
|
||||||
if rec.invoice_origin:
|
rec.signed_by = self.env.user.name
|
||||||
sale_id = self.env['sale.order'].sudo().search([('name', '=', rec.invoice_origin)])
|
|
||||||
for doc in sale_id:
|
|
||||||
rec.signed_by = doc.signed_by
|
|
||||||
|
|||||||
@@ -9,6 +9,9 @@
|
|||||||
<xpath expr="//field[@name='journal_id']" position="after">
|
<xpath expr="//field[@name='journal_id']" position="after">
|
||||||
<field name="txn_id"/>
|
<field name="txn_id"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
<xpath expr="//field[@name='invoice_payment_ref']" position="after">
|
||||||
|
<field name="note"/>
|
||||||
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
<template id="report_invoices_inherit1" inherit_id="bi_professional_reports_templates.fency_report_invoice_document">
|
<template id="report_invoices_inherit1" inherit_id="bi_professional_reports_templates.fency_report_invoice_document">
|
||||||
@@ -25,10 +28,18 @@
|
|||||||
<strong>Sale Code:</strong>
|
<strong>Sale Code:</strong>
|
||||||
<span t-esc="o.invoice_origin"/>
|
<span t-esc="o.invoice_origin"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
<xpath expr="//t[@t-call='web.external_layout']/div/div[3]" position="after">
|
||||||
|
<span>NOTE:</span><br/>
|
||||||
|
<span t-esc="o.note"/>
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="//t[@t-call='web.external_layout']/div/div[2]/table/thead//tr/th[1]" position="before">
|
||||||
|
<th>S.No</th>
|
||||||
|
<th>Code</th>
|
||||||
|
</xpath>
|
||||||
<xpath expr="//t[@t-call='web.external_layout']/div/p[last()]" position="after">
|
<xpath expr="//t[@t-call='web.external_layout']/div/p[last()]" position="after">
|
||||||
<p>E & OE</p><br/>
|
<p>E & OE</p><br/>
|
||||||
<span>Print Date: <span t-esc="o.print_date"/></span><br/>
|
<span>Print Date: <span t-esc="o.print_date"/></span><br/>
|
||||||
<span>Signed by: <span t-esc="o.signed_by"/></span>
|
<span>Printed by: <span t-esc="o.signed_by"/></span>
|
||||||
</xpath>
|
</xpath>
|
||||||
</template>
|
</template>
|
||||||
<template id="report_invoices_inherit2" inherit_id="bi_professional_reports_templates.classic_report_invoice_document">
|
<template id="report_invoices_inherit2" inherit_id="bi_professional_reports_templates.classic_report_invoice_document">
|
||||||
@@ -48,7 +59,7 @@
|
|||||||
<xpath expr="//t[@t-call='web.external_layout']/div/p[last()]" position="after">
|
<xpath expr="//t[@t-call='web.external_layout']/div/p[last()]" position="after">
|
||||||
<p>E & OE</p><br/>
|
<p>E & OE</p><br/>
|
||||||
<span>Print Date: <span t-esc="o.print_date"/></span><br/>
|
<span>Print Date: <span t-esc="o.print_date"/></span><br/>
|
||||||
<span>Signed by: <span t-esc="o.signed_by"/></span>
|
<span>Printed by: <span t-esc="o.signed_by"/></span>
|
||||||
</xpath>
|
</xpath>
|
||||||
</template>
|
</template>
|
||||||
<template id="report_invoices_inherit3" inherit_id="bi_professional_reports_templates.modern_report_invoice_document">
|
<template id="report_invoices_inherit3" inherit_id="bi_professional_reports_templates.modern_report_invoice_document">
|
||||||
@@ -68,7 +79,7 @@
|
|||||||
<xpath expr="//t[@t-call='web.external_layout']/div/p[last()]" position="after">
|
<xpath expr="//t[@t-call='web.external_layout']/div/p[last()]" position="after">
|
||||||
<p>E & OE</p><br/>
|
<p>E & OE</p><br/>
|
||||||
<span>Print Date: <span t-esc="o.print_date"/></span><br/>
|
<span>Print Date: <span t-esc="o.print_date"/></span><br/>
|
||||||
<span>Signed by: <span t-esc="o.signed_by"/></span>
|
<span>Printed by: <span t-esc="o.signed_by"/></span>
|
||||||
</xpath>
|
</xpath>
|
||||||
</template>
|
</template>
|
||||||
<template id="report_invoices_inherit4" inherit_id="bi_professional_reports_templates.odoo_std_report_invoice_document">
|
<template id="report_invoices_inherit4" inherit_id="bi_professional_reports_templates.odoo_std_report_invoice_document">
|
||||||
@@ -88,7 +99,7 @@
|
|||||||
<xpath expr="//t[@t-call='web.external_layout']/div/p[last()]" position="after">
|
<xpath expr="//t[@t-call='web.external_layout']/div/p[last()]" position="after">
|
||||||
<p>E & OE</p><br/>
|
<p>E & OE</p><br/>
|
||||||
<span>Print Date: <span t-esc="o.print_date"/></span><br/>
|
<span>Print Date: <span t-esc="o.print_date"/></span><br/>
|
||||||
<span>Signed by: <span t-esc="o.signed_by"/></span>
|
<span>Printed by: <span t-esc="o.signed_by"/></span>
|
||||||
</xpath>
|
</xpath>
|
||||||
</template>
|
</template>
|
||||||
</odoo>
|
</odoo>
|
||||||
Reference in New Issue
Block a user