Browse Source

[INIT] Initial Commit

pull/116/head
Sreejith P 6 years ago
parent
commit
8b00e28b84
  1. 34
      daily_target_achievement/README.rst
  2. 2
      daily_target_achievement/__init__.py
  3. 41
      daily_target_achievement/__manifest__.py
  4. 4
      daily_target_achievement/models/__init__.py
  5. 40
      daily_target_achievement/models/account_invoice.py
  6. 118
      daily_target_achievement/models/daily_target.py
  7. 6
      daily_target_achievement/models/test_dailyTarget.py
  8. 4
      daily_target_achievement/security/ir.model.access.csv
  9. 27
      daily_target_achievement/security/target_record_rules.xml
  10. BIN
      daily_target_achievement/static/description/banner.png
  11. BIN
      daily_target_achievement/static/description/daily_target.png
  12. BIN
      daily_target_achievement/static/description/icon.png
  13. 332
      daily_target_achievement/static/description/index.html
  14. 108
      daily_target_achievement/views/daily_target_form.xml

34
daily_target_achievement/README.rst

@ -0,0 +1,34 @@
Daily Target vs Achievement v11
===============================
Daily salesperson target and achievement.
Depends
=======
[account] addon Odoo
Tech
====
* [Python] - Models
* [XML] - Odoo views
Installation
============
- www.odoo.com/documentation/11.0/setup/install.html
- Install our custom addon
Bug Tracker
===========
Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported.
Credits
=======
* Cybrosys Techno Solutions <https://www.cybrosys.com>
Maintainer
----------
This module is maintained by Cybrosys Technologies.
For support and more information, please visit https://www.cybrosys.com.

2
daily_target_achievement/__init__.py

@ -0,0 +1,2 @@
# -*- coding: utf-8 -*-
from . import models

41
daily_target_achievement/__manifest__.py

@ -0,0 +1,41 @@
# -*- coding: utf-8 -*-
###################################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2019-TODAY Cybrosys Technologies (<https://www.cybrosys.com>).
#
# This program is free software: you can modify
# it under the terms of the GNU Affero General Public License (AGPL) as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
###################################################################################
{
'name': 'Daily Target vs Achievement',
'version': '11.0.1.0.0',
'summary': 'Daily salesperson target and achievement',
'category': 'Extra Tools',
'author': 'Cybrosys Techno solutions',
'maintainer': 'Cybrosys Techno Solutions',
'company': 'Cybrosys Techno Solutions',
'website': 'https://www.cybrosys.com',
'depends': ['base', 'account_invoicing'],
'data': [
'views/daily_target_form.xml',
'security/ir.model.access.csv',
'security/target_record_rules.xml',
],
'images': ['static/description/banner.png'],
'installable': True,
'application': True,
'auto_install': False,
'license': 'AGPL-3',
}

4
daily_target_achievement/models/__init__.py

@ -0,0 +1,4 @@
# -*- coding: utf-8 -*-
from . import daily_target
from . import account_invoice

40
daily_target_achievement/models/account_invoice.py

@ -0,0 +1,40 @@
# -*- coding: utf-8 -*-
from odoo import models, fields, api
class AccountInvoice(models.Model):
_inherit = 'account.invoice'
@api.multi
def action_invoice_open(self):
res = super(AccountInvoice, self).action_invoice_open()
obj_incentive = self.env['daily.target'].search([('user_id', '=', self.user_id.id), ('state', '=', 'open')])
if obj_incentive:
try:
obj_target = self.env['target.day'].search([('date_today', '=', self.date_invoice),
('incentive_id', '=', obj_incentive.id)])
for i in obj_target:
i.write({'amount': i.amount + self.amount_untaxed})
tot = obj_incentive.achieve_amount + self.amount_untaxed
obj_incentive.write({'achieve_amount': tot})
except Exception:
pass
return res
@api.multi
def action_invoice_cancel(self):
res = super(AccountInvoice, self).action_invoice_cancel()
obj_incentive = self.env['daily.target'].search([('user_id', '=', self.user_id.id), ('state', '=', 'open')])
if obj_incentive:
try:
obj_target = self.env['target.day'].search([('date_today', '=', self.date_invoice),
('incentive_id', '=', obj_incentive.id)])
for i in obj_target:
day_total = i.amount - self.amount_untaxed
i.write({'amount': day_total})
tot = obj_incentive.achieve_amount - self.amount_untaxed
obj_incentive.write({'achieve_amount': tot})
except Exception:
pass
return res

118
daily_target_achievement/models/daily_target.py

