mirror of
https://gitlab.com/sonalarora/tra_backend.git
synced 2025-12-17 10:19:09 +02:00
25 lines
877 B
Python
25 lines
877 B
Python
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
|