diff --git a/reports/__init__.py b/reports/__init__.py new file mode 100644 index 0000000..2b77ae2 --- /dev/null +++ b/reports/__init__.py @@ -0,0 +1 @@ +from . import account diff --git a/reports/__manifest__.py b/reports/__manifest__.py new file mode 100644 index 0000000..4362d00 --- /dev/null +++ b/reports/__manifest__.py @@ -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, +} diff --git a/reports/__pycache__/__init__.cpython-36.pyc b/reports/__pycache__/__init__.cpython-36.pyc new file mode 100644 index 0000000..f181416 Binary files /dev/null and b/reports/__pycache__/__init__.cpython-36.pyc differ diff --git a/reports/__pycache__/account.cpython-36.pyc b/reports/__pycache__/account.cpython-36.pyc new file mode 100644 index 0000000..9642e58 Binary files /dev/null and b/reports/__pycache__/account.cpython-36.pyc differ diff --git a/reports/account.py b/reports/account.py new file mode 100644 index 0000000..64f1fd8 --- /dev/null +++ b/reports/account.py @@ -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 diff --git a/reports/views/invoice_report.xml b/reports/views/invoice_report.xml new file mode 100644 index 0000000..0927ada --- /dev/null +++ b/reports/views/invoice_report.xml @@ -0,0 +1,94 @@ + + + + account_invoice_inherit.inherit_form_view + account.move + + form + + + + + + + + + + + \ No newline at end of file