@ -0,0 +1,118 @@
# !/usr/bin/env python
# -*- coding: utf-8 -*-
import time
from datetime import datetime
import babel
from odoo import fields, models, api, _, tools
from odoo import exceptions
from odoo.exceptions import Warning, UserError
class DailyTarget(models.Model):
_name = 'daily.target'
_description = 'Daily Target'
_order = "id desc"
name = fields.Char(string='Reference', readonly=True)
target_amount = fields.Float(string='Target', compute='calculate_target')
achieve_amount = fields.Float(string='Achievement', readonly=True, copy=False)
invoice_id = fields.Many2one('account.invoice', string='Invoice')
user_id = fields.Many2one('res.users', string='Sales Person', copy=False)
date = fields.Date(string='Date', default=lambda self: fields.Date.today())
to_date = fields.Date(string='To Date', default=lambda self: fields.Date.today())
company_id = fields.Many2one('res.company', string='Company',
default=lambda self: self.env.user.company_id)
internal_note = fields.Text(string='Internal Note')
target_id = fields.One2many('daily.target.line', 'target_id', string='Target')
state = fields.Selection([('draft', 'Draft'),
('open', 'Open'),
('done', 'Done'),
('cancel', 'Cancel')], string='State', default='draft', copy=False)
@api.model
def create(self, values):
"""
Over writted this method to give the name for record
:param values:
:return:
"""
res = super(DailyTarget, self).create(values)
for this in res:
ttyme = datetime.fromtimestamp(time.mktime(time.strptime(this.date, "%Y-%m-%d")))
locale = res.env.context.get('lang') or 'en_US'
this.name = 'Target of ' + this.user_id.name + ' _ ' + tools.ustr(
babel.dates.format_date(date=ttyme, format='MMMM-y', locale=locale))
return res
@api.one
def action_open_target(self):
"""
This method is used to change the record state to open
"""
obj_config = self.env['daily.target'].search([('state', '=', 'open')])
for i in obj_config:
if self.user_id == i.user_id:
raise exceptions.Warning(_("Warning"), _(
"You have already created a incentive program for this sales person"))
self.state = 'open'
@api.one
def calculate_target(self):
"""This method is used to calculate the target of the salesperson from lines"""
target_total = 0
if self.target_id:
for i in self.target_id:
target_total = target_total + i.target
self.target_amount = target_total
@api.one
def action_target_cancel(self):
"""
This method is used to change the record state to cancel
"""
self.state = 'cancel'
@api.one
def target_done(self):
"""
This method is used to change the record state to Done
"""
self.state = 'done'
@api.constrains('user_id')
def _checking_another_config(self):
"""
Only one record is in open state to avoid further mistake
"""
obj_config = self.env['daily.target'].search([('state', '=', 'open')])
for i in obj_config:
if self.user_id == i.user_id:
raise exceptions.Warning(_("Warning"), _(
"You have already created a incentive program for current sales person"))
@api.multi
def unlink(self):
"""
will not able to delete a record which is in open or done state
:return:
"""
for rec in self:
if rec.state in ('open', 'done'):
raise UserError(_("You can not delete a Target Program that are in Open/Done State"))
return super(DailyTarget, self).unlink()
class DailyTargetLine(models.Model):
_name = 'daily.target.line'
_description = 'Daily Target Line'
_order = "id desc"
date_today = fields.Date(string='Date', default=lambda self: fields.Date.today())
amount = fields.Float(string='Amount', readonly=True)
target = fields.Float(string='Target')
target_id = fields.Many2one('daily.target', string='Target Program')
company_id = fields.Many2one('res.company', string='Company',
default=lambda self: self.env.user.company_id)

6
daily_target_achievement/models/test_dailyTarget.py

@ -0,0 +1,6 @@
from unittest import TestCase
class TestDailyTarget(TestCase):
def test_unlink(self):
self.fail()

4
daily_target_achievement/security/ir.model.access.csv

@ -0,0 +1,4 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_target,access_target,model_daily_target,base.group_user,1,1,1,1
a_target_day,access_daily_target_line,model_daily_target_line,base.group_user,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_target access_target model_daily_target base.group_user 1 1 1 1
3 a_target_day access_daily_target_line model_daily_target_line base.group_user 1 1 1 1

