Browse Source

[FIX] Bug Fixed 'employee_documents_expiry'

pull/164/head
Ajmal Cybro 4 years ago
parent
commit
a2f9d6056f
  1. 2
      base_accounting_kit/__manifest__.py
  2. 10
      base_accounting_kit/views/followup_report.xml
  3. 2
      employee_documents_expiry/__manifest__.py
  4. 6
      employee_documents_expiry/doc/RELEASE_NOTES.md
  5. 15
      employee_documents_expiry/models/employee_documents.py
  6. 2
      employee_documents_expiry/views/employee_document_view.xml

2
base_accounting_kit/__manifest__.py

@ -22,7 +22,7 @@
{
'name': 'Odoo 14 Full Accounting Kit',
'version': '14.0.2.5.5',
'version': '14.0.2.6.5',
'category': 'Accounting',
'live_test_url': 'https://www.youtube.com/watch?v=peAp2Tx_XIs',
'summary': """ Asset and Budget Management,

10
base_accounting_kit/views/followup_report.xml

@ -9,6 +9,16 @@
<header>
<field name="followup_status" widget="statusbar"/>
</header>
<div class="alert alert-info" role="alert"
style="font-size: 15px;display: inline-block; margin-top:10px;margin-left: 201px;">
<span>Wonder how to Send Followup mails and Print Followup Reports ? Download our
<a target="_blank"
href="https://apps.odoo.com/apps/modules/14.0/customer_followup_community">
<b>Customer Followup</b>
</a>
Module !
</span>
</div>
<sheet>
<div class="oe_title">
<h1>

2
employee_documents_expiry/__manifest__.py

@ -22,7 +22,7 @@
{
'name': 'Employee Documents',
'version': '14.0.1.0.0',
'version': '14.0.1.1.1',
'summary': """Manages Employee Documents With Expiry Notifications.""",
'description': """Manages Employee Related Documents with Expiry Notifications.""",
'category': 'Generic Modules/Human Resources',

6
employee_documents_expiry/doc/RELEASE_NOTES.md

@ -6,4 +6,10 @@
Initial commit for Employee Documents Expiry
#### 09.03.2021
#### Version 14.0.1.1.1
#### FIX
Bug Fixedss

15
employee_documents_expiry/models/employee_documents.py

@ -21,8 +21,8 @@
#############################################################################
from datetime import datetime, date, timedelta
from odoo import models, fields, api, _
from odoo.exceptions import Warning
class HrEmployeeDocument(models.Model):
@ -47,18 +47,23 @@ class HrEmployeeDocument(models.Model):
}
self.env['mail.mail'].create(main_content).send()
@api.constrains('expiry_date')
@api.onchange('expiry_date')
def check_expr_date(self):
for each in self:
exp_date = each.expiry_date
if exp_date < date.today():
raise Warning('Your Document Is Already Expired.')
if exp_date and exp_date < date.today():
return {
'warning': {
'title': _('Document Expired.'),
'message': _("Your Document Is Already Expired.")
}
}
name = fields.Char(string='Document Number', required=True, copy=False)
document_name = fields.Many2one('employee.checklist', string='Document', required=True)
description = fields.Text(string='Description', copy=False)
expiry_date = fields.Date(string='Expiry Date', copy=False)
employee_ref = fields.Many2one('hr.employee', invisible=1, copy=False)
employee_ref = fields.Many2one('hr.employee', copy=False)
doc_attachment_id = fields.Many2many('ir.attachment', 'doc_attach_rel', 'doc_id', 'attach_id3', string="Attachment",
help='You can attach the copy of your document', copy=False)
issue_date = fields.Date(string='Issue Date', default=fields.Date.context_today, copy=False)

2
employee_documents_expiry/views/employee_document_view.xml

@ -22,7 +22,7 @@
<field name="name"/>
<field name="document_name"/>
<field name="doc_attachment_id" widget="many2many_binary" class="oe_inline"/>
<field name="employee_ref" invisible="1"/>
<!-- <field name="employee_ref" invisible="1"/>-->
</group>
<group>
<field name="issue_date"/>

Loading…
Cancel
Save