27
daily_target_achievement/security/target_record_rules.xml

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<data>
<record id="property_rule_sale_incentive" model="ir.rule">
<field name="name">Daily Target of my Company</field>
<field name="model_id" ref="model_daily_target"/>
<field name="perm_read" eval="True"/>
<field name="perm_write" eval="True"/>
<field name="perm_create" eval="True"/>
<field name="perm_unlink" eval="True"/>
<field eval="True" name="global"/>
<field name="domain_force">[('company_id','=',user.company_id.id)]</field>
</record>
</data>
<data noupdate="1">
<record id="group_salesman_incentive" model="res.groups">
<field name="name">Target User</field>
</record>
<record id="group_manager_incentive" model="res.groups">
<field name="name">Target Manager</field>
<field name="implied_ids" eval="[(4, ref('group_salesman_incentive'))]"/>
</record>
</data>
</odoo>

BIN
daily_target_achievement/static/description/banner.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

BIN
daily_target_achievement/static/description/daily_target.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
daily_target_achievement/static/description/icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

332
daily_target_achievement/static/description/index.html

@ -0,0 +1,332 @@
<section class="oe_container" style="background-image:url(https://www.cybrosys.com/images/odoo-index-header-banner.png);background-repeat:no-repeat;background-size:100%;padding: 4% 0% 2% 15%;background-position-y: -107px;">
<div class="oe_row oe_spaced">
<h2 class="oe_slogan" style="font-size: 35px;color: #fff;font-weight: 900;text-transform: uppercase;text-align: left;margin: 0;margin-bottom: 16px;">
Daily Target vs Achievement
</h2>
<h3 class="oe_slogan" style="font-size: 25px;color: #fff;font-weight: 600;text-align: left;opacity: 1;margin: 0 !important;">
Daily salesperson target and achievement
</h3>
<h5 class="oe_slogan" style="text-align: left;background: #fff;width: 293px;padding: 10px;color: #080808 !important;opacity: 1 !important;font-weight: 600;font-size: 20px;">
<a style="color: #080808 !important;" href="https://www.cybrosys.com" target="_blank">Cybrosys Technologies</a>
</h5>
<a style="color: #080808 !important;" href="https://www.cybrosys.com" target="_blank">
<div style="width: 215px;margin-left: 57%;text-align: center;background: #ffffff;height: 215px;border-radius: 100%;display: flex;justify-content: center;align-items: center;box-shadow: 0 0 12px 4px #00000059;">
<img src="https://www.cybrosys.com/images/cybro-logo-oca.png" alt="cybrosys technologies" style="width: 180px;"/>
</div>
</a>
</div>
</section>
<section class="oe_container" style="padding: 1% 0% 3% 15%;">
<div class="oe_row oe_spaced">
<h2 class="oe_slogan" style="text-align: left;font-size: 28px;font-weight: 600;margin: 0px !important;">
Overview
</h2>
<h3 class="oe_slogan" style="text-align: left;font-size: 16px;width: 90%;margin: 0;margin-top: 14px;color: #000 !important;opacity: 1 !important;line-height: 24px;">
Now you can add daily target to your employees</br>
</h3>
</div>
</section>
<section class="oe_container" style="background-image:url(https://www.cybrosys.com/images/odoo-index-banner.png); background-repeat:no-repeat; background-size:cover;padding: 10% 0% 25% 15%;">
<div class="oe_row oe_spaced">
<h2 class="oe_slogan" style="text-align: left;font-size: 28px;font-weight: 600;margin: 0px !important;">
Features
</h2>
<h3 class="oe_slogan" style="text-align: left;font-size: 16px;width: 90%;margin: 0;margin-top: 14px;color: #000 !important;opacity: 1 !important;line-height: 18px;">
<i class="fa fa-check" aria-hidden="true" style="color: #cd2d47;font-size: 15px;"></i>
Assign Daily Target
</h3>
<h3 class="oe_slogan" style="text-align: left;font-size: 16px;width: 90%;margin: 0;margin-top: 14px;color: #000 !important;opacity: 1 !important;line-height: 18px;">
<i class="fa fa-check" aria-hidden="true" style="color: #cd2d47;font-size: 15px;"></i>
Get Daily Achievement
</h3>
</div>
</section>
<section class="oe_container" style="padding: 3% 0% 0% 15%;">
<div class="oe_row oe_spaced">
<h2 class="oe_slogan" style="text-align: left;font-size: 28px;font-weight: 600;margin: 0px !important;">
Screenshots
</h2>
<h3 class="oe_slogan" style="text-align: left;padding: 5% 0% 0% 0%;font-size: 16px;width: 90%;margin: 0;margin-top: 14px;color: #000 !important;opacity: 1 !important;line-height: 24px;">
<i class="fa fa-check" aria-hidden="true" style="color: #cd2d47;font-size: 15px;"></i>
Create a Target program for an employee.
</h3>
<div class="oe_row oe_spaced">
<img src="daily_target.png" alt="" style="width: 95%;"/>
</div>
<h3 class="oe_slogan" style="text-align: left;padding: 5% 0% 0% 0%;font-size: 16px;width: 90%;margin: 0;margin-top: 14px;color: #000 !important;opacity: 1 !important;line-height: 24px;">
<i class="fa fa-check" aria-hidden="true" style="color: #cd2d47;font-size: 15px;"></i>
The daily achievement is calculated once the invoice is validated,
only untaxed amount is considered as the achievement.
</h3>
</div>
</section>
<section class="oe_container" style="padding: 7px 0% 0% 3%;">
<div class="oe_row oe_spaced">
<a style="color: #080808 !important;" href="https://apps.odoo.com/apps/modules/browse?search=cybrosys" target="_blank"><img src="https://www.cybrosys.com/images/view-more-apps.jpg" alt="cybrosys technologies" style="width: 100%;margin-bottom: 50px;"/></a>
</div>
</section>
<section class="oe_container" style="padding: 1% 0% 0% 3%;">
<div class="oe_row oe_spaced">
<h2 class="oe_slogan" style="text-align: left;font-size: 28px;font-weight: 600;margin: 0px !important;">
Our Services
</h2>
<div style="display:flex;padding-top: 20px;justify-content: space-between;">
<div style="flex-basis: 18%;">
<div style="width:75px;height:75px;background:#fff; border-radius:100%;margin: auto;">
<a href="https://www.cybrosys.com/odoo-customization-and-installation/" target="_blank">
<img src="https://www.cybrosys.com/images/odoo-customization.png" style="width: 100%;border-radius: 100%;"/>
</a>
</div>
<h3 class="oe_slogan" style="font-weight: 800;text-align: center;font-size: 14px;width: 100%;margin: 0;margin-top: 14px;color: #000 !important;margin-top: 5px;opacity: 1 !important;line-height: 17px;">
<a href="https://www.cybrosys.com/odoo-customization-and-installation/" target="_blank">
Odoo Customization
</a>
</h3>
</div>
<div style="flex-basis: 18%;">
<div style="width:75px;height:75px;background:#fff; border-radius:100%;margin: auto;">
<a href="https://www.cybrosys.com/odoo-erp-implementation/" target="_blank">
<img src="https://www.cybrosys.com/images/odoo-erp-implementation.png" style="width: 100%;border-radius: 100%;"/>
</a>
</div>
<h3 class="oe_slogan" style="font-weight: 800;text-align: center;font-size: 14px;width: 100%;margin: 0;margin-top: 14px;color: #000 !important;margin-top: 5px;opacity: 1 !important;line-height: 17px;">
<a href="https://www.cybrosys.com/odoo-erp-implementation/" target="_blank">
Odoo Implementation </a>
</h3>
</div>
<div style="flex-basis: 18%;">
<div style="width:75px;height:75px;background:#fff; border-radius:100%;margin: auto;">
<a href="https://www.cybrosys.com/odoo-erp-integration/" target="_blank">
<img src="https://www.cybrosys.com/images/odoo-erp-integration.png" style="width: 100%;border-radius: 100%;"/>
</a>
</div>
<h3 class="oe_slogan" style="font-weight: 800;text-align: center;font-size: 14px;width: 100%;margin: 0;margin-top: 14px;color: #000 !important;margin-top: 5px;opacity: 1 !important;line-height: 17px;">
<a href="https://www.cybrosys.com/odoo-erp-integration/" target="_blank">
Odoo Integration
</a>
</h3>
</div>
<div style="flex-basis: 18%;">
<div style="width:75px;height:75px;background:#fff; border-radius:100%;margin: auto;">
<a href="https://www.cybrosys.com/odoo-erp-support/" target="_blank">
<img src="https://www.cybrosys.com/images/odoo-erp-support.png" style="width: 100%;border-radius: 100%;"/>
</a>
</div>
<h3 class="oe_slogan" style="font-weight: 800;text-align: center;font-size: 14px;width: 100%;margin: 0;margin-top: 14px;color: #000 !important;margin-top: 5px;opacity: 1 !important;line-height: 17px;">
<a href="https://www.cybrosys.com/odoo-erp-support/" target="_blank">
Odoo Support</a>
</h3>
</div>
<div style="flex-basis: 18%;">
<div style="width:75px;height:75px;background:#fff; border-radius:100%;margin: auto;">
<a href="https://www.cybrosys.com/hire-odoo-developer/" target="_blank">
<img src="https://www.cybrosys.com/images/hire-odoo-developer.png" style="width: 100%;border-radius: 100%;"/>
</a>
</div>
<h3 class="oe_slogan" style="font-weight: 800;text-align: center;font-size: 14px;width: 100%;margin: 0;margin-top: 14px;color: #000 !important;margin-top: 5px;opacity: 1 !important;line-height: 17px;">
<a href="https://www.cybrosys.com/hire-odoo-developer/" target="_blank">
Hire Odoo Developers</a>
</h3>
</a>
</div>
</div>
</div>
</section>
<section class="oe_container" style="padding: 1% 0% 0% 3%;">
<div class="oe_row oe_spaced">
<h2 class="oe_slogan" style="text-align: left;font-size: 28px;font-weight: 600;margin: 0px !important;">
Our Industries
</h2>
<div style="display:flex;justify-content: space-between;flex-wrap:wrap;">
<div style="flex-basis: 32%;padding-top: 20px;">
<div style="width:30%; float:left;">
<div style="width:75px;height:75px;background:#CE2D48; border-radius:100%;float: left;text-align: left;">
<a href="https://www.cybrosys.com/odoo/industries/best-trading-erp/" target="_blank">
<img src="https://www.cybrosys.com/images/odoo-index-industry-1.png" alt="Odoo Industry" style=" border-radius: 100%;width:100%;"/>
</a>
</div>
</div>
<div style="width:70%;float:left;">
<h3 class="oe_slogan" style=" text-align: left;font-size: 14px;font-weight:800;width: auto;margin: 0;margin-top: 14px;color: #000 !important;margin-top: 5px;opacity: 1 !important;line-height: 17px;float: left;margin-top: 4px;margin-left: 16px;">
<a href="https://www.cybrosys.com/odoo/industries/best-trading-erp/" target="_blank">
Trading
</a>
</h3>
<h3 class="oe_slogan" style=" text-align: left;font-size: 13px;width: auto;margin: 0;margin-top:5px;color: #000 !important;margin-top: 5px;opacity: 1 !important;line-height: 17px;float: left;margin-top: 5px;margin-left: 16px;">
Easily procure and sell your products.
</h3>
</div>
</div>
<div style="flex-basis: 32%;padding-top: 20px;">
<div style="width:30%; float:left;">
<div style="width:75px;height:75px;background:#CE2D48; border-radius:100%;float: left;text-align: left;">
<a href="https://www.cybrosys.com/odoo/industries/manufacturing-erp-software/" target="_blank">
<img src="https://www.cybrosys.com/images/odoo-index-industry-2.png" alt="Odoo Industry" style=" border-radius: 100%;width:100%;"/>
</a>
</div>
</div>
<div style="width:70%;float:left;">
<h3 class="oe_slogan" style=" text-align: left;font-size: 14px;font-weight:800;width: auto;margin: 0;margin-top: 14px;color: #000 !important;margin-top: 5px;opacity: 1 !important;line-height: 17px;float: left;margin-top: 4px;margin-left: 16px;">
<a href="https://www.cybrosys.com/odoo/industries/manufacturing-erp-software/" target="_blank">
Manufacturing</a>
</h3>
<h3 class="oe_slogan" style=" text-align: left;font-size: 13px;width: auto;margin: 0;margin-top:5px;color: #000 !important;margin-top: 5px;opacity: 1 !important;line-height: 17px;float: left;margin-top: 5px;margin-left: 16px;">
Plan, track and schedule your operations.
</h3>
</div>
</div>
<div style="flex-basis: 32%;padding-top: 20px;">
<div style="width:30%; float:left;">
<div style="width:75px;height:75px;background:#CE2D48; border-radius:100%;float: left;text-align: left;">
<a href="https://www.cybrosys.com/odoo/industries/restaurant-management/" target="_blank">
<img src="https://www.cybrosys.com/images/odoo-index-industry-3.png" alt="Odoo Industry" style=" border-radius: 100%;width:100%;"/>
</a>
</div>
</div>
<div style="width:70%;float:left;">
<h3 class="oe_slogan" style=" text-align: left;font-size: 14px;font-weight:800;width: auto;margin: 0;margin-top: 14px;color: #000 !important;margin-top: 5px;opacity: 1 !important;line-height: 17px;float: left;margin-top: 4px;margin-left: 16px;">
<a href="https://www.cybrosys.com/odoo/industries/restaurant-management/" target="_blank">
Restaurant</a>
</h3>
<h3 class="oe_slogan" style=" text-align: left;font-size: 13px;width: auto;margin: 0;margin-top:5px;color: #000 !important;margin-top: 5px;opacity: 1 !important;line-height: 17px;float: left;margin-top: 5px;margin-left: 16px;">
Run your bar or restaurant methodical.
</h3>
</div>
</div>
<div style="flex-basis: 32%;padding-top: 20px;">
<div style="width:30%; float:left;">
<div style="width:75px;height:75px;background:#CE2D48; border-radius:100%;float: left;text-align: left;">
<a href="https://www.cybrosys.com/odoo/industries/pos/" target="_blank">
<img src="https://www.cybrosys.com/images/odoo-index-industry-4.png" alt="Odoo Industry" style=" border-radius: 100%;width:100%;"/>
</a>
</div>
</div>
<div style="width:70%;float:left;">
<h3 class="oe_slogan" style=" text-align: left;font-size: 14px;font-weight:800;width: auto;margin: 0;margin-top: 14px;color: #000 !important;margin-top: 5px;opacity: 1 !important;line-height: 17px;float: left;margin-top: 4px;margin-left: 16px;">
<a href="https://www.cybrosys.com/odoo/industries/pos/" target="_blank">
POS</a>
</h3>
<h3 class="oe_slogan" style=" text-align: left;font-size: 13px;width: auto;margin: 0;margin-top:5px;color: #000 !important;margin-top: 5px;opacity: 1 !important;line-height: 17px;float: left;margin-top: 5px;margin-left: 16px;">
Easy configuring and convivial selling.
</h3>
</div>
</div>
<div style="flex-basis: 32%;padding-top: 20px;">
<div style="width:30%; float:left;">
<div style="width:75px;height:75px;background:#CE2D48; border-radius:100%;float: left;text-align: left;">
<a href="https://www.cybrosys.com/odoo/industries/ecommerce-website/" target="_blank">
<img src="https://www.cybrosys.com/images/odoo-index-industry-5.png" alt="Odoo Industry" style=" border-radius: 100%;width:100%;"/>
</a>
</div>
</div>
<div style="width:70%;float:left;">
<h3 class="oe_slogan" style=" text-align: left;font-size: 14px;font-weight:800;width: auto;margin: 0;margin-top: 14px;color: #000 !important;margin-top: 5px;opacity: 1 !important;line-height: 17px;float: left;margin-top: 0px;margin-left: 16px;">
<a href="https://www.cybrosys.com/odoo/industries/ecommerce-website/" target="_blank">
E-commerce & Website</a>
</h3>
<h3 class="oe_slogan" style=" text-align: left;font-size: 13px;width: auto;margin: 0;margin-top:5px;color: #000 !important;margin-top: 5px;opacity: 1 !important;line-height: 17px;float: left;margin-top: 5px;margin-left: 16px;">
Mobile friendly, awe-inspiring product pages.
</h3>
</div>
</div>
<div style="flex-basis: 32%;padding-top: 20px;">
<div style="width:30%; float:left;">
<div style="width:75px;height:75px;background:#CE2D48; border-radius:100%;float: left;text-align: left;">
<a href="https://www.cybrosys.com/odoo/industries/hotel-management-erp/" target="_blank">
<img src="https://www.cybrosys.com/images/odoo-index-industry-6.png" alt="Odoo Industry" style=" border-radius: 100%;width:100%;"/>
</a>
</div>
</div>
<div style="width:70%;float:left;">
<h3 class="oe_slogan" style=" text-align: left;font-size: 14px;font-weight:800;width: auto;margin: 0;margin-top: 14px;color: #000 !important;margin-top: 5px;opacity: 1 !important;line-height: 17px;float: left;margin-top: 4px;margin-left: 16px;">
<a href="https://www.cybrosys.com/odoo/industries/hotel-management-erp/" target="_blank">
Hotel Management</a>
</h3>
<h3 class="oe_slogan" style=" text-align: left;font-size: 13px;width: auto;margin: 0;margin-top:5px;color: #000 !important;margin-top: 5px;opacity: 1 !important;line-height: 17px;float: left;margin-top: 5px;margin-left: 16px;">
An all-inclusive hotel management application.
</h3>
</div>
</div>
<div style="flex-basis: 32%;padding-top: 20px;">
<div style="width:30%; float:left;">
<div style="width:75px;height:75px;background:#CE2D48; border-radius:100%;float: left;text-align: left;">
<a href="https://www.cybrosys.com/odoo/industries/education-erp-software/" target="_blank">
<img src="https://www.cybrosys.com/images/odoo-index-industry-7.png" alt="Odoo Industry" style=" border-radius: 100%;width:100%;"/>
</a>
</div>
</div>
<div style="width:70%;float:left;">
<h3 class="oe_slogan" style=" text-align: left;font-size: 14px;font-weight:800;width: auto;margin: 0;margin-top: 14px;color: #000 !important;margin-top: 5px;opacity: 1 !important;line-height: 17px;float: left;margin-top: 4px;margin-left: 16px;">
<a href="https://www.cybrosys.com/odoo/industries/education-erp-software/" target="_blank">
Education</a>
</h3>
<h3 class="oe_slogan" style=" text-align: left;font-size: 13px;width: auto;margin: 0;margin-top:5px;color: #000 !important;margin-top: 5px;opacity: 1 !important;line-height: 17px;float: left;margin-top: 5px;margin-left: 16px;">
A Collaborative platform for educational management.
</h3>
</div>
</div>
<div style="flex-basis: 32%;padding-top: 20px;">
<div style="width:30%; float:left;">
<div style="width:75px;height:75px;background:#CE2D48; border-radius:100%;float: left;text-align: left;">
<a href="https://www.cybrosys.com/odoo/industries/service-management/" target="_blank">
<img src="https://www.cybrosys.com/images/odoo-index-industry-8.png" alt="Odoo Industry" style=" border-radius: 100%;width:100%;"/>
</a>
</div>
</div>
<div style="width:70%;float:left;">
<h3 class="oe_slogan" style=" text-align: left;font-size: 14px;font-weight:800;width: auto;margin: 0;margin-top: 14px;color: #000 !important;margin-top: 5px;opacity: 1 !important;line-height: 17px;float: left;margin-top: 4px;margin-left: 16px;">
<a href="https://www.cybrosys.com/odoo/industries/service-management/" target="_blank">
Service Management</a>
</h3>
<h3 class="oe_slogan" style=" text-align: left;font-size: 13px;width: auto;margin: 0;margin-top:5px;color: #000 !important;margin-top: 5px;opacity: 1 !important;line-height: 17px;float: left;margin-top: 5px;margin-left: 16px;">
Keep track of services and invoice accordingly.
</h3>
</div>
</div>
</div>
</div>
</section>
<section class="oe_container" style="background-image:url(https://www.cybrosys.com/images/odoo-index-footer-bg.png); background-repeat:no-repeat; background-size:100%;padding: 13% 0% 6% 0%;">
<div class="oe_slogan" style="margin-top:10px !important;margin-bottom: 0px;">
<div>
<a style="color: #5c5c5c !important;border-radius: 0;background: none;border: none;background: #fff;box-shadow: 0 10px 40px 0 rgba(62,57,107,0.07), 0 2px 9px 0 rgba(62, 57, 107, 0.05);border-radius: 30px;font-size: 12px;padding: 9px 26px;margin-right: 9px;width: 200px;text-transform: capitalize;" class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;" href="mailto:odoo@cybrosys.com"><i class="fa fa-envelope"></i> Email us </a>
<a style="color: #5c5c5c !important;border-radius: 0;background: none;border: none;background: #fff;box-shadow: 0 10px 40px 0 rgba(62,57,107,0.07), 0 2px 9px 0 rgba(62, 57, 107, 0.05);border-radius: 30px;font-size: 12px;padding: 9px 26px;margin-right: 9px;width: 200px;text-transform: capitalize;" class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;" href="https://www.cybrosys.com/contact/"><i class="fa fa-phone"></i> Contact Us </a>
<a style="color: #5c5c5c !important;border-radius: 0;background: none;border: none;background: #fff;box-shadow: 0 10px 40px 0 rgba(62,57,107,0.07), 0 2px 9px 0 rgba(62, 57, 107, 0.05);border-radius: 30px;font-size: 12px;padding: 9px 26px;margin-right: 9px;width: 200px;text-transform: capitalize;" class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;" href="https://www.cybrosys.com/contact/"><i class="fa fa-check-square"></i> Request Customization </a>
</div>
<br>
<img src="https://www.cybrosys.com/images/logo.png" style="width: 190px; margin-bottom: 25px;margin-top: 30px;" class="center-block">
<div>
<a href="https://twitter.com/cybrosys" target="_blank"><i class="fa fa-2x fa-twitter" style="color:white;background: #00a0d1;width:35px;height: 35px;padding-top: 7px;font-size: 21px;margin-right: 6px;border-radius: 100%;"></i></a></td>
<a href="https://www.linkedin.com/company/cybrosys-technologies-pvt-ltd" target="_blank"><i class="fa fa-2x fa-linkedin" style="color:white;background: #31a3d6;width:35px;padding-left: 3px;height: 35px;padding-top: 7px;font-size: 21px;margin-right: 6px;border-radius: 100%;"></i></a></td>
<a href="https://www.facebook.com/cybrosystechnologies" target="_blank"><i class="fa fa-2x fa-facebook" style="color:white;background: #3b5998;width:35px; ;height: 35px;padding-top: 7px;font-size: 21px;margin-right: 6px;border-radius: 100%;"></i></a></td>
<a href="https://plus.google.com/106641282743045431892/about" target="_blank"><i class="fa fa-2x fa-google-plus" style="color:white;background: #c53c2c;width:35px;padding-left: 3px;height: 35px;padding-top: 7px;font-size: 21px;margin-right: 6px;border-radius: 100%;"></i></a></td>
<a href="https://in.pinterest.com/cybrosys" target="_blank"><i class="fa fa-2x fa-pinterest" style="color:white;background: #ac0f18;width:35px;padding-left: 3px;height: 35px;padding-top: 7px;font-size: 21px;margin-right: 6px;border-radius: 100%;"></i></a></td>
</div>
</div>
</section>

108
daily_target_achievement/views/daily_target_form.xml

@ -0,0 +1,108 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<data>
<record id="view_daily_target_filter" model="ir.ui.view">
<field name="name">Daily Target Filter</field>
<field name="model">daily.target</field>
<field name="arch" type="xml">
<search string="Search Target">
<field name="name" string="Target" filter_domain="['|','|', ('name','ilike',self), ('name', 'ilike', self), ('user_id', 'child_of', self)]"/>
<filter name="draft" string="Draft" domain="[('state','=','draft')]"/>
<filter name="unpaid" string="Open" domain="[('state', '=', 'open')]"/>
<filter name="paid" string="Paid" domain="[('state', '=', 'invoiced')]"/>
<separator/>
<field name="user_id" string="Salesperson"/>
<separator/>
<filter domain="[('user_id','=',uid)]" help="My Target"/>
<separator/>
<separator/>
<group expand="0" string="Group By">
<filter string="Salesperson" context="{'group_by':'user_id'}"/>
<filter name="status" string="Status" context="{'group_by':'state'}"/>
<separator/>
</group>
</search>
</field>
</record>
<record id="view_daily_target_form" model="ir.ui.view">
<field name="name">Daily Target</field>
<field name="model">daily.target</field>
<field name="arch" type="xml">
<form string="Daily Target">
<header>
<button name="target_done" string="Mark As Done" type="object" states="open" class="oe_highlight"
groups="daily_target_achievement.group_manager_incentive"/>
<button name="action_open_target" string="Validate" type="object" states="draft" class="oe_highlight"
groups="daily_target_achievement.group_manager_incentive"/>
<button name="action_target_cancel" string="Cancel" type="object" states="draft,open" class="oe_highlight"
groups="daily_target_achievement.group_manager_incentive"/>
<field name="state" widget="statusbar" statusbar_visible="draft,open,done,cancel"/>
</header>
<sheet>
<div class="oe_title oe_left">
<h2>
<field name="name" class="oe_inline" attrs="{'readonly':[('state','!=','draft')]}"/>
</h2>
</div>
<group>
<group>
<field name="user_id" attrs="{'readonly':[('state','!=','draft')]}"/>
<field name="date"/>
<field name="target_amount" readonly="1"/>
<field name="to_date" attrs="{'readonly':[('state','!=','draft')]}"/>
</group>
<group>
<field name="company_id" readonly="1" widget="selection"/>
<field name="achieve_amount"/>
<field name="invoice_id" readonly="1"/>
</group>
</group>
<notebook>
<page name="related_order_id" string="Day Target">
<field name="target_id" attrs="{'readonly':[('state','=','cancel')]}">
<tree editable="bottom">
<field name="date_today"/>
<field name="target"/>
<field name="amount"/>
</tree>
</field>
</page>
<page name="internal_note" string="Internal Note">
<field name="internal_note"/>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<record id="view_daily_target_tree" model="ir.ui.view">
<field name="name">Daily Target</field>
<field name="model">daily.target</field>
<field name="arch" type="xml">
<tree string="Daily Target" decoration-info="state == 'draft'" decoration-muted="state == 'cancel'">
<field name="name"/>
<field name="user_id"/>
<field name="target_amount"/>
<field name="achieve_amount"/>
<field name="state"/>
</tree>
</field>
</record>
<record id="action_daily_target" model="ir.actions.act_window">
<field name="name">Daily Target</field>
<field name="res_model">daily.target</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="search_view_id" ref="view_daily_target_filter"/>
</record>
<menuitem id="daily_target_parent" name="Target vs Achievement" parent="account.menu_finance" sequence="4"/>
<menuitem id="daily_target_achievement" parent="daily_target_parent" name="Target vs Achievement" action="action_daily_target"
sequence="10" />
</data>
</odoo>
Loading…
Cancel
Save