[MERGE] branch merged with lp:~openerp-dev/openobject-addons/trunk-dev-addons3

bzr revid: mtr@mtr-20100706091037-bfhj9vjfc63le5hg
This commit is contained in:
mtr 2010-07-06 14:40:37 +05:30
commit eb0459c432
235 changed files with 3941 additions and 3555 deletions

View File

@ -21,7 +21,6 @@
{
"name" : "Accounting and Financial Management",
"version" : "1.1",
"depends" : ["product", "analytic", "process","board"],
"author" : "Tiny",
"category": 'Generic Modules/Accounting',
"description": """Financial and accounting module that covers:
@ -42,6 +41,7 @@ The processes like maintaining of general ledger is done through the defined fin
grouping is maintained through journal) for a particular financial year and for preparation of vouchers there is a
module named account_vouchers
""",
"depends" : ["product", "analytic", "process","board"],
'website': 'http://www.openerp.com',
'init_xml': [],
'update_xml': [
@ -119,7 +119,6 @@ module named account_vouchers
"wizard/account_bs_report_view.xml"
],
'demo_xml': [
#'demo/price_accuracy00.yml',
'account_demo.xml',
'project/project_demo.xml',
'project/analytic_account_demo.xml',

View File

@ -1143,7 +1143,7 @@ class account_move(osv.osv):
return amount
def _centralise(self, cr, uid, move, mode, context=None):
assert(mode in ('debit', 'credit'), 'Invalid Mode') #to prevent sql injection
assert mode in ('debit', 'credit'), 'Invalid Mode' #to prevent sql injection
if context is None:
context = {}
@ -1230,13 +1230,7 @@ class account_move(osv.osv):
if line.account_id.currency_id.id != line.currency_id.id and (line.account_id.currency_id.id != line.account_id.company_id.currency_id.id or line.currency_id):
raise osv.except_osv(_('Error'), _("""Couldn't create move with currency different from the secondary currency of the account "%s - %s". Clear the secondary currency field of the account definition if you want to accept all currencies.""" % (line.account_id.code, line.account_id.name)))
# Check that the move balances, the tolerance for debit/credit must
# be smaller than the smallest value according to price accuracy
# (hence the +1 below)
# Example:
# difference == 0.01 is OK iff price_accuracy <= 1!
# difference == 0.0001 is OK iff price_accuracy <= 3!
if abs(amount) < 10 ** -(int(config['price_accuracy'])+1):
if abs(amount) < 10 ** -4:
if not len(line_draft_ids):
continue
self.pool.get('account.move.line').write(cr, uid, line_draft_ids, {

View File

@ -28,7 +28,7 @@ class res_company(osv.osv):
}
_defaults = {
'overdue_msg': lambda *a: 'Would your payment have been carried \
'overdue_msg': 'Would your payment have been carried \
out after this mail was sent, please consider the present one as \
void. Do not hesitate to contact our accounting department'
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -45,11 +45,11 @@ class account_invoice(osv.osv):
res[invoice.id]['amount_total'] = res[invoice.id]['amount_tax'] + res[invoice.id]['amount_untaxed']
return res
def _get_journal(self, cr, uid, context):
def _get_journal(self, cr, uid, context=None):
if context is None:
context = {}
type_inv = context.get('type', 'out_invoice')
user = self.pool.get('res.users').browse(cr, uid, uid)
user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
company_id = context.get('company_id', user.company_id.id)
type2journal = {'out_invoice': 'sale', 'in_invoice': 'purchase', 'out_refund': 'sale_refund', 'in_refund': 'purchase_refund'}
refund_journal = {'out_invoice': False, 'in_invoice': False, 'out_refund': True, 'in_refund': True}
@ -63,7 +63,7 @@ class account_invoice(osv.osv):
else:
return False
def _get_currency(self, cr, uid, context):
def _get_currency(self, cr, uid, context=None):
user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, [uid])[0]
if user.company_id:
return user.company_id.currency_id.id
@ -81,10 +81,9 @@ class account_invoice(osv.osv):
def _get_type(self, cr, uid, context=None):
if context is None:
context = {}
type = context.get('type', 'out_invoice')
return type
return context.get('type', 'out_invoice')
def _reconciled(self, cr, uid, ids, name, args, context):
def _reconciled(self, cr, uid, ids, name, args, context=None):
res = {}
for id in ids:
res[id] = self.test_paid(cr, uid, [id])
@ -95,8 +94,11 @@ class account_invoice(osv.osv):
def _amount_residual(self, cr, uid, ids, name, args, context=None):
res = {}
data_inv = self.browse(cr, uid, ids)
cur_obj = self.pool.get('res.currency')
data_inv = self.browse(cr, uid, ids)
if context is None:
context = {}
for inv in data_inv:
debit = credit = 0.0
context.update({'date':inv.date_invoice})
@ -188,7 +190,7 @@ class account_invoice(osv.osv):
result[invoice.id] = lines
return result
def _get_invoice_from_line(self, cr, uid, ids, context={}):
def _get_invoice_from_line(self, cr, uid, ids, context=None):
move = {}
for line in self.pool.get('account.move.line').browse(cr, uid, ids):
if line.reconcile_partial_id:
@ -202,7 +204,7 @@ class account_invoice(osv.osv):
invoice_ids = self.pool.get('account.invoice').search(cr, uid, [('move_id','in',move.keys())], context=context)
return invoice_ids
def _get_invoice_from_reconcile(self, cr, uid, ids, context={}):
def _get_invoice_from_reconcile(self, cr, uid, ids, context=None):
move = {}
for r in self.pool.get('account.move.reconcile').browse(cr, uid, ids):
for line in r.line_partial_ids:
@ -317,12 +319,12 @@ class account_invoice(osv.osv):
_defaults = {
'type': _get_type,
#'date_invoice': lambda *a: time.strftime('%Y-%m-%d'),
'state': lambda *a: 'draft',
'state': 'draft',
'journal_id': _get_journal,
'currency_id': _get_currency,
'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'account.invoice', context=c),
'reference_type': lambda *a: 'none',
'check_total': lambda *a: 0.0,
'reference_type': 'none',
'check_total': 0.0,
'user_id': lambda s, cr, u, c: u,
}
@ -339,16 +341,15 @@ class account_invoice(osv.osv):
view_id = self.pool.get('ir.ui.view').search(cr,uid,[('name','=','account.invoice.form')])[0]
return super(account_invoice,self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=submenu)
def create(self, cr, uid, vals, context={}):
def create(self, cr, uid, vals, context=None):
try:
res = super(account_invoice, self).create(cr, uid, vals, context)
return res
except Exception,e:
except Exception, e:
if '"journal_id" viol' in e.args[0]:
raise orm.except_orm(_('Configuration Error!'),
_('There is no Accounting Journal of type Sale/Purchase defined!'))
else:
raise
raise orm.except_orm(_('UnknownError'), str(e))
def confirm_paid(self, cr, uid, ids, context=None):
@ -1226,8 +1227,8 @@ class account_invoice_line(osv.osv):
'partner_id': fields.related('invoice_id','partner_id',type='many2one',relation='res.partner',string='Partner',store=True)
}
_defaults = {
'quantity': lambda *a: 1,
'discount': lambda *a: 0.0,
'quantity': 1,
'discount': 0.0,
'price_unit': _price_unit_default,
}
@ -1570,4 +1571,7 @@ class res_partner(osv.osv):
_columns = {
'invoice_ids': fields.one2many('account.invoice.line', 'partner_id', 'Invoices', readonly=True),
}
res_partner()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -191,7 +191,4 @@ class res_partner(osv.osv):
}
res_partner()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -207,7 +207,6 @@
<field name="date" select="1"/>
<field name="user_id" widget="selection"/>
</group>
<separator orientation="vertical"/>
<newline/>
<group string="Group By..." expand="0">
<filter string="General Account" context="{'group_by':'general_account_id'}"/>
@ -342,7 +341,6 @@
<field name="res_model">account.analytic.line</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('journal_id','=',active_id)]</field>
</record>
<menuitem action="action_account_analytic_journal_open_form" id="account_analytic_journal_entries" parent="menu_finance_entries"/>
<!-- <record id="action_account_analytic_journal_open_form" model="ir.actions.act_window">

View File

@ -21,32 +21,30 @@
{
'name': 'report_account_analytic',
'version': '1.0',
'category': 'Generic Modules/Accounting',
'name' : 'report_account_analytic',
'version' : '1.1',
'category' : 'Generic Modules/Accounting',
'description': """
This module is for modifying account analytic view to show
important data to project manager of services companies.
Adds menu to show relevant information to each manager..
This module is for modifying account analytic view to show
important data to project manager of services companies.
Adds menu to show relevant information to each manager..
You can also view the report of account analytic summary
user-wise as well as month wise.
You can also view the report of account analytic summary
user-wise as well as month wise.
""",
"version" : "1.1",
"author" : "Camptocamp",
"category" : "Generic Modules/Accounting",
"module": "",
"website": "http://www.camptocamp.com/",
"depends" : ["account","hr_timesheet","hr_timesheet_invoice","project"],
"init_xml" : [],
"update_xml" : [
"security/ir.model.access.csv",
"account_analytic_analysis_view.xml",
"account_analytic_analysis_menu.xml",
],
'demo_xml': [],
"author" : "Camptocamp",
"website" : "http://www.camptocamp.com/",
"depends" : ["hr_timesheet_invoice"],
"init_xml" : [],
"update_xml": [
"security/ir.model.access.csv",
"account_analytic_analysis_view.xml",
"account_analytic_analysis_menu.xml",
],
'demo_xml' : [],
'installable': True,
'active': False,
'active' : False,
'certificate': '0042927202589',
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -19,18 +19,16 @@
#
##############################################################################
import operator
from osv import osv, fields
from osv.orm import intersect
import tools.sql
from tools.translate import _
class account_analytic_account(osv.osv):
_name = "account.analytic.account"
_inherit = "account.analytic.account"
def _ca_invoiced_calc(self, cr, uid, ids, name, arg, context={}):
def _ca_invoiced_calc(self, cr, uid, ids, name, arg, context=None):
res = {}
parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)]))
if parent_ids:
@ -46,7 +44,7 @@ class account_analytic_account(osv.osv):
return self._compute_currency_for_level_tree(cr, uid, ids, parent_ids, res, context)
def _ca_to_invoice_calc(self, cr, uid, ids, name, arg, context={}):
def _ca_to_invoice_calc(self, cr, uid, ids, name, arg, context=None):
res = {}
res2 = {}
parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)]))
@ -92,7 +90,7 @@ class account_analytic_account(osv.osv):
res[id] = round(res.get(id, 0.0),2) + round(res2.get(id, 0.0),2)
return res
def _hours_qtt_non_invoiced_calc (self, cr, uid, ids, name, arg, context={}):
def _hours_qtt_non_invoiced_calc (self, cr, uid, ids, name, arg, context=None):
res = {}
parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)]))
if parent_ids:
@ -117,7 +115,7 @@ class account_analytic_account(osv.osv):
res[id] = round(res.get(id, 0.0),2)
return res
def _hours_quantity_calc(self, cr, uid, ids, name, arg, context={}):
def _hours_quantity_calc(self, cr, uid, ids, name, arg, context=None):
res = {}
parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)]))
if parent_ids:
@ -141,7 +139,7 @@ class account_analytic_account(osv.osv):
res[id] = round(res.get(id, 0.0),2)
return res
def _total_cost_calc(self, cr, uid, ids, name, arg, context={}):
def _total_cost_calc(self, cr, uid, ids, name, arg, context=None):
res = {}
parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)]))
if parent_ids:
@ -158,7 +156,7 @@ class account_analytic_account(osv.osv):
return self._compute_currency_for_level_tree(cr, uid, ids, parent_ids, res, context)
# TODO Take care of pricelist and purchase !
def _ca_theorical_calc(self, cr, uid, ids, name, arg, context={}):
def _ca_theorical_calc(self, cr, uid, ids, name, arg, context=None):
res = {}
res2 = {}
parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)]))
@ -202,7 +200,7 @@ class account_analytic_account(osv.osv):
res[id] = round(res.get(id, 0.0),2) + round(res2.get(id, 0.0),2)
return res
def _last_worked_date_calc (self, cr, uid, ids, name, arg, context={}):
def _last_worked_date_calc (self, cr, uid, ids, name, arg, context = None):
res = {}
parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)]))
if parent_ids:
@ -223,7 +221,7 @@ class account_analytic_account(osv.osv):
res[id] = res.get(id, '')
return res
def _last_invoice_date_calc (self, cr, uid, ids, name, arg, context={}):
def _last_invoice_date_calc (self, cr, uid, ids, name, arg, context=None):
res = {}
parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)]))
if parent_ids:
@ -247,7 +245,7 @@ class account_analytic_account(osv.osv):
res[id] = res.get(id, '')
return res
def _last_worked_invoiced_date_calc (self, cr, uid, ids, name, arg, context={}):
def _last_worked_invoiced_date_calc (self, cr, uid, ids, name, arg, context=None):
res = {}
parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)]))
if parent_ids:
@ -268,7 +266,7 @@ class account_analytic_account(osv.osv):
res[id] = res.get(id, '')
return res
def _remaining_hours_calc(self, cr, uid, ids, name, arg, context={}):
def _remaining_hours_calc(self, cr, uid, ids, name, arg, context=None):
res = {}
for account in self.browse(cr, uid, ids):
if account.quantity_max != 0:
@ -279,7 +277,7 @@ class account_analytic_account(osv.osv):
res[id] = round(res.get(id, 0.0),2)
return res
def _hours_qtt_invoiced_calc(self, cr, uid, ids, name, arg, context={}):
def _hours_qtt_invoiced_calc(self, cr, uid, ids, name, arg, context=None):
res = {}
for account in self.browse(cr, uid, ids):
res[account.id] = account.hours_quantity - account.hours_qtt_non_invoiced
@ -289,7 +287,7 @@ class account_analytic_account(osv.osv):
res[id] = round(res.get(id, 0.0),2)
return res
def _revenue_per_hour_calc(self, cr, uid, ids, name, arg, context={}):
def _revenue_per_hour_calc(self, cr, uid, ids, name, arg, context=None):
res = {}
for account in self.browse(cr, uid, ids):
if account.hours_qtt_invoiced == 0:
@ -300,7 +298,7 @@ class account_analytic_account(osv.osv):
res[id] = round(res.get(id, 0.0),2)
return res
def _real_margin_rate_calc(self, cr, uid, ids, name, arg, context={}):
def _real_margin_rate_calc(self, cr, uid, ids, name, arg, context=None):
res = {}
for account in self.browse(cr, uid, ids):
if account.ca_invoiced == 0:
@ -313,7 +311,7 @@ class account_analytic_account(osv.osv):
res[id] = round(res.get(id, 0.0),2)
return res
def _remaining_ca_calc(self, cr, uid, ids, name, arg, context={}):
def _remaining_ca_calc(self, cr, uid, ids, name, arg, context=None):
res = {}
for account in self.browse(cr, uid, ids):
if account.amount_max != 0:
@ -324,7 +322,7 @@ class account_analytic_account(osv.osv):
res[id] = round(res.get(id, 0.0),2)
return res
def _real_margin_calc(self, cr, uid, ids, name, arg, context={}):
def _real_margin_calc(self, cr, uid, ids, name, arg, context=None):
res = {}
for account in self.browse(cr, uid, ids):
res[account.id] = account.ca_invoiced + account.total_cost
@ -332,7 +330,7 @@ class account_analytic_account(osv.osv):
res[id] = round(res.get(id, 0.0),2)
return res
def _theorical_margin_calc(self, cr, uid, ids, name, arg, context={}):
def _theorical_margin_calc(self, cr, uid, ids, name, arg, context=None):
res = {}
for account in self.browse(cr, uid, ids):
res[account.id] = account.ca_theorical + account.total_cost
@ -426,6 +424,7 @@ class account_analytic_account_summary_user(osv.osv):
string='Total Time'),
'user' : fields.many2one('res.users', 'User'),
}
def init(self, cr):
tools.sql.drop_view_if_exists(cr, 'account_analytic_analysis_summary_user')
cr.execute('CREATE OR REPLACE VIEW account_analytic_analysis_summary_user AS (' \
@ -731,6 +730,5 @@ class account_analytic_account_summary_month(osv.osv):
account_analytic_account_summary_month()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,7 +1,6 @@
<openerp>
<data>
<menuitem icon="terp-project" id="base.menu_main_pm" name="Project" sequence="10"/>
<!-- <menuitem id="next_id_71" name="Financial Project Management" parent="base.menu_main_pm" groups="account.group_account_invoice" sequence="20"/>-->
<menuitem id="menu_invoicing" name="Billing" parent="base.menu_main_pm" sequence="4"/>
<record id="action_hr_tree_invoiced_all" model="ir.actions.act_window">
@ -14,17 +13,6 @@
</record>
<menuitem action="action_hr_tree_invoiced_all" id="menu_action_hr_tree_invoiced_all" parent="menu_invoicing"/>
<record id="action_account_analytic_all" model="ir.actions.act_window">
<field name="name">All Analytic Accounts</field>
<field name="res_model">account.analytic.account</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,graph</field>
<field name="view_id" ref="account.view_account_analytic_account_list"/>
<field name="search_view_id" ref="account.view_account_analytic_account_search"/>
<field name="domain">[]</field>
</record>
<!-- <menuitem name="Analytic Accounts" action="action_account_analytic_all" id="menu_action_account_analytic_all" parent="next_id_71"/>-->
<record id="action_account_analytic_managed_overpassed" model="ir.actions.act_window">
<field name="name">Overpassed Accounts</field>
<field name="res_model">account.analytic.account</field>

View File

@ -24,7 +24,6 @@
<field name="ca_invoiced"/>
<field name="ca_theorical"/>
<newline/>
<!-- <field name="old"/> -->
<field name="hours_quantity"/>
<field name="hours_qtt_invoiced"/>
<field name="remaining_hours"/>
@ -38,13 +37,12 @@
<separator colspan="4" string="Key dates"/>
<field name="last_invoice_date"/>
<field name="last_worked_invoiced_date"/>
<field name="last_worked_date"/>
<separator colspan="4" string="To be invoiced"/>
<field name="hours_qtt_non_invoiced"/>
<field name="ca_to_invoice"/>
</page>
<page string="Stats by month">
<field colspan="4" name="month_ids" nolabel="1">
@ -81,20 +79,18 @@
</field>
</field>
</record>
<record id="view_account_analytic_account_tree_c2c_3" model="ir.ui.view">
<field name="name">account.analytic.account.tree</field>
<field name="model">account.analytic.account</field>
<field name="inherit_id" ref="account.view_account_analytic_account_list"/>
<field name="type">tree</field>
<field name="arch" type="xml">
<field name="date" position="before">
<field name="last_invoice_date"/>
<field name="ca_to_invoice"/>
</field>
</field>
</record>
<record id="view_account_analytic_simplified" model="ir.ui.view">
@ -110,7 +106,6 @@
<field name="remaining_hours"/>
<field name="ca_to_invoice"/>
<field name="last_invoice_date"/>
</tree>
</field>
</record>

View File

@ -8,13 +8,13 @@ msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
"PO-Revision-Date: 2009-11-17 06:50+0000\n"
"Last-Translator: Tor Syversen <sol-moe@online.no>\n"
"PO-Revision-Date: 2010-07-03 18:41+0000\n"
"Last-Translator: Mathias Bøhn Grytemark <Unknown>\n"
"Language-Team: Norwegian Bokmal <nb@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-06-22 04:10+0000\n"
"X-Launchpad-Export-Date: 2010-07-04 03:45+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_analytic_analysis
@ -32,7 +32,7 @@ msgstr "Timer, summert pr. bruker"
#. module: account_analytic_analysis
#: field:account.analytic.account,last_invoice_date:0
msgid "Last Invoice Date"
msgstr ""
msgstr "Forrige fakturadato"
#. module: account_analytic_analysis
#: help:account.analytic.account,remaining_ca:0
@ -58,7 +58,7 @@ msgstr "Mine nåværende konti"
#. module: account_analytic_analysis
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr ""
msgstr "Ugyldig XML for visningsarkitektur!"
#. module: account_analytic_analysis
#: help:account.analytic.account,last_invoice_date:0
@ -84,7 +84,7 @@ msgstr ""
#: constraint:ir.model:0
msgid ""
"The Object name must start with x_ and not contain any special character !"
msgstr ""
msgstr "Objektets navn må starte med x_ og ikke inneholde spesialkarakterer!"
#. module: account_analytic_analysis
#: model:ir.actions.act_window,name:account_analytic_analysis.action_account_analytic_new
@ -123,7 +123,7 @@ msgstr ""
#. module: account_analytic_analysis
#: model:ir.ui.menu,name:account_analytic_analysis.menu_invoicing
msgid "Invoicing"
msgstr ""
msgstr "Fakturering"
#. module: account_analytic_analysis
#: field:account.analytic.account,last_worked_date:0
@ -145,7 +145,7 @@ msgstr ""
#. module: account_analytic_analysis
#: field:account.analytic.account,remaining_hours:0
msgid "Remaining Hours"
msgstr ""
msgstr "Gjenværende timer"
#. module: account_analytic_analysis
#: help:account.analytic.account,ca_theorical:0
@ -159,7 +159,7 @@ msgstr ""
#: field:account.analytic.account,user_ids:0
#: field:account_analytic_analysis.summary.user,user:0
msgid "User"
msgstr ""
msgstr "Bruker"
#. module: account_analytic_analysis
#: model:ir.actions.act_window,name:account_analytic_analysis.action_account_analytic_managed_pending
@ -182,7 +182,7 @@ msgstr ""
#: model:ir.actions.act_window,name:account_analytic_analysis.action_account_analytic_managed
#: model:ir.ui.menu,name:account_analytic_analysis.menu_analytic_account_managed
msgid "My Accounts"
msgstr ""
msgstr "Mine kontoer"
#. module: account_analytic_analysis
#: model:ir.module.module,description:account_analytic_analysis.module_meta_information
@ -195,7 +195,7 @@ msgstr ""
#. module: account_analytic_analysis
#: field:account.analytic.account,hours_qtt_non_invoiced:0
msgid "Uninvoiced Hours"
msgstr ""
msgstr "Ufakturerte timer"
#. module: account_analytic_analysis
#: field:account.analytic.account,hours_quantity:0

View File

@ -20,4 +20,5 @@
##############################################################################
import account_analytic_default
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -19,11 +19,10 @@
#
##############################################################################
{
'name': 'Account Analytic Default',
'version': '1.0',
'category': 'Generic Modules/Accounting',
'name' : 'Account Analytic Default',
'version' : '1.0',
'category' : 'Generic Modules/Accounting',
'description': """
Allows to automatically select analytic accounts based on criterions:
* Product
@ -32,14 +31,15 @@ Allows to automatically select analytic accounts based on criterions:
* Company
* Date
""",
'author': 'Tiny',
'website': 'http://www.openerp.com',
'depends': ['account', 'sale'],
'init_xml': [],
'author' : 'Tiny',
'website' : 'http://www.openerp.com',
'depends' : ['account', 'sale'],
'init_xml' : [],
'update_xml': ['security/ir.model.access.csv', 'account_analytic_default_view.xml'],
'demo_xml': [],
'demo_xml' : [],
'installable': True,
'active': False,
'certificate': '0074229833581',
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -19,10 +19,10 @@
#
##############################################################################
from osv import fields,osv
from osv import orm
import time
from osv import fields,osv
class account_analytic_default(osv.osv):
_name = 'account.analytic.default'
_description = 'Analytic Distribution'
@ -38,7 +38,7 @@ class account_analytic_default(osv.osv):
'date_start': fields.date('Start Date'),
'date_stop': fields.date('End Date'),
}
def account_get(self, cr, uid, product_id=None, partner_id=None, user_id=None, date=None, context={}):
def account_get(self, cr, uid, product_id=None, partner_id=None, user_id=None, date=None, context=None):
domain = []
if product_id:
domain += ['|',('product_id','=',product_id)]
@ -71,7 +71,7 @@ class account_invoice_line(osv.osv):
_inherit = 'account.invoice.line'
_description = 'Invoice Line'
def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition=False, price_unit=False, address_invoice_id=False, currency_id=False, context={}):
def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition=False, price_unit=False, address_invoice_id=False, currency_id=False, context=None):
res_prod = super(account_invoice_line,self).product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, fposition, price_unit, address_invoice_id, currency_id=currency_id, context=context)
rec = self.pool.get('account.analytic.default').account_get(cr, uid, product, partner_id, uid, time.strftime('%Y-%m-%d'), context)
if rec:
@ -101,7 +101,7 @@ class sale_order_line(osv.osv):
_inherit = 'sale.order.line'
# Method overridden to set the analytic account by default on criterion match
def invoice_line_create(self, cr, uid, ids, context={}):
def invoice_line_create(self, cr, uid, ids, context=None):
create_ids = super(sale_order_line,self).invoice_line_create(cr, uid, ids, context)
if not ids:
return create_ids
@ -117,6 +117,4 @@ class sale_order_line(osv.osv):
sale_order_line()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -52,6 +52,7 @@
</search>
</field>
</record>
<record id="action_analytic_default_form" model="ir.actions.act_window">
<field name="name">Analytic Defaults</field>
<field name="res_model">account.analytic.default</field>
@ -59,10 +60,6 @@
<field name="view_mode">tree,form</field>
<field name="search_view_id" ref="view_account_analytic_default_form_search"/>
</record>
<!-- <menuitem-->
<!-- action="action_analytic_default_form"-->
<!-- id="menu_analytic_defaul_form"-->
<!-- parent="account.menu_analytic_accounting"/>-->
<act_window
name="Entries"

View File

@ -22,5 +22,6 @@
import account_analytic_plans
import wizard
import report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -21,9 +21,9 @@
{
'name': 'Multiple-plans management in Analytic Accounting',
'version': '1.0',
'category': 'Generic Modules/Accounting',
'name' : 'Multiple-plans management in Analytic Accounting',
'version' : '1.0',
'category' : 'Generic Modules/Accounting',
'description': """This module allows to use several analytic plans, according to the general journal,
so that multiple analytic lines are created when the invoice or the entries
are confirmed.
@ -54,10 +54,10 @@ for one account entry.
The analytic plan validates the minimum and maximum percentage at the time of creation
of distribution models.
""",
'author': 'Tiny',
'website': 'http://www.openerp.com',
'depends': ['account', 'account_analytic_default'],
'init_xml': [],
'author' : 'Tiny',
'website' : 'http://www.openerp.com',
'depends' : ['account', 'account_analytic_default'],
'init_xml' : [],
'update_xml': [
'security/ir.model.access.csv',
'account_analytic_plans_view.xml',
@ -65,9 +65,10 @@ of distribution models.
'wizard/analytic_plan_create_model_view.xml',
'wizard/account_crossovered_analytic_view.xml'
],
'demo_xml': [],
'demo_xml' : [],
'installable': True,
'active': False,
'active' : False,
'certificate': '0036417675373',
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -19,15 +19,9 @@
#
##############################################################################
from lxml import etree
from mx import DateTime
from mx.DateTime import now
import time
import netsvc
from osv import fields, osv,orm
import ir
from osv import fields, osv
import tools
from tools.translate import _
@ -64,6 +58,7 @@ account_analytic_plan()
class account_analytic_plan_line(osv.osv):
_name = "account.analytic.plan.line"
_description = "Analytic Plan Line"
_order = "sequence, id"
_columns = {
'plan_id':fields.many2one('account.analytic.plan','Analytic Plan'),
'name': fields.char('Plan Name', size=64, required=True, select=True),
@ -73,16 +68,15 @@ class account_analytic_plan_line(osv.osv):
'max_required': fields.float('Maximum Allowed (%)'),
}
_defaults = {
'min_required': lambda *args: 100.0,
'max_required': lambda *args: 100.0,
'min_required': 100.0,
'max_required': 100.0,
}
_order = "sequence,id"
account_analytic_plan_line()
class account_analytic_plan_instance(osv.osv):
_name='account.analytic.plan.instance'
_name = 'account.analytic.plan.instance'
_description = 'Analytic Plan Instance'
_columns={
_columns = {
'name':fields.char('Analytic Distribution', size=64),
'code':fields.char('Distribution Code', size=16),
'journal_id': fields.many2one('account.analytic.journal', 'Analytic Journal' ),
@ -116,7 +110,9 @@ class account_analytic_plan_instance(osv.osv):
'account4_ids':False, 'account5_ids':False, 'account6_ids':False})
return super(account_analytic_plan_instance, self).copy(cr, uid, id, default, context)
def _default_journal(self, cr, uid, context={}):
def _default_journal(self, cr, uid, context=None):
if not context:
context = {}
if context.has_key('journal_id') and context['journal_id']:
journal = self.pool.get('account.journal').browse(cr, uid, context['journal_id'])
if journal.analytic_journal_id:
@ -124,10 +120,10 @@ class account_analytic_plan_instance(osv.osv):
return False
_defaults = {
'plan_id': lambda *args: False,
'plan_id': False,
'journal_id': _default_journal,
}
def name_get(self, cr, uid, ids, context={}):
def name_get(self, cr, uid, ids, context=None):
res = []
for inst in self.browse(cr, uid, ids, context):
name = inst.name or '/'
@ -207,7 +203,7 @@ class account_analytic_plan_instance(osv.osv):
return super(account_analytic_plan_instance, self).create(cr, uid, vals, context)
def write(self, cr, uid, ids, vals, context={}, check=True, update_check=True):
def write(self, cr, uid, ids, vals, context=None, check=True, update_check=True):
this = self.browse(cr, uid, ids[0])
if this.plan_id and not vals.has_key('plan_id'):
#this instance is a model, so we have to create a new plan instance instead of modifying it
@ -237,9 +233,9 @@ class account_analytic_plan_instance_line(osv.osv):
'rate':fields.float('Rate (%)', required=True),
}
_defaults = {
'rate': lambda *args: 100.0
'rate': 100.0
}
def name_get(self, cr, uid, ids, context={}):
def name_get(self, cr, uid, ids, context=None):
if not len(ids):
return []
reads = self.read(cr, uid, ids, ['analytic_account_id'], context)
@ -297,7 +293,7 @@ class account_move_line(osv.osv):
del(data['analytics_id'])
return data
def create_analytic_lines(self, cr, uid, ids, context={}):
def create_analytic_lines(self, cr, uid, ids, context=None):
super(account_move_line, self).create_analytic_lines(cr, uid, ids, context)
analytic_line_obj = self.pool.get('account.analytic.line')
for line in self.browse(cr, uid, ids, context):
@ -333,7 +329,7 @@ class account_invoice(osv.osv):
_name = "account.invoice"
_inherit="account.invoice"
def line_get_convert(self, cr, uid, x, part, date, context={}):
def line_get_convert(self, cr, uid, x, part, date, context=None):
res=super(account_invoice,self).line_get_convert(cr, uid, x, part, date, context)
res['analytics_id']=x.get('analytics_id',False)
return res
@ -399,7 +395,7 @@ class sale_order_line(osv.osv):
_inherit = 'sale.order.line'
# Method overridden to set the analytic account by default on criterion match
def invoice_line_create(self, cr, uid, ids, context={}):
def invoice_line_create(self, cr, uid, ids, context=None):
create_ids = super(sale_order_line,self).invoice_line_create(cr, uid, ids, context)
if ids:
sale_line_obj = self.browse(cr, uid, ids[0], context)

View File

@ -11,13 +11,6 @@
auto="False"
menu="False"/>
<!--<wizard
id="account_analytic_account_inverted_balance_report"
string="Crossovered Analytic"
model="account.analytic.account"
name="wizard.crossovered.analytic"
keyword="client_print_multi"/>-->
</data>
</openerp>

View File

@ -89,7 +89,11 @@
<field name="code" select="1"/>
<field name="plan_id" required="True"/>
<field name="journal_id"/>
<field name="account_ids" string="Analytic Distribution" colspan="4">
<field name="account_ids" nolabel="1" colspan="4">
<form string="Analytic Distribution">
<field name="rate"/>
<field name="analytic_account_id"/>
</form>
<tree string="Analytic Distribution" editable="bottom">
<field name="rate"/>
<field name="analytic_account_id"/>
@ -124,16 +128,11 @@
<act_window name="Distribution Models"
domain="[('plan_id', '=', active_id),('plan_id','&lt;&gt;',False)]"
context="{'plan_id': active_id}"
context="{'plan_id':active_id}"
res_model="account.analytic.plan.instance"
src_model="account.analytic.plan"
id="account_analytic_instance_model_open"/>
<!-- <menuitem-->
<!-- name="Analytic Distribution's models" parent="account.account_def_analytic_journal"-->
<!-- id="menu_account_analytic_plan_instance_action"-->
<!-- action="account_analytic_plan_instance_action"/>-->
<record model="ir.ui.view" id="account_analytic_plan_instance_line_form">
<field name="name">account.analytic.plan.instance.line.form</field>
<field name="model">account.analytic.plan.instance.line</field>
@ -234,7 +233,7 @@
</field>
</record>
<!-- add property field on product -->
<!-- add property field on default analytic account-->
<record model="ir.ui.view" id="view_default_inherit_form">
<field name="name">account.analytic.default.form.plans</field>

View File

@ -20,5 +20,6 @@
##############################################################################
import crossovered_analytic
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -19,20 +19,20 @@
#
##############################################################################
import pooler
import time
from report import report_sxw
class crossovered_analytic(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
super(crossovered_analytic, self).__init__(cr, uid, name, context=context)
super(crossovered_analytic, self).__init__(cr, uid, name, context = context)
self.localcontext.update( {
'time': time,
'lines': self._lines,
'ref_lines' : self._ref_lines,
'find_children':self.find_children,
})
self.base_amount=0.00
self.base_amount = 0.00
def find_children(self,ref_ids):
to_return_ids = []
@ -153,23 +153,23 @@ class crossovered_analytic(report_sxw.rml_parse):
if not form['empty_line']:
res.append(result)
else:
result={}
res=[]
result['id']=acc_id
result = {}
res = []
result['id'] = acc_id
data_account = acc_pool.browse(self.cr,self.uid,acc_id)
result['acc_name']=data_account.name
result['acc_name'] = data_account.name
result['code'] = data_account.code
result['amt']=result['qty']=result['perc']=0.00
result['amt'] = result['qty'] = result['perc'] = 0.00
if not form['empty_line']:
res.append(result)
for item in res:
obj_acc=acc_pool.name_get(self.cr,self.uid,[item['id']])
item['acc_name']=obj_acc[0][1]
obj_acc = acc_pool.name_get(self.cr,self.uid,[item['id']])
item['acc_name'] = obj_acc[0][1]
final.append(item)
return final
report_sxw.report_sxw('report.account.analytic.account.crossovered.analytic', 'account.analytic.account', 'addons/account_analytic_plans/report/crossovered_analytic.rml',parser=crossovered_analytic, header=False)
report_sxw.report_sxw('report.account.analytic.account.crossovered.analytic', 'account.analytic.account', 'addons/account_analytic_plans/report/crossovered_analytic.rml',parser = crossovered_analytic, header = False)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -21,5 +21,6 @@
import analytic_plan_create_model
import account_crossovered_analytic
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -8,17 +8,19 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Crossovered Analytic">
<group col="4" colspan="6">
<field name="date1"/>
<field name="date2"/>
<field name="ref" colspan="4"/>
<field name="journal_ids" colspan="4"/>
<field name="empty_line"/>
</group>
<separator colspan="4"/>
<group col="2" colspan="4">
<button special="cancel" string="Cancel" icon='gtk-cancel'/>
<button name="print_report" string="Print" colspan="1" type="object" icon="gtk-print"/>
<group height="280" width="300">
<group col="4" colspan="6">
<field name="date1"/>
<field name="date2"/>
<field name="ref" colspan="4"/>
<field name="journal_ids" colspan="4"/>
<field name="empty_line"/>
</group>
<separator colspan="4"/>
<group col="2" colspan="4">
<button special="cancel" string="Cancel" icon='gtk-cancel'/>
<button name="print_report" string="Print" colspan="1" type="object" icon="gtk-print"/>
</group>
</group>
</form>
</field>

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@ -15,14 +15,13 @@
# 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 <http://www.gnu.org/licenses/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import followup
import followup_report
import account_followup
import account_followup_report
import wizard
import report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -19,7 +19,6 @@
#
##############################################################################
{
'name': 'Accounting follow-ups management',
'version': '1.0',
@ -36,11 +35,10 @@
It will generate a PDF with all the letters according the the
different levels of recall defined. You can define different policies
for different companies.
for different companies. You can send also mail to the customer.
Note that if you want to change the followup level for a given partner/account entry, you can do it in the menu:
Financial Management/Reporting/Follow-Ups/All receivable entries
Accounting/Reporting/Follow-Ups/All receivable entries
""",
'author': 'Tiny',
@ -50,13 +48,14 @@
'update_xml': [
'security/ir.model.access.csv',
'wizard/account_followup_print_view.xml',
'followup_report_view.xml',
'followup_view.xml',
'followup_data.xml'
'account_followup_report.xml',
'account_followup_view.xml',
'account_followup_data.xml'
],
'demo_xml': ['followup_demo.xml'],
'demo_xml': ['account_followup_demo.xml'],
'installable': True,
'active': False,
'certificate': '0072481076453',
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@ -15,7 +15,7 @@
# 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 <http://www.gnu.org/licenses/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
@ -23,13 +23,17 @@ from osv import fields, osv
class followup(osv.osv):
_name = 'account_followup.followup'
_description = 'Follow-Up'
_description = 'Account Follow Up'
_columns = {
'name': fields.char('Name', size=64, required=True),
'description': fields.text('Description'),
'followup_line': fields.one2many('account_followup.followup.line', 'followup_id', 'Follow-Up'),
'company_id': fields.many2one('res.company', 'Company'),
}
_defaults = {
'company_id': lambda s, cr, uid, c: s.pool.get('res.company')._company_default_get(cr, uid, 'account_followup.followup', context=c),
}
followup()
class followup_line(osv.osv):
@ -42,26 +46,27 @@ class followup_line(osv.osv):
'start': fields.selection([('days','Net Days'),('end_of_month','End of Month')], 'Type of Term', size=64, required=True),
'followup_id': fields.many2one('account_followup.followup', 'Follow Ups', required=True, ondelete="cascade"),
'description': fields.text('Printed Message', translate=True),
}
}
followup_line()
class account_move_line(osv.osv):
_name = 'account.move.line'
_inherit = 'account.move.line'
_columns = {
'followup_line_id': fields.many2one('account_followup.followup.line', 'Follow-up Level'),
'followup_date': fields.date('Latest Follow-up'),
}
}
account_move_line()
class res_company(osv.osv):
_inherit = "res.company"
_columns = {
'follow_up_msg' : fields.text('Follow-up Message', translate=True),
}
}
_defaults = {
'overdue_msg': lambda *a: '''
'overdue_msg': '''
Date : %(date)s
Dear %(partner_name)s,
@ -75,8 +80,8 @@ Thanks,
%(user_signature)s
%(company_name)s
'''
}
}
res_company()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_account_followup_followup_line_tree" model="ir.ui.view">
<field name="name">account_followup.followup.line.tree</field>
<field name="model">account_followup.followup.line</field>
@ -15,40 +15,39 @@
</tree>
</field>
</record>
<record id="view_account_followup_followup_line_form" model="ir.ui.view">
<field name="name">account_followup.followup.line.form</field>
<field name="model">account_followup.followup.line</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Follow-Up Lines">
<field name="sequence" select="1"/>
<field name="name" select="1"/>
<field name="delay" select="1"/>
<field name="start" select="1"/>
<field name="sequence"/>
<field name="name" />
<field name="delay" />
<field name="start" />
<newline/>
<field colspan="4" name="description" select="1"/>
<field colspan="4" name="description" />
<separator string="Legend" colspan="4"/>
<label string="%%(partner_name)s: Partner name" colspan="2"/>
<label string="%%(partner_name)s: Partner Name" colspan="2"/>
<label string="%%(date)s: Current Date" colspan="2"/>
<label string="%%(user_signature)s: User name" colspan="2"/>
<label string="%%(company_name)s: User's Company name" colspan="2"/>
<label string="%%(user_signature)s: User Name" colspan="2"/>
<label string="%%(company_name)s: User's Company Name" colspan="2"/>
</form>
</field>
</record>
<record id="view_account_followup_followup_form" model="ir.ui.view">
<field name="name">account_followup.followup.form</field>
<field name="model">account_followup.followup</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Follow-Up">
<field name="name" select="1"/>
<field name="company_id" select="1" widget="selection" groups="base.group_multi_company"/>
<field name="name" />
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
<separator colspan="4" string="Description"/>
<field colspan="4" name="description" nolabel="1" select="1"/>
<separator colspan="4" string="Lines"/>
<field colspan="4" name="description" nolabel="1" />
<separator colspan="4" string="Followup Lines"/>
<field colspan="4" name="followup_line" nolabel="1"/>
</form>
</field>
@ -66,17 +65,30 @@
</field>
</record>
<record id="view_account_followup_filter" model="ir.ui.view">
<field name="name">account.followup.select</field>
<field name="model">account_followup.followup</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Search Followup">
<group col="10" colspan="4">
<field name="name"/>
</group>
</search>
</field>
</record>
<record id="action_account_followup_definition_form" model="ir.actions.act_window">
<field name="name">Follow-Ups</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">account_followup.followup</field>
<field name="search_view_id" ref="view_account_followup_filter"/>
<field name="view_type">form</field>
</record>
<menuitem action="action_account_followup_definition_form" id="account_followup_menu" parent="account.menu_finance_configuration"/>
<report auto="False" id="account_followup_followup_report" menu="False" model="account_followup.followup" name="account_followup.followup.print" rml="account_followup/report/rappel.rml" string="Followup Report"/>
<record id="account_move_line_partner_tree" model="ir.ui.view">
<field name="name">account.move.line.partner.tree</field>
<field name="model">account.move.line</field>
@ -99,7 +111,7 @@
</tree>
</field>
</record>
<record id="view_move_line_form" model="ir.ui.view">
<field name="name">account.move.line.form.followup</field>
<field name="model">account.move.line</field>
@ -111,7 +123,7 @@
</field>
</field>
</record>
<record id="view_move_line_tree" model="ir.ui.view">
<field name="name">account.move.line.tree.followup</field>
<field name="model">account.move.line</field>
@ -123,17 +135,17 @@
</field>
</field>
</record>
<act_window domain="[('partner_id', '=', active_id),('reconcile_id','=',False),('account_id.reconcile', '=', True),('account_id.type', 'in', ['receivable', 'payable'])]" id="account.act_account_partner_account_move_unreconciled" name="Receivables &amp; Payables" res_model="account.move.line" view="account_move_line_partner_tree"/>
<act_window domain="[('reconcile_id', '=', False),('account_id.type','=','receivable')]" id="act_account_partner_account_move_all" name="All receivable entries" res_model="account.move.line" src_model="" view="account_move_line_partner_tree"/>
<menuitem action="act_account_partner_account_move_all" id="menu_account_move_open_unreconcile" parent="account_followup.menu_action_followup_stat"/>
<act_window domain="[('reconcile_id', '=', False), ('account_id.type','=','payable')]" id="act_account_partner_account_move_payable_all" name="All payable entries" res_model="account.move.line" src_model="" view="account_move_line_partner_tree"/>
<menuitem action="act_account_partner_account_move_payable_all" id="menu_account_move_open_unreconcile_payable" parent="account_followup.menu_action_followup_stat"/>
<record model="ir.ui.view" id="view_company_inherit_followup_form">
<field name="name">res.company.followup.form.inherit</field>
<field name="inherit_id" ref="account.view_company_inherit_form"/>
@ -146,5 +158,6 @@
</field>
</field>
</record>
</data>
</openerp>

View File

@ -30,12 +30,12 @@ class report_rappel(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
super(report_rappel, self).__init__(cr, uid, name, context=context)
self.localcontext.update( {
'time' : time,
'time': time,
'ids_to_objects': self._ids_to_objects,
'adr_get' : self._adr_get,
'getLines' : self._lines_get,
'get_text' : self._get_text
})
'adr_get': self._adr_get,
'getLines': self._lines_get,
'get_text': self._get_text
})
def _ids_to_objects(self, partners_ids):
pool = pooler.get_pool(self.cr.dbname)
@ -91,10 +91,8 @@ class report_rappel(report_sxw.rml_parse):
return text
report_sxw.report_sxw('report.account_followup.followup.print',
'res.partner', 'addons/account_followup/report/rappel.rml',
parser=report_rappel)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -34,25 +34,32 @@ class account_followup_print(osv.osv_memory):
}
def _get_followup(self, cr, uid, context=None):
if context is None:
context = {}
if context.get('active_model', 'ir.ui.menu') == 'account_followup.followup':
return context.get('active_id', False)
company_id = self.pool.get('res.users').browse(cr, uid, uid).company_id.id
tmp = self.pool.get('account_followup.followup').search(cr, uid, [('company_id', '=', company_id)])
return tmp and tmp[0] or False
followp_id = self.pool.get('account_followup.followup').search(cr, uid, [('company_id', '=', company_id)], context=context)
return followp_id and followp_id[0] or False
def do_continue(self, cr, uid, ids, context=None):
mod_obj = self.pool.get('ir.model.data')
if context is None:
context = {}
data = self.read(cr, uid, ids, [])[0]
model_data_ids = mod_obj.search(cr, uid, [('model','=','ir.ui.view'),('name','=','view_account_followup_print_all')], context=context)
resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id']
context.update({'followup_id': data['followup_id'], 'date':data['date']})
return {
'name': _('Select partners'),
'view_type': 'form',
'context': context,
'view_mode': 'tree,form',
'res_model': 'account.followup.print.all',
'views': [(resource_id,'form')],
'type': 'ir.actions.act_window',
'target': 'new',
'name': _('Select Partners'),
'view_type': 'form',
'context': context,
'view_mode': 'tree,form',
'res_model': 'account.followup.print.all',
'views': [(resource_id,'form')],
'type': 'ir.actions.act_window',
'target': 'new',
}
_defaults = {
@ -74,10 +81,12 @@ class account_followup_print_all(osv.osv_memory):
'summary': fields.text('Summary', required=True, readonly=True)
}
def _get_summary(self, cr, uid, context=None):
if context is None:
context = {}
return context.get('summary', '')
def _get_partners(self, cr, uid, context=None):
return self._get_partners_followp(cr, uid, [], context)['partner_ids']
return self._get_partners_followp(cr, uid, [], context=context)['partner_ids']
def _get_msg(self, cr, uid, context=None):
return self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.follow_up_msg
@ -168,6 +177,9 @@ class account_followup_print_all(osv.osv_memory):
move_obj = self.pool.get('account.move.line')
user_obj = self.pool.get('res.users')
line_obj = self.pool.get('account_followup.stat')
if context is None:
context = {}
data = self.read(cr, uid, ids, [])[0]
model_data_ids = mod_obj.search(cr, uid, [('model','=','ir.ui.view'),('name','=','view_account_followup_print_all_msg')], context=context)
resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id']
@ -252,8 +264,9 @@ class account_followup_print_all(osv.osv_memory):
context.update({'summary': summary})
else:
context.update({'summary': '\n\n\nE-Mail has not been sent to any partner. If you want to send it, please tick send email confirmation on wizard.'})
return {
'name': _('Summary'),
'name': _('Follwoup Summary'),
'view_type': 'form',
'context': context,
'view_mode': 'tree,form',
@ -265,6 +278,8 @@ class account_followup_print_all(osv.osv_memory):
}
def do_print(self, cr, uid, ids, context=None):
if context is None:
context = {}
data = self.read(cr, uid, ids, [])[0]
res = self._get_partners_followp(cr, uid, ids, context)['to_update']
to_update = res
@ -284,6 +299,7 @@ class account_followup_print_all(osv.osv_memory):
'model': 'account_followup.followup',
'form': data
}
return {
'type': 'ir.actions.report.xml',
'report_name': 'account_followup.followup.print',

View File

@ -2,17 +2,6 @@
<openerp>
<data noupdate="0">
<!--<wizard string="Send followups"
name="account_followup.followup.print.all"
id="action_account_followup_all_wizard"
model="account_followup.followup" />
<menuitem action="action_account_followup_all_wizard"
id="account_followup_wizard_menu"
parent="account.menu_finance_periodical_processing"
type="wizard" />-->
<record id="view_account_followup_print" model="ir.ui.view">
<field name="name">account.followup.print.form</field>
<field name="model">account.followup.print</field>

View File

@ -299,8 +299,8 @@
<field name="type">form</field>
<field name="inherit_id" ref="account.view_bank_statement_form"/>
<field name="arch" type="xml">
<group colspan="2" col="3" position="inside">
<button name="%(action_account_populate_statement_confirm)d" string="Import payment lines" type="action" icon="gtk-open"/>
<group col="6" colspan="4" position="inside">
<button colspan="2" name="%(action_account_populate_statement_confirm)d" string="Import payment lines" type="action" icon="gtk-open"/>
</group>
</field>
</record>

View File

@ -51,7 +51,7 @@ ir_sequence_type()
class account_journal(osv.osv):
_inherit = "account.journal"
_columns = {
'max_amount': fields.float('Verify Transaction', digits=(16, int(config['price_accuracy'])), help="Validate voucher entry twice before posting it, if transection amount more then entered here"),
'max_amount': fields.float('Verify Transaction', digits=(16, 2), help="Validate voucher entry twice before posting it, if transection amount more then entered here"),
}
account_journal()

View File

@ -29,14 +29,14 @@ class auction_pay_buy(osv.osv_memory):
_description = "Pay buy"
_columns= {
'amount': fields.float('Amount paid', digits= (16, int(tools.config['price_accuracy']))),
'amount': fields.float('Amount paid', digits= (16, 2)),
'buyer_id':fields.many2one('res.partner', 'Buyer'),
'statement_id1':fields.many2one('account.bank.statement', 'Statement', required=True),
'amount2': fields.float('Amount paid', digits= (16, int(tools.config['price_accuracy']))),
'amount2': fields.float('Amount paid', digits= (16, 2)),
'statement_id2':fields.many2one('account.bank.statement', 'Statement'),
'amount3': fields.float('Amount paid', digits = (16, int(tools.config['price_accuracy']))),
'amount3': fields.float('Amount paid', digits = (16, 2)),
'statement_id3':fields.many2one('account.bank.statement', 'Statement'),
'total': fields.float('Amount paid', digits = (16, int(tools.config['price_accuracy'])), readonly =True),
'total': fields.float('Amount paid', digits = (16, 2), readonly =True),
}
def default_get(self, cr, uid, fields, context):

View File

@ -27,7 +27,7 @@ class auction_pay_sel(osv.osv_memory):
_description = "Pay Invoice"
_columns= {
'amount': fields.float('Amount paid', digits= (16, int(tools.config['price_accuracy'])), required=True),
'amount': fields.float('Amount paid', digits= (16, 2), required=True),
'dest_account_id':fields.many2one('account.account', 'Payment to Account', required=True, domain= [('type', '=', 'cash')]),
'journal_id':fields.many2one('account.journal', 'Journal', required=True),
'period_id':fields.many2one('account.period', 'Period', required=True),

View File

@ -50,15 +50,17 @@ def get_recurrent_dates(rrulestring, exdate, startdate=None, exrule=None):
if not startdate:
startdate = datetime.now()
rset1 = rrule.rrulestr(rrulestring, dtstart=startdate, forceset=True)
if not exdate:
exdate = []
rset1 = rrule.rrulestr(str(rrulestring), dtstart=startdate, forceset=True)
for date in exdate:
datetime_obj = todate(date)
rset1._exdate.append(datetime_obj)
if exrule:
rset1.exrule(rrule.rrulestr(str(exrule), dtstart=startdate))
re_dates = map(lambda x:x.strftime('%Y-%m-%d %H:%M:%S'), rset1._iter())
return re_dates
return list(rset1._iter())
def base_calendar_id2real_id(base_calendar_id=None, with_date=False):
"""
@ -791,61 +793,100 @@ class calendar_alarm(osv.osv):
@param use_new_cursor: False or the dbname
@param context: A standard dictionary for contextual values
"""
if not context:
context = {}
current_datetime = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
cr.execute("select alarm.id as id \
from calendar_alarm alarm \
where alarm.state = %s and alarm.trigger_date <= %s", ('run', current_datetime))
res = cr.dictfetchall()
alarm_ids = map(lambda x: x['id'], res)
#attendee_obj = self.pool.get('calendar.attendee')
current_datetime = datetime.now()
request_obj = self.pool.get('res.request')
alarm_ids = self.search(cr, uid, [('state', '!=', 'done')], context=context)
mail_to = []
for alarm in self.browse(cr, uid, alarm_ids):
if alarm.action == 'display':
value = {
'name': alarm.name,
'act_from': alarm.user_id.id,
'act_to': alarm.user_id.id,
'body': alarm.description,
'trigger_date': alarm.trigger_date,
'ref_doc1': '%s,%s' % (alarm.model_id.model, alarm.res_id)
}
request_id = request_obj.create(cr, uid, value)
request_ids = [request_id]
for attendee in alarm.attendee_ids:
if attendee.user_id:
value['act_to'] = attendee.user_id.id
request_id = request_obj.create(cr, uid, value)
request_ids.append(request_id)
request_obj.request_send(cr, uid, request_ids)
if alarm.action == 'email':
sub = '[Openobject Remainder] %s' % (alarm.name)
body = """
Name: %s
Date: %s
Description: %s
for alarm in self.browse(cr, uid, alarm_ids, context=context):
next_trigger_date = None
update_vals = {}
model_obj = self.pool.get(alarm.model_id.model)
res_obj = model_obj.browse(cr, uid, alarm.res_id, context=context)
re_dates = []
From:
%s
%s
if res_obj.rrule:
event_date = datetime.strptime(res_obj.date, '%Y-%m-%d %H:%M:%S')
recurrent_dates = get_recurrent_dates(res_obj.rrule, res_obj.exdate, event_date, res_obj.exrule)
""" % (alarm.name, alarm.trigger_date, alarm.description, \
alarm.user_id.name, alarm.user_id.signature)
mail_to = [alarm.user_id.address_id.email]
for att in alarm.attendee_ids:
mail_to.append(att.user_id.address_id.email)
if mail_to:
tools.email_send(
tools.config.get('email_from', False),
mail_to,
sub,
body
)
self.write(cr, uid, [alarm.id], {'state':'done'})
trigger_interval = alarm.trigger_interval
if trigger_interval == 'days':
delta = timedelta(days=alarm.trigger_duration)
if trigger_interval == 'hours':
delta = timedelta(hours=alarm.trigger_duration)
if trigger_interval == 'minutes':
delta = timedelta(minutes=alarm.trigger_duration)
delta = alarm.trigger_occurs == 'after' and delta or -delta
for rdate in recurrent_dates:
if rdate + delta > current_datetime:
break
if rdate + delta <= current_datetime:
re_dates.append(rdate.strftime("%Y-%m-%d %H:%M:%S"))
rest_dates = recurrent_dates[len(re_dates):]
next_trigger_date = rest_dates and rest_dates[0] or None
else:
re_dates = [alarm.trigger_date]
for r_date in re_dates:
ref = alarm.model_id.model + ',' + str(alarm.res_id)
# search for alreay sent requests
if request_obj.search(cr, uid, [('trigger_date', '=', r_date), ('ref_doc1', '=', ref)], context=context):
continue
if alarm.action == 'display':
value = {
'name': alarm.name,
'act_from': alarm.user_id.id,
'act_to': alarm.user_id.id,
'body': alarm.description,
'trigger_date': r_date,
'ref_doc1': ref
}
request_id = request_obj.create(cr, uid, value)
request_ids = [request_id]
for attendee in res_obj.attendee_ids:
if attendee.user_id:
value['act_to'] = attendee.user_id.id
request_id = request_obj.create(cr, uid, value)
request_ids.append(request_id)
request_obj.request_send(cr, uid, request_ids)
if alarm.action == 'email':
sub = '[Openobject Reminder] %s' % (alarm.name)
body = """
Event: %s
Event Date: %s
Description: %s
From:
%s
----
%s
""" % (alarm.name, alarm.trigger_date, alarm.description, \
alarm.user_id.name, alarm.user_id.signature)
mail_to = [alarm.user_id.address_id.email]
for att in alarm.attendee_ids:
mail_to.append(att.user_id.address_id.email)
if mail_to:
tools.email_send(
tools.config.get('email_from', False),
mail_to,
sub,
body
)
if next_trigger_date:
update_vals.update({'trigger_date': next_trigger_date})
else:
update_vals.update({'state': 'done'})
self.write(cr, uid, [alarm.id], update_vals)
return True
calendar_alarm()
@ -1273,13 +1314,12 @@ true, it will allow you to hide the event alarm information without removing it.
new_rrule_str.append(new_rule)
new_rrule_str = ';'.join(new_rrule_str)
rdates = get_recurrent_dates(str(new_rrule_str), exdate, start_date, data['exrule'])
for rdate in rdates:
r_date = datetime.strptime(rdate, "%Y-%m-%d %H:%M:%S")
for r_date in rdates:
if start_date and r_date < start_date:
continue
if until_date and r_date > until_date:
continue
idval = real_id2base_calendar_id(data['id'], rdate)
idval = real_id2base_calendar_id(data['id'], r_date.strftime("%Y-%m-%d %H:%M:%S"))
result.append(idval)
count += 1
if result:
@ -1413,9 +1453,10 @@ true, it will allow you to hide the event alarm information without removing it.
new_ids.append(event_id)
res = super(calendar_event, self).write(cr, uid, new_ids, vals, context=context)
if vals.has_key('alarm_id') or vals.has_key('base_calendar_alarm_id'):
if (vals.has_key('alarm_id') or vals.has_key('base_calendar_alarm_id'))\
or (vals.has_key('date') or vals.has_key('duration') or vals.has_key('date_deadline')):
# change alarm details
alarm_obj = self.pool.get('res.alarm')
context.update({'alarm_id': vals.get('alarm_id')})
alarm_obj.do_alarm_create(cr, uid, new_ids, self._name, 'date', \
context=context)
return res

View File

@ -26,21 +26,7 @@ class res_partner_contact(osv.osv):
_name = "res.partner.contact"
_description = "Contact"
def _title_get(self,cr, user, context={}):
"""
@param self: The object pointer
@param cr: the current row, from the database cursor,
@param user: the current user,
@param context: A standard dictionary for contextual values
"""
obj = self.pool.get('res.partner.title')
ids = obj.search(cr, user, [])
res = obj.read(cr, user, ids, ['shortcut', 'name','domain'], context)
res = [(r['shortcut'], r['name']) for r in res if r['domain']=='contact']
return res
def _main_job(self, cr, uid, ids, fields, arg, context=None):
"""
@param self: The object pointer
@ -62,7 +48,7 @@ class res_partner_contact(osv.osv):
'name': fields.char('Last Name', size=30, required=True),
'first_name': fields.char('First Name', size=30),
'mobile': fields.char('Mobile', size=30),
'title': fields.selection(_title_get, 'Title'),
'title': fields.many2one('res.partner.title','Title'),
'website': fields.char('Website', size=120),
'lang_id': fields.many2one('res.lang', 'Language'),
'job_ids': fields.one2many('res.partner.job', 'contact_id', 'Functions and Addresses'),
@ -101,13 +87,15 @@ class res_partner_contact(osv.osv):
if not len(ids):
return []
res = []
for r in self.read(cr, user, ids, ['name','first_name','title']):
addr = r['title'] and str(r['title'])+" " or ''
addr += r.get('name', '')
if r['name'] and r['first_name']:
addr += ' '
addr += (r.get('first_name', '') or '')
res.append((r['id'], addr))
for contact in self.browse(cr, user, ids, context=context):
_contact = ""
if contact.title:
_contact += "%s "%(contact.title.name)
_contact += contact.name or ""
if contact.name and contact.first_name:
_contact += " "
_contact += contact.first_name or ""
res.append((contact.id, _contact))
return res
res_partner_contact()

View File

@ -6,19 +6,19 @@
<record id="res_partner_contact_mortier0" model="res.partner.contact">
<field eval="&quot;&quot;&quot;Benoit&quot;&quot;&quot;" name="first_name"/>
<field eval="&quot;&quot;&quot;Mortier&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;M.&quot;&quot;&quot;" name="title"/>
<field name="title" ref="base.res_partner_title_sir"/>
<field eval="1" name="active"/>
</record>
<record id="res_partner_contact_jacot0" model="res.partner.contact">
<field eval="&quot;&quot;&quot;Laurent&quot;&quot;&quot;" name="first_name"/>
<field eval="&quot;&quot;&quot;Jacot&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;M.&quot;&quot;&quot;" name="title"/>
<field ref="base.res_partner_title_sir" name="title"/>
<field eval="1" name="active"/>
</record>
<record id="res_partner_contact_passot0" model="res.partner.contact">
<field eval="&quot;&quot;&quot;Thomas&quot;&quot;&quot;" name="first_name"/>
<field eval="&quot;&quot;&quot;Passot&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;M.&quot;&quot;&quot;" name="title"/>
<field ref="base.res_partner_title_sir" name="title"/>
<field eval="1" name="active"/>
</record>
<record id="res_partner_contact_lacarte0" model="res.partner.contact">
@ -37,25 +37,25 @@
<record id="res_partner_contact_lavente0" model="res.partner.contact">
<field eval="&quot;&quot;&quot;Jean-Guy&quot;&quot;&quot;" name="first_name"/>
<field eval="&quot;&quot;&quot;Lavente&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;M.&quot;&quot;&quot;" name="title"/>
<field ref="base.res_partner_title_sir" name="title"/>
<field eval="1" name="active"/>
</record>
<record id="res_partner_contact_lelitre0" model="res.partner.contact">
<field eval="&quot;&quot;&quot;Sylvie&quot;&quot;&quot;" name="first_name"/>
<field eval="&quot;&quot;&quot;Lelitre&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Mss&quot;&quot;&quot;" name="title"/>
<field ref="base.res_partner_title_sir" name="title"/>
<field eval="1" name="active"/>
</record>
<record id="res_partner_contact_grosbonnet0" model="res.partner.contact">
<field eval="&quot;&quot;&quot;Arthur&quot;&quot;&quot;" name="first_name"/>
<field eval="&quot;&quot;&quot;Grosbonnet&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;M.&quot;&quot;&quot;" name="title"/>
<field ref="base.res_partner_title_sir" name="title"/>
<field eval="1" name="active"/>
</record>
<record id="res_partner_contact_lesbrouffe0" model="res.partner.contact">
<field eval="&quot;&quot;&quot;Karine&quot;&quot;&quot;" name="first_name"/>
<field eval="&quot;&quot;&quot;Lesbrouffe&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Ms.&quot;&quot;&quot;" name="title"/>
<field ref="base.res_partner_title_madam" name="title"/>
<field eval="1" name="active"/>
</record>
<record id="res_partner_contact_zen0" model="res.partner.contact">
@ -66,73 +66,73 @@
<field eval="&quot;&quot;&quot;http://fptiny.blogspot.com/&quot;&quot;&quot;" name="website"/>
<field eval="&quot;&quot;&quot;Fabien&quot;&quot;&quot;" name="first_name"/>
<field eval="&quot;&quot;&quot;Pinckaers&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;M.&quot;&quot;&quot;" name="title"/>
<field ref="base.res_partner_title_sir" name="title"/>
<field eval="1" name="active"/>
</record>
<record id="res_partner_contact_debois0" model="res.partner.contact">
<field eval="&quot;&quot;&quot;Marc&quot;&quot;&quot;" name="first_name"/>
<field eval="&quot;&quot;&quot;Debois&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;M.&quot;&quot;&quot;" name="title"/>
<field ref="base.res_partner_title_sir" name="title"/>
<field eval="1" name="active"/>
</record>
<record id="res_partner_contact_luu0" model="res.partner.contact">
<field eval="&quot;&quot;&quot;Phuong&quot;&quot;&quot;" name="first_name"/>
<field eval="&quot;&quot;&quot;Luu&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Ms.&quot;&quot;&quot;" name="title"/>
<field ref="base.res_partner_title_madam" name="title"/>
<field eval="1" name="active"/>
</record>
<record id="res_partner_contact_elkhayat0" model="res.partner.contact">
<field eval="&quot;&quot;&quot;Najlaa&quot;&quot;&quot;" name="first_name"/>
<field eval="&quot;&quot;&quot;Khayat&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Ms.&quot;&quot;&quot;" name="title"/>
<field ref="base.res_partner_title_madam" name="title"/>
<field eval="1" name="active"/>
</record>
<record id="res_partner_contact_depaoli0" model="res.partner.contact">
<field eval="&quot;&quot;&quot;Quentin&quot;&quot;&quot;" name="first_name"/>
<field eval="&quot;&quot;&quot;Paolino&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;M.&quot;&quot;&quot;" name="title"/>
<field ref="base.res_partner_title_sir" name="title"/>
<field eval="1" name="active"/>
</record>
<record id="res_partner_contact_semal0" model="res.partner.contact">
<field eval="&quot;&quot;&quot;Fabian&quot;&quot;&quot;" name="first_name"/>
<field eval="&quot;&quot;&quot;W.&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;M.&quot;&quot;&quot;" name="title"/>
<field ref="base.res_partner_title_sir" name="title"/>
<field eval="1" name="active"/>
</record>
<record id="res_partner_contact_vandewerve0" model="res.partner.contact">
<field eval="&quot;&quot;&quot;Yvan&quot;&quot;&quot;" name="first_name"/>
<field eval="&quot;&quot;&quot;van de Werve&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;M.&quot;&quot;&quot;" name="title"/>
<field ref="base.res_partner_title_sir" name="title"/>
<field eval="1" name="active"/>
</record>
<record id="res_partner_contact_lambotte0" model="res.partner.contact">
<field eval="&quot;&quot;&quot;Henry&quot;&quot;&quot;" name="first_name"/>
<field eval="&quot;&quot;&quot;Lambotte&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;M.&quot;&quot;&quot;" name="title"/>
<field ref="base.res_partner_title_sir" name="title"/>
<field eval="1" name="active"/>
</record>
<record id="res_partner_contact_laurent0" model="res.partner.contact">
<field eval="&quot;&quot;&quot;Olivier&quot;&quot;&quot;" name="first_name"/>
<field eval="&quot;&quot;&quot;Laurent&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;M.&quot;&quot;&quot;" name="title"/>
<field ref="base.res_partner_title_sir" name="title"/>
<field eval="1" name="active"/>
</record>
<record id="res_partner_contact_simonis0" model="res.partner.contact">
<field eval="&quot;&quot;&quot;Christophe&quot;&quot;&quot;" name="first_name"/>
<field eval="&quot;&quot;&quot;Dupont&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;M.&quot;&quot;&quot;" name="title"/>
<field ref="base.res_partner_title_sir" name="title"/>
<field eval="1" name="active"/>
</record>
<record id="res_partner_contact_wirtel0" model="res.partner.contact">
<field eval="&quot;&quot;&quot;Stéphane&quot;&quot;&quot;" name="first_name"/>
<field eval="&quot;&quot;&quot;Andre&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;M.&quot;&quot;&quot;" name="title"/>
<field ref="base.res_partner_title_sir" name="title"/>
<field eval="1" name="active"/>
</record>
<record id="res_partner_contact_mignon0" model="res.partner.contact">
<field eval="&quot;&quot;&quot;Philippe&quot;&quot;&quot;" name="first_name"/>
<field eval="&quot;&quot;&quot;Antoine&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;M.&quot;&quot;&quot;" name="title"/>
<field ref="base.res_partner_title_sir" name="title"/>
<field eval="1" name="active"/>
</record>

View File

@ -29,37 +29,39 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Partner Contact">
<field name="name" select="1"/>
<field name="first_name" select="1"/>
<group colspan="4" col="6">
<field name="title" select="1" widget="selection" domain="[('domain', '=', 'contact')]" size="0"/>
<field name="name" select="1"/>
<field name="first_name" select="1"/>
</group>
<notebook colspan="4" >
<page string="General">
<newline/>
<separator string="General Information" colspan="4"/>
<group string="Partner" colspan="2" col="2">
<field name="partner_id" invisible="1" select="1"/>
<field name="title" select="1"/>
<field name="function" invisible="1"/>
<field name="email"/>
<field name="lang_id"/>
<field name="active"/>
</group>
<group string="Communication" colspan="2" col="2">
<field name="mobile"/>
<field name="email" widget="email"/>
<field name="website"/>
</group>
<page string="General">
<group colspan="4" col="4">
<group colspan="2" col="4">
<separator string="Communication" colspan="4"/>
<field name="mobile"/>
<field name="email" widget="email"/>
<field name="website"/>
</group>
<group colspan="2" col="1">
<separator string="Photo" colspan="4"/>
<field name="photo" widget='image' nolabel="1"/>
</group>
</group>
<field name="job_ids" colspan="4" nolabel="1" mode="tree,form">
<form string="Functions and Addresses">
<group string="Partner" colspan="2" col="4">
<group colspan="4" col="4">
<field name="sequence_contact" />
<field name="function"/>
<field name="address_id"/>
<field name="name"/>
<field name="name"/>
<field name="address_id"/>
<field name="date_start" />
<field name="date_stop" />
<field name="state" />
<field name="sequence_contact" />
</group>
<group string="Communication" colspan="2" col="2">
<separator string="Communication" colspan="4"/>
<group colspan="4" col="4">
<field name="phone"/>
<field name="fax"/>
<field name="email" widget="email"/>
@ -81,16 +83,18 @@
</tree>
</field>
</page>
<page string="Extra Information">
<page string="Extra Information">
<field name="active"/>
<field name="lang_id" widget="selection"/>
<field name="partner_id" invisible="1" select="1"/>
<field name="function" invisible="1" />
<field name="country_id"/>
<field name="birthdate"/>
</page>
<page string="Notes">
<field name="comment" nolabel="1"/>
</page>
<page string="Picture">
<field name="photo" nolabel="1" colspan="2" widget="image"/>
</page>
</notebook>
</form>
</field>
@ -174,13 +178,14 @@
<field name="email"/>
</tree>
<form string="Contacts">
<group string="Partner" colspan="2" col="2">
<group colspan="4" col="4">
<field name="sequence_partner"/>
<field name="name"/>
<field name="contact_id"/>
<field name="function"/>
</group>
<group string="Communication" colspan="2" col="2">
<separator string="Communication" colspan="4"/>
<group colspan="4" col="4">
<field name="phone"/>
<field name="fax"/>
<field name="extension"/>

View File

@ -10,7 +10,7 @@
!record {model: res.lang, id: res_lang_french0}:
code: fr_BE
date_format: '%m/%d/%Y'
decimal_point: .
decimal_point: '.'
direction: ltr
grouping: '[]'
name: French
@ -30,7 +30,6 @@
lang_id: res_lang_french0
mobile: (+32).10.45.18.77
name: Williams
title: Mss
- |
Now in order to assign this contact to partner I will create one partner assign contact laura to this partner
-
@ -51,7 +50,7 @@
lang: fr_BE
name: Laura's Company
ref: LC
title: ltd
- |
Now I will check that the new job is assigned properly to contact or not
-
@ -74,7 +73,7 @@
lang_id: res_lang_french0
mobile: (+32).23.44.32.12
name: Pauwels
title: M.
- |
In order to check one contact working at one partner with different functions
I will create contact with 2 different jobs with different function but the same address
@ -92,5 +91,4 @@
lang_id: base_contact.res_lang_french0
mobile: (+32).10.45.18.77
name: Mortier
title: Mss

View File

@ -214,7 +214,7 @@ class crm_case(object):
def _history(self, cr, uid, cases, keyword, history=False, subject=None, email=False, details=None, email_from=False, message_id=False, attach=[], context={}):
mailgate_pool = self.pool.get('mailgate.thread')
return mailgate_pool._history(cr, uid, cases, keyword, history=history,\
return mailgate_pool.history(cr, uid, cases, keyword, history=history,\
subject=subject, email=email, \
details=details, email_from=email_from,\
message_id=message_id, attach=attach, \

View File

@ -157,16 +157,17 @@
</page>
<page string="Emails" groups="base.group_extended">
<group colspan="4">
<field colspan="4" name="email_cc" string="CC"/>
<field colspan="4" name="email_cc" string="CC" widget="char" size="512"/>
</group>
<!-- TODO-->
<field name="message_ids" colspan="4" nolabel="1" mode="form,tree">
<form string="Communication history">
<group col="6" colspan="4">
<group col="4" colspan="4">
<field name="email_from"/>
<field name="email_to"/>
<field name="date"/>
<field name="name" colspan="6"/>
<field name="email_to" widget="char" size="512"/>
<field name="email_cc" widget="char" size="512"/>
<field name="name" colspan="4" widget="char" size="512"/>
</group>
<notebook colspan="4">
<page string="Details">
@ -177,7 +178,7 @@
</page>
</notebook>
<button colspan="4"
string="Reply to Last Email"
string="Reply"
name="%(crm.action_crm_send_mail)d"
context="{'mail':'reply', 'model': 'crm.lead', 'include_original' : True}"
icon="gtk-undo" type="action" />

View File

@ -116,14 +116,16 @@
<page string="Emails" groups="base.group_extended">
<group colspan="4">
<field colspan="4" name="email_cc" string="CC"/>
<field colspan="4" name="email_cc" string="Cc" widget="char" size="512"/>
</group>
<field name="message_ids" colspan="4" nolabel="1" mode="form,tree" height="280">
<form string="Communication history">
<group col="6" colspan="4">
<field name="date"/>
<field name="email_to"/>
<group col="4" colspan="4">
<field name="email_from"/>
<field name="date"/>
<field name="email_to" widget="char" size="512"/>
<field name="email_cc" widget="char" size="512"/>
<field name="name" colspan="4" widget="char" size="512"/>
</group>
<notebook colspan="4">
<page string="Details">

View File

@ -217,7 +217,7 @@ class crm_lead_forward_to_partner(osv.osv_memory):
)
if result:
case_pool._history(cr, uid, [case], _('Forward'), history=True, email=this.email_to, subject=this.subject, details=body, email_from=email_from, attach=attach)
case_pool.history(cr, uid, [case], _('Forward'), history=True, email=this.email_to, subject=this.subject, details=body, email_from=email_from, attach=attach)
else:
raise osv.except_osv(_('Error!'), _('Unable to send mail. Please check SMTP is configured properly.'))

View File

@ -82,7 +82,7 @@ class crm_lead2opportunity(osv.osv_memory):
'type': 'opportunity'
}
lead_obj.write(cr, uid, lead.id, vals, context=context)
lead_obj._history(cr, uid, [lead], _('Opportunity'), details='Converted to Opportunity', context=context)
lead_obj.history(cr, uid, [lead], _('Opportunity'), details='Converted to Opportunity', context=context)
if lead.partner_id:
msg_ids = [ x.id for x in lead.message_ids]
self.pool.get('mailgate.message').write(cr, uid, msg_ids, {'partner_id': lead.partner_id.id}, context=context)

View File

@ -23,7 +23,6 @@
from osv import osv, fields
from tools.translate import _
import base64
import time
import tools
from crm import crm
@ -45,17 +44,17 @@ class crm_send_new_email_attachment(osv.osv_memory):
crm_send_new_email_attachment()
class crm_send_new_email(osv.osv_memory):
class crm_send_new_email2(osv.osv_memory):
""" Sends new email for the case"""
_name = "crm.send.mail"
_description = "Send new email"
_columns = {
'email_to' : fields.char('To', size=64, required=True),
'email_from' : fields.char('From', size=64, required=True),
'email_cc' : fields.char('CC', size=128, help="Carbon Copy: list of recipients that will receive"\
'email_to' : fields.char('To', size=512, required=True),
'email_from' : fields.char('From', size=128, required=True),
'email_cc' : fields.char('CC', size=512, help="Carbon Copy: list of recipients that will receive"\
" a copy of this mail, and future communication related to this case"),
'subject': fields.char('Subject', size=128, required=True),
'subject': fields.char('Subject', size=512, required=True),
'text': fields.text('Message', required=True),
'state': fields.selection(crm.AVAILABLE_STATES, string='Set New State To', required=True),
@ -72,7 +71,6 @@ class crm_send_new_email(osv.osv_memory):
"""
hist_obj = self.pool.get('mailgate.message')
smtp_pool = self.pool.get('email.smtpclient')
if not context:
context = {}
@ -130,10 +128,11 @@ class crm_send_new_email(osv.osv_memory):
if not flag:
raise osv.except_osv(_('Error!'), _('Unable to send mail. Please check SMTP is configured properly.'))
if flag:
case_pool._history(cr, uid, [case], _('Send'), history=True, \
case_pool.history(cr, uid, [case], _('Send'), history=True, \
email=obj.email_to, details=body, \
subject=obj.subject, email_from=email_from, \
message_id=message_id, references=ref_id or message_id, attach=attach)
email_cc=email_cc, message_id=message_id, \
references=ref_id or message_id, attach=attach)
if obj.state == 'unchanged':
pass
elif obj.state == 'done':
@ -157,7 +156,7 @@ class crm_send_new_email(osv.osv_memory):
if not context.get('model'):
raise osv.except_osv(_('Error'), _('Can not send mail!'))
res = super(crm_send_new_email, self).default_get(cr, uid, fields, context=context)
res = super(crm_send_new_email2, self).default_get(cr, uid, fields, context=context)
if context.get('mail') == 'reply':
res.update(self.get_reply_defaults(cr, uid, fields, context=context))
@ -248,13 +247,7 @@ class crm_send_new_email(osv.osv_memory):
if not context.get('model'):
raise osv.except_osv(_('Error'), _('Can not send mail!'))
model = context.get('model')
mod_obj = self.pool.get(model)
if context.get('mail') == 'reply':
return True
if tools.config.get('email_from'):
return True
return True
crm_send_new_email()
crm_send_new_email2()

View File

@ -254,6 +254,7 @@ and users by email"),
'reference': False,
'invoice_line': [(6, 0, lines)],
'comment': "",
'date_invoice': context.get('date_inv', False)
})
inv_id = inv_pool.create(cr, uid, val_invoice['value'])
inv_pool.button_compute(cr, uid, [inv_id])

View File

@ -52,11 +52,15 @@ class partner_event_registration(osv.osv_memory):
record_ids = context and context.get('active_ids', []) or []
addr = res_obj.address_get(cr, uid, record_ids)
contact_id = False
email = False
if addr.has_key('default'):
job_ids = self.pool.get('res.partner.job').search(cr, uid, [('address_id', '=', addr['default'])])
if job_ids:
contact_id = self.pool.get('res.partner.job').browse(cr, uid, job_ids[0]).contact_id.id
contact = self.pool.get('res.partner.job').browse(cr, uid, job_ids[0])
if contact:
contact_id = contact.contact_id.id
email = contact.email
event_obj = self.pool.get('event.event')
reg_obj = self.pool.get('event.registration')
mod_obj = self.pool.get('ir.model.data')
@ -83,6 +87,7 @@ class partner_event_registration(osv.osv_memory):
'partner_invoice_id' : record_ids[0] or False,
'event_product': current.event_id.product_id.name,
'contact_id': contact_id,
'email_from': email,
'nb_register': current.nb_register,
}, context=context)

View File

@ -21,11 +21,11 @@
{
"name" : "Human Resources",
"version" : "1.1",
"author" : "Tiny",
"category" : "Generic Modules/Human Resources",
"website" : "http://www.openerp.com",
"name": "Human Resources",
"version": "1.1",
"author": "Tiny",
"category": "Generic Modules/Human Resources",
"website": "http://www.openerp.com",
"description": """
Module for human resource management. You can manage:
* Employees and hierarchies : You can define your employee with User and display hierarchies
@ -45,10 +45,11 @@
'hr_installer.xml',
'hr_data.xml',
'board_hr_view.xml',
],
'demo_xml': ['hr_demo.xml',
'hr_department_demo.xml'],
],
'demo_xml': [
'hr_demo.xml',
'hr_department_demo.xml'
],
'test': ['test/test_hr.yml'],
'installable': True,
'active': False,

View File

@ -27,9 +27,8 @@ from tools.translate import _
class hr_employee_category(osv.osv):
_name = "hr.employee.category"
_description = "Employee Category"
_columns = {
'name' : fields.char("Category", size=64, required=True),
'name': fields.char("Category", size=64, required=True),
'parent_id': fields.many2one('hr.employee.category', 'Parent Category', select=True),
'child_ids': fields.one2many('hr.employee.category', 'parent_id', 'Child Categories')
}
@ -37,7 +36,7 @@ class hr_employee_category(osv.osv):
def _check_recursion(self, cr, uid, ids):
level = 100
while len(ids):
cr.execute('select distinct parent_id from hr_employee_category where id IN %s',(tuple(ids),))
cr.execute('select distinct parent_id from hr_employee_category where id IN %s', (tuple(ids), ))
ids = filter(None, map(lambda x:x[0], cr.fetchall()))
if not level:
return False
@ -54,13 +53,14 @@ class hr_employee_marital_status(osv.osv):
_name = "hr.employee.marital.status"
_description = "Employee Marital Status"
_columns = {
'name' : fields.char('Marital Status', size=30, required=True),
'description' : fields.text('Status Description'),
'name': fields.char('Marital Status', size=30, required=True),
'description': fields.text('Status Description'),
}
hr_employee_marital_status()
class hr_job(osv.osv):
def _no_of_employee(self, cr, uid, ids, name,args,context=None):
def _no_of_employee(self, cr, uid, ids, name, args, context=None):
res = {}
for emp in self.browse(cr, uid, ids):
res[emp.id] = len(emp.employee_ids or [])
@ -70,19 +70,19 @@ class hr_job(osv.osv):
_description = "Job Description"
_columns = {
'name': fields.char('Job Name', size=128, required=True, select=True),
'expected_employees':fields.integer('Expected Employees', help='Required number of Employees'),
'expected_employees': fields.integer('Expected Employees', help='Required number of Employees'),
'no_of_employee': fields.function(_no_of_employee, method=True, string='No of Employees', type='integer', help='Number of Employees selected'),
'employee_ids':fields.one2many('hr.employee', 'job_id','Employees'),
'employee_ids': fields.one2many('hr.employee', 'job_id', 'Employees'),
'description': fields.text('Job Description'),
'requirements':fields.text('Requirements'),
'department_id':fields.many2one('hr.department','Department'),
'requirements': fields.text('Requirements'),
'department_id': fields.many2one('hr.department', 'Department'),
'company_id': fields.many2one('res.company', 'Company'),
'state': fields.selection([('open','Open'),('old','Old'),('recruit','In Recruitement')], 'State', required=True),
'state': fields.selection([('open', 'Open'),('old', 'Old'),('recruit', 'In Recruitement')], 'State', required=True),
}
_defaults = {
'expected_employees': lambda *a: 1,
'expected_employees': 1,
'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'hr.job', context=c),
'state': lambda *args: 'open'
'state': 'open'
}
hr_job()
@ -90,17 +90,17 @@ hr_job()
class hr_employee(osv.osv):
_name = "hr.employee"
_description = "Employee"
_inherits = {'resource.resource':"resource_id"}
_inherits = {'resource.resource': "resource_id"}
_columns = {
'country_id' : fields.many2one('res.country', 'Nationality'),
'birthday' : fields.date("Birthday"),
'country_id': fields.many2one('res.country', 'Nationality'),
'birthday': fields.date("Birthday"),
'ssnid': fields.char('SSN No', size=32, help='Social Security Number'),
'sinid': fields.char('SIN No', size=32),
'otherid': fields.char('Other ID', size=32),
'gender': fields.selection([('male','Male'),('female','Female')], 'Gender'),
'gender': fields.selection([('male', 'Male'),('female', 'Female')], 'Gender'),
'marital': fields.many2one('hr.employee.marital.status', 'Marital Status'),
'bank_account': fields.char('Bank Account', size=56),
'partner_id' : fields.related('company_id', 'partner_id', type='many2one', relation='res.partner', readonly=True),
'partner_id': fields.related('company_id', 'partner_id', type='many2one', relation='res.partner', readonly=True),
'department_id':fields.many2one('hr.department','Department'),
'address_id': fields.many2one('res.partner.address', 'Working Address'),
'address_home_id': fields.many2one('res.partner.address', 'Home Address'),
@ -109,8 +109,8 @@ class hr_employee(osv.osv):
'work_location': fields.char('Office Location', size=32),
'notes': fields.text('Notes'),
'parent_id': fields.many2one('hr.employee', 'Manager', select=True),
'category_id' : fields.many2one('hr.employee.category', 'Category'),
'child_ids': fields.one2many('hr.employee', 'parent_id','Subordinates'),
'category_id': fields.many2one('hr.employee.category', 'Category'),
'child_ids': fields.one2many('hr.employee', 'parent_id', 'Subordinates'),
'resource_id': fields.many2one('resource.resource', 'Resource', ondelete='cascade'),
'coach_id': fields.many2one('res.users', 'Coach'),
'job_id': fields.many2one('hr.job', 'Job'),
@ -123,7 +123,7 @@ class hr_employee(osv.osv):
'rb') .read().encode('base64')
_defaults = {
'active' : 1,
'active': 1,
'photo': _get_photo,
}

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="1">
<!-- Employee Marital Statusses -->
<record id="hr_employee_marital_status_single" model="hr.employee.marital.status">
<field name="name">Single</field>
@ -14,5 +15,6 @@
<record id="hr_employee_marital_status_widower" model="hr.employee.marital.status">
<field name="name">Widower</field>
</record>
</data>
</openerp>

View File

@ -25,6 +25,8 @@ import tools
class hr_department(osv.osv):
def name_get(self, cr, uid, ids, context=None):
if context is None:
context = {}
if not len(ids):
return []
reads = self.read(cr, uid, ids, ['name','parent_id'], context)
@ -36,7 +38,7 @@ class hr_department(osv.osv):
res.append((record['id'], name))
return res
def _dept_name_get_fnc(self, cr, uid, ids, prop, unknow_none, context):
def _dept_name_get_fnc(self, cr, uid, ids, prop, unknow_none, context=None):
res = self.name_get(cr, uid, ids, context)
return dict(res)
@ -51,13 +53,19 @@ class hr_department(osv.osv):
'manager_id': fields.many2one('res.users', 'Manager', required=True),
'member_ids': fields.many2many('res.users', 'hr_department_user_rel', 'department_id', 'user_id', 'Members'),
}
def _get_members(self,cr, uid, context={}):
mids = self.search(cr, uid, [('manager_id','=',uid)])
_defaults = {
'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'hr.department', context=c),
}
def _get_members(self,cr, uid, context=None):
mids = self.search(cr, uid, [('manager_id', '=', uid)])
result = {uid:1}
for m in self.browse(cr, uid, mids, context):
for user in m.member_ids:
result[user.id] = 1
return result.keys()
def _check_recursion(self, cr, uid, ids):
level = 100
while len(ids):
@ -78,18 +86,17 @@ hr_department()
class ir_action_window(osv.osv):
_inherit = 'ir.actions.act_window'
def read(self, cr, uid, ids, fields=None, context=None,
load='_classic_read'):
def read(self, cr, uid, ids, fields=None, context=None, load='_classic_read'):
if context is None:
context = {}
select = ids
if isinstance(ids, (int, long)):
select = [ids]
res = super(ir_action_window, self).read(cr, uid, select, fields=fields,
context=context, load=load)
res = super(ir_action_window, self).read(cr, uid, select, fields=fields, context=context, load=load)
for r in res:
mystring = 'department_users_get()'
if mystring in (r.get('domain', '[]') or ''):
r['domain'] = r['domain'].replace(mystring, str(
self.pool.get('hr.department')._get_members(cr, uid)))
r['domain'] = r['domain'].replace(mystring, str(self.pool.get('hr.department')._get_members(cr, uid)))
if isinstance(ids, (int, long)):
if res:
return res[0]
@ -103,7 +110,7 @@ class res_users(osv.osv):
_inherit = 'res.users'
_description = 'User'
def _parent_compute(self, cr, uid, ids, name, args, context={}):
def _parent_compute(self, cr, uid, ids, name, args, context=None):
result = {}
obj_dept = self.pool.get('hr.department')
for user_id in ids:
@ -125,10 +132,12 @@ class res_users(osv.osv):
return [('id', 'in', [0])]
return [('id', 'in', child_ids.get(uid,[]))]
def _child_compute(self, cr, uid, ids, name, args, context={}):
def _child_compute(self, cr, uid, ids, name, args, context=None):
obj_dept = self.pool.get('hr.department')
obj_user = self.pool.get('res.users')
result = {}
if context is None:
context = {}
for manager_id in ids:
child_ids = []
mgnt_dept_ids = obj_dept.search(cr, uid, [('manager_id', '=', manager_id)])
@ -137,10 +146,9 @@ class res_users(osv.osv):
data_dept = obj_dept.read(cr, uid, ids_dept, ['member_ids'])
childs = map(lambda x: x['member_ids'], data_dept)
childs = tools.flatten(childs)
childs = obj_user.search(cr, uid, [('id','in',childs),('active','=',True)])
childs = obj_user.search(cr, uid, [('id', 'in', childs),('active', '=', True)])
if manager_id in childs:
childs.remove(manager_id)
child_ids.extend(tools.flatten(childs))
set = {}
map(set.__setitem__, child_ids, [])
@ -150,7 +158,7 @@ class res_users(osv.osv):
result[manager_id] = child_ids
return result
def _child_search(self, cr, uid, obj, name, args, context):
def _child_search(self, cr, uid, obj, name, args, context=None):
parent = []
for arg in args:
if arg[0] == 'child_ids':
@ -161,9 +169,11 @@ class res_users(osv.osv):
return [('id', 'in', child_ids.get(uid,[]))]
_columns = {
'parent_id': fields.function(_parent_compute, relation='res.users',fnct_search=_parent_search, method=True, string="Managers", type='many2many'),
'parent_id': fields.function(_parent_compute, relation='res.users', fnct_search=_parent_search, method=True, string="Managers", type='many2many'),
'child_ids': fields.function(_child_compute, relation='res.users', fnct_search=_child_search, method=True, string="Subordinates", type='many2many'),
'context_department_id': fields.many2one('hr.department', 'Departments'),
}
res_users()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,5 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_hr_installer" model="ir.ui.view">
<field name="name">hr.installer.view</field>
<field name="model">hr.installer</field>
@ -7,20 +9,18 @@
<field name="inherit_id" ref="base.res_config_installer"/>
<field name="arch" type="xml">
<data>
<form position="attributes">
<attribute name="string">Select Human Resources Modules To Install</attribute>
</form>
<separator string="title" position="attributes">
<attribute name="string">Select Human Resources Modules To Install</attribute>
</separator>
<xpath expr='//separator[@string="vsep"]' position='attributes'>
<form position="attributes">
<attribute name="string">Select Human Resources Modules To Install</attribute>
</form>
<separator string="title" position="attributes">
<attribute name="string">Select Human Resources Modules To Install</attribute>
</separator>
<xpath expr='//separator[@string="vsep"]' position='attributes'>
<attribute name='string'></attribute>
</xpath>
<xpath expr="//label[@string='description']"
position="attributes">
<attribute name="string">The base Human Resources addon will help you manage your employee roster, but you can enhance it even further by installing a few HR-related applications.</attribute>
</xpath>
</xpath>
<xpath expr="//label[@string='description']" position="attributes">
<attribute name="string">The base Human Resources addon will help you manage your employee roster, but you can enhance it even further by installing a few HR-related applications.</attribute>
</xpath>
<group colspan="8">
<field name="hr_holidays"/>
<field name="hr_expense"/>
@ -51,16 +51,18 @@
<field name="action_id" ref="action_hr_installer"/>
<field name="sequence">3</field>
</record>
<record id="hr_ir_actions_todo_tree" model="ir.ui.view">
<field name="model">ir.actions.todo</field>
<field name="name">hr_installer_action_replace</field>
<field name="type">tree</field>
<field name="inherit_id" ref="base.ir_actions_todo_tree"/>
<field name="arch" type="xml">
<record id="hr_ir_actions_todo_tree" model="ir.ui.view">
<field name="model">ir.actions.todo</field>
<field name="name">hr_installer_action_replace</field>
<field name="type">tree</field>
<field name="inherit_id" ref="base.ir_actions_todo_tree"/>
<field name="arch" type="xml">
<xpath expr="//button[@string='Launch']" position="replace">
<button name="%(action_hr_installer)d" states="open,skip" string="Launch" type="action" icon="gtk-execute" help="Launch Configuration Wizard"/>
</xpath>
</field>
</field>
</record>
</data>
</openerp>

View File

@ -1,32 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<menuitem
id="menu_hr_root"
icon="terp-hr"
name="Human Resources"
sequence="15"/>
<menuitem
id="menu_hr_main"
parent="menu_hr_root"
name="Human Resources"
sequence="0"/>
<menuitem
id="menu_hr_configuration"
name="Configuration"
parent="hr.menu_hr_root"
groups="group_hr_manager"
sequence="50" />
<menuitem
id="menu_hr_management"
name="Human Resources"
parent="hr.menu_hr_configuration"
groups="group_hr_manager"
sequence="1" />
<menuitem
id="menu_view_employee_category_configuration_form"
parent="hr.menu_hr_management"
name="Employees"
<menuitem id="menu_hr_root" icon="terp-hr" name="Human Resources" sequence="15"/>
<menuitem id="menu_hr_main" parent="menu_hr_root" name="Human Resources" sequence="0"/>
<menuitem id="menu_hr_configuration" name="Configuration" parent="hr.menu_hr_root" groups="group_hr_manager" sequence="50" />
<menuitem id="menu_hr_management" name="Human Resources" parent="hr.menu_hr_configuration" groups="group_hr_manager" sequence="1" />
<menuitem id="menu_view_employee_category_configuration_form" parent="hr.menu_hr_management" name="Employees"
sequence="1"/>
<!--
@ -42,50 +22,50 @@
<form string="Employee">
<group colspan="4" col="8">
<group colspan="6" col="6">
<field colspan="6" name="name" />
<field name="user_id"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
<field name="active" groups="base.group_extended"/>
<newline/>
<field name="parent_id" />
<field name="coach_id" />
<field colspan="6" name="name" />
<field name="user_id"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
<field name="active" groups="base.group_extended"/>
<newline/>
<field name="parent_id" />
<field name="coach_id" />
</group>
<group colspan="2" col="1">
<field name="photo" widget='image' nolabel="1"/>
<field name="photo" widget='image' nolabel="1"/>
</group>
</group>
<notebook colspan="6">
<page string="Personal Information">
<group col="2" colspan="2">
<separator colspan="2" string="Social IDs"/>
<field name="ssnid"/>
<field name="sinid" groups="base.group_extended"/>
<field name="otherid" groups="base.group_extended"/>
<separator colspan="2" string="Social IDs"/>
<field name="ssnid"/>
<field name="sinid" groups="base.group_extended"/>
<field name="otherid" groups="base.group_extended"/>
</group>
<group col="2" colspan="2">
<separator string="Status" colspan="2"/>
<field name="gender"/>
<field name="marital" widget="selection"/>
<field name="country_id"/>
<field name="birthday"/>
<separator string="Status" colspan="2"/>
<field name="gender"/>
<field name="marital" widget="selection"/>
<field name="country_id"/>
<field name="birthday"/>
</group>
<group col="2" colspan="2">
<separator string="Contact Information" colspan="2"/>
<field name="address_home_id" colspan="2"/>
<field name="partner_id" invisible="1" />
<field name="address_id" colspan="2" domain="[('partner_id', '=', partner_id)]"/>
<field name="work_phone"/>
<field name="work_email" widget="email" />
<field name="work_location"/>
<separator string="Contact Information" colspan="2"/>
<field name="address_home_id" colspan="2"/>
<field name="partner_id" invisible="1" />
<field name="address_id" colspan="2" domain="[('partner_id', '=', partner_id)]"/>
<field name="work_phone"/>
<field name="work_email" widget="email" />
<field name="work_location"/>
</group>
<group col="2" colspan="2">
<separator string="Position" colspan="2"/>
<field name="job_id" widget="selection"/>
<field name="department_id" widget="selection"/>
<field name="category_id" />
<!--<separator string="Managers" colspan="2"/>
<field name="parent_id" />
<field name="coach_id" />-->
<separator string="Position" colspan="2"/>
<field name="job_id" widget="selection"/>
<field name="department_id" widget="selection"/>
<field name="category_id" />
<!--<separator string="Managers" colspan="2"/>
<field name="parent_id" />
<field name="coach_id" />-->
</group>
</page>
<page string="Notes">
@ -112,29 +92,30 @@
</tree>
</field>
</record>
<record id="view_employee_filter" model="ir.ui.view">
<field name="name">Employees</field>
<field name="model">hr.employee</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Employees">
<filter icon="terp-personal-" domain="[('active','=',False)]" string="Unactive"
groups="base.group_extended"/>
<filter icon="terp-personal-" domain="[('active','=',False)]" string="Unactive" groups="base.group_extended"/>
<field name="name"/>
<field name="department_id" widget="selection"/>
<field name="job_id" widget="selection"/>
<field name="parent_id"/>
<newline />
<group expand="0" string="Group By...">
<filter string="Manager" icon="terp-personal" domain="[]" context="{'group_by':'parent_id'}"/>
<filter string="Coach" icon="terp-personal" domain="[]" context="{'group_by':'coach_id'}" groups="base.group_extended"/>
<separator orientation="vertical" />
<filter string="Department" icon="terp-personal+" domain="[]" context="{'group_by':'department_id'}"/>
<filter string="Job" icon="terp-gtk-select-all" domain="[]" context="{'group_by':'job_id'}"/>
<filter string="Manager" icon="terp-personal" domain="[]" context="{'group_by':'parent_id'}"/>
<filter string="Coach" icon="terp-personal" domain="[]" context="{'group_by':'coach_id'}" groups="base.group_extended"/>
<separator orientation="vertical" />
<filter string="Department" icon="terp-personal+" domain="[]" context="{'group_by':'department_id'}"/>
<filter string="Job" icon="terp-gtk-select-all" domain="[]" context="{'group_by':'job_id'}"/>
</group>
</search>
</field>
</record>
<record id="open_view_employee_tree" model="ir.actions.act_window">
<field name="name">Employees Structure</field>
<field name="res_model">hr.employee</field>
@ -153,7 +134,8 @@
<field name="view_id" eval="False"/>
<field name="search_view_id" ref="view_employee_filter"/>
</record>
<record id="open_view_employee_list_my" model="ir.actions.act_window">
<record id="open_view_employee_list_my" model="ir.actions.act_window">
<field name="name">Employees</field>
<field name="res_model">hr.employee</field>
<field name="view_type">form</field>
@ -162,17 +144,14 @@
<field name="view_id" ref="view_employee_tree"/>
<field name="search_view_id" ref="view_employee_filter"/>
</record>
<menuitem
action="open_view_employee_list_my"
id="menu_open_view_employee_list_my"
sequence="3"
parent="menu_hr_main"/>
<menuitem action="open_view_employee_list_my" id="menu_open_view_employee_list_my" sequence="3" parent="menu_hr_main"/>
<!--
=======================
Employee marital status
======================= -->
=======================
-->
<record id="hr_hr_employee_marital_status_form" model="ir.ui.view">
<field name="name">hr.hr.employee.marital.status</field>
@ -194,17 +173,15 @@
<field name="view_mode">tree,form</field>
</record>
<menuitem
action="action_hr_marital_status"
id="hr_menu_marital_status"
<menuitem action="action_hr_marital_status" id="hr_menu_marital_status"
parent="hr.menu_view_employee_category_configuration_form" sequence="3"/>
<!--
=======================
Employee architecture
=======================
-->
<record id="view_partner_tree2" model="ir.ui.view">
<field name="name">hr.employee.tree</field>
<field name="model">hr.employee</field>
@ -216,10 +193,10 @@
<field name="ssnid"/>
<field name="user_id"/>
<field name="address_id"/>
</tree>
</field>
</record>
<record id="action2" model="ir.actions.act_window">
<field name="name">Employee Hierarchy</field>
<field name="type">ir.actions.act_window</field>
@ -228,6 +205,7 @@
<field name="view_type">tree</field>
<field name="view_id" ref="view_partner_tree2"/>
</record>
<ir_set>
<field eval="'action'" name="key"/>
<field eval="'client_action_multi'" name="key2"/>
@ -255,6 +233,7 @@
</form>
</field>
</record>
<record id="view_employee_category_list" model="ir.ui.view">
<field name="name">hr.employee.category.list</field>
<field name="model">hr.employee.category</field>
@ -267,6 +246,7 @@
</tree>
</field>
</record>
<record id="view_employee_category_tree" model="ir.ui.view">
<field name="name">hr.employee.category.tree</field>
<field name="model">hr.employee.category</field>
@ -278,6 +258,7 @@
</tree>
</field>
</record>
<record id="open_view_categ_form" model="ir.actions.act_window">
<field name="name">Categories of Employee</field>
<field name="res_model">hr.employee.category</field>
@ -285,10 +266,8 @@
<field name="view_mode">tree,form</field>
</record>
<menuitem action="open_view_categ_form"
id="menu_view_employee_category_form"
parent="menu_view_employee_category_configuration_form" sequence="1"
groups="base.group_extended"/>
<menuitem action="open_view_categ_form" id="menu_view_employee_category_form"
parent="menu_view_employee_category_configuration_form" sequence="1" groups="base.group_extended"/>
<record id="open_view_categ_tree" model="ir.actions.act_window">
<field name="name">Categories structure</field>
@ -316,9 +295,7 @@
<field eval="True" name="object"/>
</record>
<menuitem
action="open_view_categ_tree"
groups="base.group_extended"
<menuitem action="open_view_categ_tree" groups="base.group_extended"
id="menu_view_employee_category_tree" parent="hr.menu_view_employee_category_form"/>
<record id="view_hr_job_form" model="ir.ui.view">
@ -328,11 +305,11 @@
<field name="arch" type="xml">
<form string="Job">
<group col="6" colspan="4">
<field name="name" />
<field name="department_id" />
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
<field name="expected_employees"/>
<field name="no_of_employee"/>
<field name="name" />
<field name="department_id" />
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
<field name="expected_employees"/>
<field name="no_of_employee"/>
</group>
<newline/>
<notebook colspan="4">
@ -350,6 +327,7 @@
</form>
</field>
</record>
<record id="view_hr_job_tree" model="ir.ui.view">
<field name="name">hr.job.tree</field>
<field name="model">hr.job</field>
@ -364,35 +342,28 @@
</tree>
</field>
</record>
<record id="view_job_filter" model="ir.ui.view">
<field name="name">Job</field>
<field name="model">hr.job</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Jobs">
<filter icon="terp-check"
domain="[('state','in',('open','recruit'))]"
string="Current"
<filter icon="terp-check" domain="[('state','in',('open','recruit'))]" string="Current"
help="Open and in recruitment positions"/>
<filter icon="terp-personal+"
domain="[('state','=','recruit')]"
string="Recruitment"
<filter icon="terp-personal+" domain="[('state','=','recruit')]" string="Recruitment"
help="In Recruitment"/>
<filter icon="terp-camera_test"
domain="[('state','=','open')]"
string="Open"
<filter icon="terp-camera_test" domain="[('state','=','open')]" string="Open"
help="Open Positions"/>
<separator orientation="vertical"/>
<field name="name"/>
<field name="department_id" widget="selection">
<filter icon="terp-gtk-select-all"
domain="[('department_id','=',context.get('department_id',False))]"
help="My Departments Jobs"/>
<field name="department_id" widget="selection">
<filter icon="terp-gtk-select-all" domain="[('department_id','=',context.get('department_id',False))]" help="My Departments Jobs"/>
</field>
</search>
</field>
</record>
<record model="ir.actions.act_window" id="action_hr_job">
<field name="name">Job Positions</field>
<field name="res_model">hr.job</field>
@ -400,14 +371,8 @@
<field name="view_mode">tree,form</field>
</record>
<menuitem
name="Recruitment"
id="base.menu_crm_case_job_req_main"
parent="menu_hr_root"/>
<menuitem
parent="base.menu_crm_case_job_req_main"
id="menu_hr_job"
action="action_hr_job" sequence="2"/>
<menuitem name="Recruitment" id="base.menu_crm_case_job_req_main" parent="menu_hr_root"/>
<menuitem parent="base.menu_crm_case_job_req_main" id="menu_hr_job" action="action_hr_job" sequence="2"/>
</data>
</openerp>

View File

@ -23,29 +23,28 @@ from osv import fields, osv
class hr_installer(osv.osv_memory):
_name = 'hr.installer'
_inherit = 'res.config.installer'
_columns = {
# Human Resources Management
'hr_holidays':fields.boolean('Holidays / Leaves Management',
'hr_holidays': fields.boolean('Holidays / Leaves Management',
help="Tracks employee leaves allocations, requests and planning."
"\n\nCan also plug into OpenERP's agendas and calendars "
"applications in order to display accepted leaves requests on"
" OpenERP's calendars."),
'hr_expense':fields.boolean('Expenses',
'hr_expense': fields.boolean('Expenses',
help="Tracks and manages employee expenses, and can "
"automatically re-invoice clients if the expenses are "
"project-related."),
'hr_recruitment':fields.boolean('Recruitment Process',
'hr_recruitment': fields.boolean('Recruitment Process',
help="Helps you manage and streamline your recruitment process."),
'hr_timesheet_sheet':fields.boolean('Timesheets',
help="Tracks and helps employees encode and validate timesheets "
"and attendance."),
'hr_contract':fields.boolean("Employee's Contracts",
'hr_contract': fields.boolean("Employee's Contracts",
help="Extends employee profiles to help manage their contracts."),
'hr_evaluation':fields.boolean('Periodic Evaluations',
'hr_evaluation': fields.boolean('Periodic Evaluations',
help="Lets you create and manage the periodic evaluation and "
"performance review of employees."),
'hr_attendance':fields.boolean('Attendances (Sign In/Out)',
'hr_attendance': fields.boolean('Attendances (Sign In/Out)',
help="Simplifies the management of employee attendances."),
}
_defaults = {
@ -55,4 +54,4 @@ class hr_installer(osv.osv_memory):
hr_installer()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,11 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="1">
<record id="group_hr_manager" model="res.groups">
<field name="name">Human Resources / Manager</field>
</record>
<record id="group_hr_user" model="res.groups">
<field name="name">Human Resources / User</field>
</record>
</data>
</openerp>

View File

@ -26,7 +26,6 @@
'category': 'Generic Modules/Human Resources',
'description': """
This module aims to manage employee's attendances.
Keeps account of the attendances of the employees on the basis of the
actions(Sign in/Sign out) performed by them.
""",
@ -42,7 +41,7 @@
'wizard/hr_attendance_byweek_view.xml',
'wizard/hr_attendance_error_view.xml',
'wizard/hr_attendance_sign_in_out_view.xml',
],
],
'demo_xml': ['hr_attendance_demo.xml'],
'test': ['test/test_hr_attendance.yml'],
'installable': True,

View File

@ -19,7 +19,6 @@
#
##############################################################################
from mx import DateTime
import time
from osv import fields, osv
@ -29,16 +28,16 @@ class hr_action_reason(osv.osv):
_name = "hr.action.reason"
_description = "Action Reason"
_columns = {
'name' : fields.char('Reason', size=64, required=True, help='Specifies the reason for Signing In/Signing Out.'),
'action_type' : fields.selection([('sign_in', 'Sign in'), ('sign_out', 'Sign out')], "Action's type"),
'name': fields.char('Reason', size=64, required=True, help='Specifies the reason for Signing In/Signing Out.'),
'action_type': fields.selection([('sign_in', 'Sign in'), ('sign_out', 'Sign out')], "Action's type"),
}
_defaults = {
'action_type' : lambda *a: 'sign_in',
'action_type': 'sign_in',
}
hr_action_reason()
def _employee_get(obj, cr, uid, context=None):
ids = obj.pool.get('hr.employee').search(cr, uid, [('user_id','=', uid)])
ids = obj.pool.get('hr.employee').search(cr, uid, [('user_id', '=', uid)])
if ids:
return ids[0]
return False
@ -51,18 +50,18 @@ class hr_attendance(osv.osv):
res = dict.fromkeys(ids, '')
for obj in self.browse(cr, uid, ids, context=context):
res[obj.id] = time.strftime('%Y-%m-%d', time.strptime(obj.name, '%Y-%m-%d %H:%M:%S'))
return res
_columns = {
'name' : fields.datetime('Date', required=True, select=1),
'action' : fields.selection([('sign_in', 'Sign In'), ('sign_out', 'Sign Out'),('action','Action')], 'Action', required=True),
'action_desc' : fields.many2one("hr.action.reason", "Action reason", domain="[('action_type', '=', action)]", help='Specifies the reason for Signing In/Signing Out in case of extra hours.'),
'employee_id' : fields.many2one('hr.employee', "Employee's Name", required=True, select=True),
'day' : fields.function(_day_compute, method=True, type='char', string='Day', store=True, select=1, size=32),
'name': fields.datetime('Date', required=True, select=1),
'action': fields.selection([('sign_in', 'Sign In'), ('sign_out', 'Sign Out'), ('action','Action')], 'Action', required=True),
'action_desc': fields.many2one("hr.action.reason", "Action reason", domain="[('action_type', '=', action)]", help='Specifies the reason for Signing In/Signing Out in case of extra hours.'),
'employee_id': fields.many2one('hr.employee', "Employee's Name", required=True, select=True),
'day': fields.function(_day_compute, method=True, type='char', string='Day', store=True, select=1, size=32),
}
_defaults = {
'name' : lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),
'employee_id' : _employee_get,
'name': time.strftime('%Y-%m-%d %H:%M:%S'),
'employee_id': _employee_get,
}
def _altern_si_so(self, cr, uid, ids):
@ -75,7 +74,6 @@ class hr_attendance(osv.osv):
and name <= (select name from hr_attendance where id=%s)
order by name desc
limit 2 '''
cr.execute(sql,(id,id))
atts = cr.fetchall()
if not ((len(atts)==1 and atts[0][0] == 'sign_in') or (atts[0][0] != atts[1][0] and atts[0][1] != atts[1][1])):
@ -113,19 +111,18 @@ class hr_employee(osv.osv):
'state': fields.function(_state, method=True, type='selection', selection=[('absent', 'Absent'), ('present', 'Present')], string='Attendance'),
}
def _action_check(self, cr, uid, emp_id, dt=False,context={}):
def _action_check(self, cr, uid, emp_id, dt=False, context=None):
cr.execute('select max(name) from hr_attendance where employee_id=%s', (emp_id,))
res = cr.fetchone()
return not (res and (res[0]>=(dt or time.strftime('%Y-%m-%d %H:%M:%S'))))
def attendance_action_change(self, cr, uid, ids, type='action', context={}, dt=False, *args):
def attendance_action_change(self, cr, uid, ids, type='action', context=None, dt=False, *args):
id = False
warning_sign = 'sign'
#Special case when button calls this method :type=context
if isinstance(type,dict):
if isinstance(type, dict):
type = type.get('type','action')
if type == 'sign_in':
warning_sign = "Sign In"
elif type == 'sign_out':
@ -135,15 +132,15 @@ class hr_employee(osv.osv):
if not self._action_check(cr, uid, emp['id'], dt, context):
raise osv.except_osv(_('Warning'), _('You tried to %s with a date anterior to another event !\nTry to contact the administrator to correct attendances.')%(warning_sign,))
res = {'action' : type, 'employee_id' : emp['id']}
res = {'action': type, 'employee_id': emp['id']}
if dt:
res['name'] = dt
id = self.pool.get('hr.attendance').create(cr, uid, res, context=context)
if type != 'action':
return id
return True
hr_employee()

View File

@ -7,100 +7,120 @@
<field name="action">sign_in</field>
<field name="employee_id" ref="hr.employee1"/>
</record>
<record id="attendance2" model="hr.attendance">
<field eval="time.strftime('%Y-%m-01 11:51')" name="name"/>
<field name="action">sign_out</field>
<field name="employee_id" ref="hr.employee1"/>
</record>
<record id="attendance3" model="hr.attendance">
<field eval="time.strftime('%Y-%m-02 12:47')" name="name"/>
<field name="action">sign_in</field>
<field name="employee_id" ref="hr.employee1"/>
</record>
<record id="attendance4" model="hr.attendance">
<field eval="time.strftime('%Y-%m-02 19:53')" name="name"/>
<field name="action">sign_out</field>
<field name="employee_id" ref="hr.employee1"/>
</record>
<record id="attendance5" model="hr.attendance">
<field eval="time.strftime('%Y-%m-03 07:32')" name="name"/>
<field name="action">sign_in</field>
<field name="employee_id" ref="hr.employee1"/>
</record>
<record id="attendance6" model="hr.attendance">
<field eval="time.strftime('%Y-%m-03 12:32')" name="name"/>
<field name="action">sign_out</field>
<field name="employee_id" ref="hr.employee1"/>
</record>
<record id="attendance7" model="hr.attendance">
<field eval="time.strftime('%Y-%m-04 14:01')" name="name"/>
<field name="action">sign_in</field>
<field name="employee_id" ref="hr.employee1"/>
</record>
<record id="attendance8" model="hr.attendance">
<field eval="time.strftime('%Y-%m-04 17:21')" name="name"/>
<field name="action">sign_out</field>
<field name="employee_id" ref="hr.employee1"/>
</record>
<record id="attendance9" model="hr.attendance">
<field eval="time.strftime('%Y-%m-05 09:10')" name="name"/>
<field name="action">sign_in</field>
<field name="employee_id" ref="hr.employee1"/>
</record>
<record id="attendance10" model="hr.attendance">
<field eval="time.strftime('%Y-%m-05 12:42')" name="name"/>
<field name="action">sign_out</field>
<field name="employee_id" ref="hr.employee1"/>
</record>
<record id="attendance11" model="hr.attendance">
<field eval="time.strftime('%Y-%m-06 13:10')" name="name"/>
<field name="action">sign_in</field>
<field name="employee_id" ref="hr.employee1"/>
</record>
<record id="attendance12" model="hr.attendance">
<field eval="time.strftime('%Y-%m-06 18:34')" name="name"/>
<field name="action">sign_out</field>
<field name="employee_id" ref="hr.employee1"/>
</record>
<record id="attendance13" model="hr.attendance">
<field eval="time.strftime('%Y-%m-07 08:21')" name="name"/>
<field name="action">sign_in</field>
<field name="employee_id" ref="hr.employee1"/>
</record>
<record id="attendance14" model="hr.attendance">
<field eval="time.strftime('%Y-%m-07 18:21')" name="name"/>
<field name="action">sign_out</field>
<field name="employee_id" ref="hr.employee1"/>
</record>
<record id="attendance15" model="hr.attendance">
<field eval="time.strftime('%Y-%m-08 08:21')" name="name"/>
<field name="action">sign_in</field>
<field name="employee_id" ref="hr.employee1"/>
</record>
<record id="attendance16" model="hr.attendance">
<field eval="time.strftime('%Y-%m-08 12:54')" name="name"/>
<field name="action">sign_out</field>
<field name="employee_id" ref="hr.employee1"/>
</record>
<record id="attendance17" model="hr.attendance">
<field eval="time.strftime('%Y-%m-09 13:32')" name="name"/>
<field name="action">sign_in</field>
<field name="employee_id" ref="hr.employee1"/>
</record>
<record id="attendance18" model="hr.attendance">
<field eval="time.strftime('%Y-%m-09 19:31')" name="name"/>
<field name="action">sign_out</field>
<field name="employee_id" ref="hr.employee1"/>
</record>
<record id="attendance19" model="hr.attendance">
<field eval="time.strftime('%Y-%m-10 07:10')" name="name"/>
<field name="action">sign_in</field>
<field name="employee_id" ref="hr.employee1"/>
</record>
<record id="attendance20" model="hr.attendance">
<field eval="time.strftime('%Y-%m-10 12:34')" name="name"/>
<field name="action">sign_out</field>
<field name="employee_id" ref="hr.employee1"/>
</record>
</data>
</openerp>

View File

@ -1,6 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<report auto="False" id="attendance_error_report" keyword="client_print_multi" menu="False" model="hr.employee" multi="True" name="report.hr.timesheet.attendance.error" rml="hr_attendance/report/attendance_errors.rml" string="Attendance Error Report"/>
</data>
</openerp>

View File

@ -8,13 +8,14 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Employee attendance">
<field name="employee_id" select="1"/>
<field name="name" select="1"/>
<field name="action" select="1"/>
<field name="action_desc" select="1"/>
<field name="employee_id" />
<field name="name" />
<field name="action" />
<field name="action_desc" />
</form>
</field>
</record>
<record id="view_attendance_tree" model="ir.ui.view">
<field name="name">hr.attendance.tree</field>
<field name="model">hr.attendance</field>
@ -51,9 +52,9 @@
<filter icon="terp-stock_align_left_24" string="My Attendances" domain="[('employee_id.user_id.id', '=', uid)]" />
<filter icon="terp-go-today" string="Today" domain="[('name::date','=',current_date)]" />
<separator orientation="vertical"/>
<field name="employee_id" select="1" />
<field name="name" select="1" />
<field name="action" select="1" />
<field name="employee_id" />
<field name="name" />
<field name="action" />
<newline/>
<group expand="0" string="Group By...">
<filter name="employee" string="Employee" icon="terp-personal" domain="[]" context="{'group_by':'employee_id'}"/>
@ -74,12 +75,8 @@
<!--<menuitem id="menu_hr_attendance" name="Attendances" parent="hr.menu_hr_root"
groups="group_hr_attendance"/>-->
<menuitem
id="menu_hr_time_tracking"
name="Time Tracking"
parent="hr.menu_hr_root" sequence="3"/>
<menuitem action="open_view_attendance" id="menu_open_view_attendance"
parent="menu_hr_time_tracking" groups="hr.group_hr_manager" sequence="3"/>
<menuitem id="menu_hr_time_tracking" name="Time Tracking" parent="hr.menu_hr_root" sequence="3"/>
<menuitem action="open_view_attendance" id="menu_open_view_attendance" parent="menu_hr_time_tracking" groups="hr.group_hr_manager" sequence="3"/>
<record id="edit_attendance_reason" model="ir.ui.view">
<field name="name">hr.action.reason.form</field>
@ -87,11 +84,12 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Define attendance reason">
<field colspan="4" name="name" select="1"/>
<field name="action_type" select="1"/>
<field colspan="4" name="name" />
<field name="action_type" />
</form>
</field>
</record>
<record id="view_attendance_reason" model="ir.ui.view">
<field name="name">hr.action.reason.tree</field>
<field name="model">hr.action.reason</field>
@ -103,6 +101,7 @@
</tree>
</field>
</record>
<record id="open_view_attendance_reason" model="ir.actions.act_window">
<field name="name">Attendance Reasons</field>
<field name="type">ir.actions.act_window</field>
@ -111,6 +110,7 @@
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_attendance_reason"/>
</record>
<menuitem sequence="9" id="hr.menu_open_view_attendance_reason_config" parent="hr.menu_hr_configuration" name="Leaves"/>
<menuitem action="open_view_attendance_reason" id="menu_open_view_attendance_reason" parent="hr.menu_open_view_attendance_reason_config"/>

View File

@ -13,9 +13,7 @@
groups="group_hr_attendance"/>-->
<!--Time Tracking menu for Project Management-->
<menuitem icon="terp-project" id="base.menu_main_pm" name="Project" sequence="10"/>
<menuitem
id="base.menu_project_management_time_tracking"
name="Time Tracking"
<menuitem id="base.menu_project_management_time_tracking" name="Time Tracking"
parent="base.menu_main_pm" sequence="3"/>
<!--<menuitem action="hr_attendance.si_so" id="menu_project_management_si_so" parent="base.menu_project_management_time_tracking" type="wizard" sequence="9"/>
-->

View File

@ -19,13 +19,13 @@
#
##############################################################################
import time
from report import report_sxw
import pooler
import datetime
class attendance_print(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
super(attendance_print, self).__init__(cr, uid, name, context=context)
self.localcontext.update({
@ -80,14 +80,13 @@ class attendance_print(report_sxw.rml_parse):
total2 += r['delay']
result_dict = {
'total' : total and str(total).split('.')[0],
'total2' : total2 and str(total2).split('.')[0]
'total': total and str(total).split('.')[0],
'total2': total2 and str(total2).split('.')[0]
}
# return (self._sign(total),total2 and self._sign(total2))
return [result_dict]
report_sxw.report_sxw('report.hr.attendance.error', 'hr.employee', 'addons/hr_attendance/report/attendance_errors.rml',parser=attendance_print, header=2)
report_sxw.report_sxw('report.hr.attendance.error', 'hr.employee', 'addons/hr_attendance/report/attendance_errors.rml', parser=attendance_print, header=2)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -30,7 +30,7 @@ from report.interface import report_rml
from report.interface import toxml
one_day = DateTime.RelativeDateTime(days=1)
month2name = [0,'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']
month2name = [0, 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
def hour2str(h):
hours = int(h)
@ -38,7 +38,10 @@ def hour2str(h):
return '%02dh%02d' % (hours, minutes)
class report_custom(report_rml):
def create_xml(self, cr, uid, ids, datas, context):
def create_xml(self, cr, uid, ids, datas, context=None):
if context is None:
context = {}
month = DateTime.DateTime(datas['form']['year'], datas['form']['month'], 1)
user_xml = ['<month>%s</month>' % month2name[month.month], '<year>%s</year>' % month.year]
for employee_id in ids:
@ -67,7 +70,7 @@ class report_custom(report_rml):
if attendences and attendences[0]['action'] == 'sign_out':
attendences.insert(0, {'name': today.strftime('%Y-%m-%d %H:%M:%S'), 'action':'sign_in'})
if attendences and attendences[-1]['action'] == 'sign_in':
attendences.append({'name' : tomor.strftime('%Y-%m-%d %H:%M:%S'), 'action':'sign_out'})
attendences.append({'name': tomor.strftime('%Y-%m-%d %H:%M:%S'), 'action':'sign_out'})
# sum up the attendances' durations
for att in attendences:
dt = DateTime.strptime(att['name'], '%Y-%m-%d %H:%M:%S')
@ -88,7 +91,6 @@ class report_custom(report_rml):
%s
</report>
''' % '\n'.join(user_xml)
return xml
report_custom('report.hr.attendance.bymonth', 'hr.employee', '', 'addons/hr_attendance/report/bymonth.xsl')

View File

@ -22,7 +22,7 @@
from mx import DateTime
from mx.DateTime import now
import netsvc
import pooler
from report.interface import report_rml
@ -35,13 +35,12 @@ def to_hour(h):
return int(h), int(round((h - int(h)) * 60, 0))
class report_custom(report_rml):
def create_xml(self, cr, uid, ids, datas, context):
def create_xml(self, cr, uid, ids, datas, context=None):
start_date = DateTime.strptime(datas['form']['init_date'], '%Y-%m-%d')
end_date = DateTime.strptime(datas['form']['end_date'], '%Y-%m-%d')
first_monday = start_date - DateTime.RelativeDateTime(days=start_date.day_of_week)
last_monday = end_date + DateTime.RelativeDateTime(days=7 - end_date.day_of_week)
if last_monday < first_monday:
first_monday, last_monday = last_monday, first_monday
@ -73,9 +72,9 @@ class report_custom(report_rml):
# Fake sign ins/outs at week ends, to take attendances across week ends into account
# XXX this is wrong for the first sign-in ever and the last sign out to this date
if attendances and attendances[0]['action'] == 'sign_out':
attendances.insert(0, {'name': monday.strftime('%Y-%m-%d %H:%M:%S'), 'action':'sign_in'})
attendances.insert(0, {'name': monday.strftime('%Y-%m-%d %H:%M:%S'), 'action': 'sign_in'})
if attendances and attendances[-1]['action'] == 'sign_in':
attendances.append({'name' : n_monday.strftime('%Y-%m-%d %H:%M:%S'), 'action':'sign_out'})
attendances.append({'name': n_monday.strftime('%Y-%m-%d %H:%M:%S'), 'action': 'sign_out'})
# sum up the attendances' durations
for att in attendances:
dt = DateTime.strptime(att['name'], '%Y-%m-%d %H:%M:%S')

View File

@ -1,8 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="1">
<record id="group_hr_attendance" model="res.groups">
<field name="name">Human Resources / Attendances User</field>
</record>
</data>
<data noupdate="1">
<record id="group_hr_attendance" model="res.groups">
<field name="name">Human Resources / Attendances User</field>
</record>
</data>
</openerp>

View File

@ -18,6 +18,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import time
from osv import osv, fields
@ -26,16 +27,17 @@ class hr_attendance_bymonth(osv.osv_memory):
_name = 'hr.attendance.month'
_description = 'Print Monthly Attendance Report'
_columns = {
'month': fields.selection([(1, 'January'), (2, 'February'), (3, 'March'), (4, 'April'), (5, 'May'), (6, 'June'), (7, 'July'), (8, 'August'), (9, 'September'), (10, 'October'), (11, 'November'), (12, 'December')],
'Month', required=True),
'month': fields.selection([(1, 'January'), (2, 'February'), (3, 'March'), (4, 'April'), (5, 'May'), (6, 'June'), (7, 'July'), (8, 'August'), (9, 'September'), (10, 'October'), (11, 'November'), (12, 'December')], 'Month', required=True),
'year': fields.integer('Year', required=True)
}
_defaults = {
'month': lambda * a: time.gmtime()[1],
'year': lambda * a: time.gmtime()[0],
'month': time.gmtime()[1],
'year': time.gmtime()[0],
}
def print_report(self, cr, uid, ids, context=None):
if context is None:
context = {}
datas = {
'ids': [],
'model': 'hr.employee',
@ -49,4 +51,4 @@ class hr_attendance_bymonth(osv.osv_memory):
hr_attendance_bymonth()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -9,9 +9,9 @@
<field name="arch" type="xml">
<form string="Print Attendance Report Monthly">
<group col="4" colspan="6">
<field name="month"/>
<field name="year"/>
<newline/>
<field name="month"/>
<field name="year"/>
<newline/>
</group>
<separator colspan="4"/>
<group col="2" colspan="4">
@ -42,4 +42,4 @@
</record>
</data>
</openerp>
</openerp>

View File

@ -28,11 +28,11 @@ class hr_attendance_byweek(osv.osv_memory):
_columns = {
'init_date': fields.date('Starting Date', required=True),
'end_date': fields.date('Ending Date', required=True)
}
}
_defaults = {
'init_date': lambda *a: time.strftime('%Y-%m-%d'),
'end_date': lambda *a: time.strftime('%Y-%m-%d'),
}
'init_date': time.strftime('%Y-%m-%d'),
'end_date': time.strftime('%Y-%m-%d'),
}
def print_report(self, cr, uid, ids, context=None):
datas = {
@ -47,4 +47,4 @@ class hr_attendance_byweek(osv.osv_memory):
}
hr_attendance_byweek()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -9,10 +9,10 @@
<field name="arch" type="xml">
<form string="Print Attendance Report Weekly">
<group col="4" colspan="6">
<separator string="Select a starting and a end date" colspan="4"/>
<field name="init_date"/>
<field name="end_date"/>
<newline/>
<separator string="Select a starting and a end date" colspan="4"/>
<field name="init_date"/>
<field name="end_date"/>
<newline/>
</group>
<separator colspan="4"/>
<group col="2" colspan="4">
@ -43,4 +43,4 @@
</record>
</data>
</openerp>
</openerp>

View File

@ -31,15 +31,16 @@ class hr_attendance_error(osv.osv_memory):
'init_date': fields.date('Starting Date', required=True),
'end_date': fields.date('Ending Date', required=True),
'max_delay': fields.integer('Max. Delay (Min)', required=True)
}
}
_defaults = {
'init_date': lambda *a: time.strftime('%Y-%m-%d'),
'end_date': lambda *a: time.strftime('%Y-%m-%d'),
'init_date': time.strftime('%Y-%m-%d'),
'end_date': time.strftime('%Y-%m-%d'),
'max_delay': 120,
}
}
def print_report(self, cr, uid, ids, context=None):
if context is None:
context = {}
emp_ids = []
data_error = self.read(cr, uid, ids)[0]
date_from = data_error['init_date']
@ -67,4 +68,4 @@ class hr_attendance_error(osv.osv_memory):
hr_attendance_error()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -9,12 +9,12 @@
<field name="arch" type="xml">
<form string="Print Attendance Report Error">
<group col="4" colspan="6">
<separator string="Analysis Information" colspan="4"/>
<field name="init_date"/>
<field name="end_date"/>
<field name="max_delay"/>
<label string="Bellow this delay, the error is considered to be voluntary" colspan="2"/>
<newline/>
<separator string="Analysis Information" colspan="4"/>
<field name="init_date"/>
<field name="end_date"/>
<field name="max_delay"/>
<label string="Bellow this delay, the error is considered to be voluntary" colspan="2"/>
<newline/>
</group>
<separator colspan="4"/>
<group col="2" colspan="4">
@ -45,4 +45,4 @@
</record>
</data>
</openerp>
</openerp>

View File

@ -20,7 +20,6 @@
##############################################################################
import time
import netsvc
from osv import osv, fields
from tools.translate import _
@ -31,8 +30,11 @@ class hr_si_so_ask(osv.osv_memory):
'name': fields.char('Employees name', size=32, required=True, readonly=True),
'last_time': fields.datetime('Your last sign out', required=True),
'emp_id': fields.char('Empoyee ID', size=32, required=True, readonly=True),
}
}
def _get_empname(self, cr, uid, context=None):
if context is None:
context = {}
emp_id = self.pool.get('hr.employee').search(cr, uid, [('user_id', '=', uid)], context=context)
if emp_id:
employee = self.pool.get('hr.employee').browse(cr, uid, emp_id, context=context)[0].name
@ -114,7 +116,7 @@ class hr_sign_in_out(osv.osv_memory):
data = self.read(cr, uid, ids, [])[0]
att_obj = self.pool.get('hr.attendance')
emp_id = data['emp_id']
att_id = att_obj.search(cr, uid, [('employee_id', '=', emp_id),('action','!=','action')], limit=1, order='name desc')
att_id = att_obj.search(cr, uid, [('employee_id', '=', emp_id),('action', '!=', 'action')], limit=1, order='name desc')
last_att = att_obj.browse(cr, uid, att_id, context=context)
if last_att:
last_att = last_att[0]
@ -152,11 +154,8 @@ class hr_sign_in_out(osv.osv_memory):
if 'last_time' in data:
if data['last_time'] > time.strftime('%Y-%m-%d %H:%M:%S'):
raise osv.except_osv(_('UserError'), _('The sign-out date must be in the past'))
self.pool.get('hr.attendance').create(cr, uid, {
'name': data['last_time'],
'action': 'sign_out',
'employee_id': emp_id
})
self.pool.get('hr.attendance').create(cr, uid, {'name': data['last_time'], 'action': 'sign_out',
'employee_id': emp_id})
try:
success = self.pool.get('hr.employee').attendance_action_change(cr, uid, [emp_id], 'sign_in')
except:

View File

@ -8,9 +8,9 @@
<field name="arch" type="xml">
<form string="Sign in / Sign out">
<group colspan="4" >
<separator string="You are now ready to sign in or out of the attendance follow up" colspan="4" />
<field name="name" />
<field name="state" />
<separator string="You are now ready to sign in or out of the attendance follow up" colspan="4" />
<field name="name" />
<field name="state" />
</group>
<separator colspan="4"/>
<group colspan="4" col="6">
@ -45,8 +45,7 @@
<field name="target">new</field>
</record>
<menuitem action="action_hr_attendance_sigh_in_out"
id="menu_hr_attendance_sigh_in_out"
<menuitem action="action_hr_attendance_sigh_in_out" id="menu_hr_attendance_sigh_in_out"
parent="menu_hr_time_tracking" sequence="4"/>
<record id="view_hr_attendance_so_ask" model="ir.ui.view">
@ -56,9 +55,9 @@
<field name="arch" type="xml">
<form string="hr.sign.out.ask">
<group colspan="4" >
<separator string="You did not sign out the last time. Please enter the date and time you signed out." colspan="4" />
<field name="name" />
<field name="last_time" string="Your last sign out" />
<separator string="You did not sign out the last time. Please enter the date and time you signed out." colspan="4" />
<field name="name" />
<field name="last_time" string="Your last sign out" />
</group>
<group colspan="4" col="6">
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
@ -75,9 +74,9 @@
<field name="arch" type="xml">
<form string="hr.sign.in.out.ask">
<group colspan="4" >
<separator string="You did not sign in the last time. Please enter the date and time you signed in." colspan="4" />
<field name="name" />
<field name="last_time" string="Your last sign in" />
<separator string="You did not sign in the last time. Please enter the date and time you signed in." colspan="4" />
<field name="name" />
<field name="last_time" string="Your last sign in" />
</group>
<group colspan="4" col="6">
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
@ -87,6 +86,5 @@
</field>
</record>
</data>
</openerp>

View File

@ -29,7 +29,6 @@
* Martial status,
* Security number,
* Place of birth, birth date, ...
You can assign several contracts per employee.
""",
'author': 'Tiny',
@ -40,7 +39,7 @@
'security/hr_contract_security.xml',
'security/ir.model.access.csv',
'hr_contract_view.xml'
],
],
'demo_xml': [],
'test': ['test/test_hr_contract.yml'],
'installable': True,

View File

@ -34,7 +34,7 @@ class hr_employee(osv.osv):
'vehicle': fields.char('Company Vehicle', size=64),
'vehicle_distance': fields.integer('Home-Work Distance', help="In kilometers"),
'contract_ids': fields.one2many('hr.contract', 'employee_id', 'Contracts'),
}
}
hr_employee()
#Contract wage type period name
@ -44,10 +44,10 @@ class hr_contract_wage_type_period(osv.osv):
_columns = {
'name': fields.char('Period Name', size=50, required=True, select=True),
'factor_days': fields.float('Hours in the period', digits=(12,4), required=True, help='This field is used by the timesheet system to compute the price of an hour of work wased on the contract of the employee')
}
}
_defaults = {
'factor_days': lambda *args: 168.0
}
'factor_days': 168.0
}
hr_contract_wage_type_period()
#Contract wage type (hourly, daily, monthly, ...)
@ -55,15 +55,15 @@ class hr_contract_wage_type(osv.osv):
_name = 'hr.contract.wage.type'
_description = 'Wage Type'
_columns = {
'name' : fields.char('Wage Type Name', size=50, required=True, select=True),
'period_id' : fields.many2one('hr.contract.wage.type.period', 'Wage Period', required=True),
'type' : fields.selection([('gross','Gross'), ('net','Net')], 'Type', required=True),
'name': fields.char('Wage Type Name', size=50, required=True, select=True),
'period_id': fields.many2one('hr.contract.wage.type.period', 'Wage Period', required=True),
'type': fields.selection([('gross','Gross'), ('net','Net')], 'Type', required=True),
'factor_type': fields.float('Factor for hour cost', digits=(12,4), required=True, help='This field is used by the timesheet system to compute the price of an hour of work wased on the contract of the employee')
}
}
_defaults = {
'type' : lambda *a : 'gross',
'factor_type': lambda *args: 1.8
}
'type': 'gross',
'factor_type': 1.8
}
hr_contract_wage_type()
@ -93,10 +93,11 @@ class hr_contract(osv.osv):
'advantages_net': fields.float('Net Advantages Value', digits=(16,2)),
'advantages_gross': fields.float('Gross Advantages Value', digits=(16,2)),
'notes': fields.text('Notes'),
}
}
_defaults = {
'date_start' : lambda *a : time.strftime("%Y-%m-%d"),
}
'date_start': time.strftime("%Y-%m-%d"),
}
hr_contract()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -19,6 +19,7 @@
<field name="type">gross</field>
<field name="period_id" ref="hr_contract_wage_type_period_monthly"/>
</record>
<record id="hr_contract_monthly_net" model="hr.contract.wage.type">
<field name="name">Monthly Net Wage</field>
<field name="type">net</field>

View File

@ -37,12 +37,12 @@
<field name="arch" type="xml">
<search string="Search Wage Type">
<group col='15' colspan='4'>
<field name="name"/>
<field name="type"/>
<field name="name"/>
<field name="type"/>
</group>
<newline/>
<group expand="0" string="Group By..." colspan="4" col="20">
<filter string="Period" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'period_id'}"/>
<filter string="Period" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'period_id'}"/>
</group>
</search>
</field>
@ -58,7 +58,6 @@
</record>
<menuitem id="next_id_56" name="Contract" parent="hr.menu_hr_management" sequence="5"/>
<menuitem action="action_hr_contract_wage_type" id="hr_menu_contract_wage_type" parent="next_id_56"/>
<record id="hr_contract_wage_type_period_view_form" model="ir.ui.view">
@ -80,7 +79,7 @@
<field name="arch" type="xml">
<search string="Search Wage Period">
<group col='15' colspan='4'>
<field name="name"/>
<field name="name"/>
</group>
</search>
</field>
@ -94,12 +93,9 @@
<field name="search_view_id" ref="hr_contract_wage_type_period_view_search"/>
</record>
<menuitem
action="action_hr_contract_wage_type_period"
id="hr_menu_contract_wage_type_period"
<menuitem action="action_hr_contract_wage_type_period" id="hr_menu_contract_wage_type_period"
parent="hr_contract.next_id_56"/>
<record id="hr_hr_employee_view_form2" model="ir.ui.view">
<field name="name">hr.hr.employee.view.form2</field>
<field name="model">hr.employee</field>
@ -108,20 +104,20 @@
<notebook position="inside">
<page string="Miscelleanous">
<group colspan="2" col="2">
<separator string="Personal Info" colspan="2"/>
<field name="bank_account"/>
<field name="place_of_birth"/>
<field name="children"/>
<separator string="Personal Info" colspan="2"/>
<field name="bank_account"/>
<field name="place_of_birth"/>
<field name="children"/>
</group>
<group colspan="2" col="2">
<separator string="Job Info" colspan="2"/>
<field name="manager" select="1"/>
<field name="vehicle" select="1"/>
<field name="vehicle_distance" select="1"/>
<separator string="Job Info" colspan="2"/>
<field name="manager" />
<field name="vehicle" />
<field name="vehicle_distance" />
</group>
<group colspan="2" col="2">
<separator string="Others Info" colspan="2"/>
<field name="medic_exam" select="1"/>
<separator string="Others Info" colspan="2"/>
<field name="medic_exam" />
</group>
</page>
</notebook>
@ -135,14 +131,14 @@
<field name="arch" type="xml">
<search string="Search Contract">
<group col='15' colspan='4'>
<field name="name"/>
<field name="employee_id"/>
<field name="date_start"/>
<field name="date_end"/>
<field name="name"/>
<field name="employee_id"/>
<field name="date_start"/>
<field name="date_end"/>
</group>
<newline/>
<group expand="0" string="Group By..." colspan="4" col="20">
<filter string="Wage Type" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'wage_type_id'}"/>
<filter string="Wage Type" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'wage_type_id'}"/>
</group>
</search>
</field>
@ -155,26 +151,26 @@
<field name="arch" type="xml">
<form string="Contract">
<group colspan="3" col="6">
<field name="name" select="1"/>
<field name="employee_id" select="1"/>
<field name="job_id"/>
<field name="wage"/>
<field name="wage_type_id" widget="selection"/>
<field name="type_id" widget="selection"/>
<field name="name" />
<field name="employee_id" />
<field name="job_id"/>
<field name="wage"/>
<field name="wage_type_id" widget="selection"/>
<field name="type_id" widget="selection"/>
</group>
<notebook>
<page string="Main Data">
<group col="2" colspan="2">
<separator colspan="2" string="Duration"/>
<field name="date_start" select="1"/>
<field name="date_end" select="1"/>
<field name="working_hours"/>
<separator colspan="2" string="Duration"/>
<field name="date_start" />
<field name="date_end" />
<field name="working_hours"/>
</group>
<group col="2" colspan="2">
<separator colspan="2" string="Advantages"/>
<field name="advantages_net"/>
<field name="advantages_gross"/>
<field name="advantages" nolabel="1" colspan="2"/>
<separator colspan="2" string="Advantages"/>
<field name="advantages_net"/>
<field name="advantages_gross"/>
<field name="advantages" nolabel="1" colspan="2"/>
</group>
<separator colspan="4" string="Notes"/>
<field colspan="4" name="notes" nolabel="1"/>
@ -241,7 +237,7 @@
<field name="arch" type="xml">
<search string="Search Contract Type">
<group col='15' colspan='4'>
<field name="name"/>
<field name="name"/>
</group>
</search>
</field>
@ -254,13 +250,12 @@
<field name="view_mode">tree,form</field>
<field name="search_view_id" ref="hr_contract_type_view_search"/>
</record>
<menuitem action="action_hr_contract_type" id="hr_menu_contract_type" parent="next_id_56"/>
<menuitem action="action_hr_contract_type" id="hr_menu_contract_type" parent="next_id_56"/>
<menuitem action="action_hr_contract" id="hr_menu_contract" parent="hr.menu_hr_main" name="Contracts" sequence="4"/>
<!-- Contracts Button on Employee Form -->
<act_window domain="[('employee_id', '=', active_id)]" id="act_hr_employee_2_hr_contract" name="Contracts" res_model="hr.contract" src_model="hr.employee"/>
</data>
</openerp>

View File

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="1">
<data noupdate="1">
<record id="group_hr_contract" model="res.groups">
<field name="name">Human Resources / Contracts</field>
</record>
<record id="group_hr_contract" model="res.groups">
<field name="name">Human Resources / Contracts</field>
</record>
</data>
</data>
</openerp>

View File

@ -21,27 +21,29 @@
{
"name" : "Human Resources Evaluation",
"version" : "0.1",
"author" : "Tiny",
"category" : "Generic Modules/Human Resources",
"website" : "http://www.openerp.com",
"depends" : ["hr",'hr_recruitment','survey'],
"version": "0.1",
"author": "Tiny",
"category": "Generic Modules/Human Resources",
"website": "http://www.openerp.com",
"depends": ["hr",'hr_recruitment','survey'],
"description": """
Ability to create employees evaluation.
An evaluation can be created by employee for subordinates,
juniors as well as his manager.The evaluation is done under a plan
in which various surveys can be created and it can be defined which
level of employee hierarchy fills what and final review and evaluation
is done by the manager.Every evaluation filled by the employees can be viewed
in the form of.Implements a dashboard for My Current Evaluations """,
"init_xml" : [],
"demo_xml" : ["hr_evaluation_demo.xml",
Ability to create employees evaluation.
An evaluation can be created by employee for subordinates,
juniors as well as his manager.The evaluation is done under a plan
in which various surveys can be created and it can be defined which
level of employee hierarchy fills what and final review and evaluation
is done by the manager.Every evaluation filled by the employees can be viewed
in the form of.Implements a dashboard for My Current Evaluations
""",
"init_xml": [],
"demo_xml": ["hr_evaluation_demo.xml",
],
"update_xml" : [
"security/ir.model.access.csv",
"wizard/hr_evaluation_mail_view.xml",
"hr_evaluation_view.xml",
"report/hr_evaluation_report_view.xml"],
"update_xml": [
"security/ir.model.access.csv",
"wizard/hr_evaluation_mail_view.xml",
"hr_evaluation_view.xml",
"report/hr_evaluation_report_view.xml"
],
"test": ["test/test_hr_evaluation.yml"],
"active": False,
"installable": True

View File

@ -36,11 +36,11 @@ class hr_evaluation_plan(osv.osv):
'month_first': fields.integer('First Evaluation After'),
'month_next': fields.integer('Next Evaluation After'),
'active': fields.boolean('Active')
}
}
_defaults = {
'active' : True,
'active': True,
'company_id': lambda s,cr,uid,c: s.pool.get('res.company')._company_default_get(cr, uid, 'account.account', context=c),
}
}
hr_evaluation_plan()
class hr_evaluation_plan_phase(osv.osv):
@ -75,8 +75,8 @@ class hr_evaluation_plan_phase(osv.osv):
'email_subject':fields.text('char')
}
_defaults = {
'sequence' : lambda *a: 1,
'email_subject':_('''Regarding '''),
'sequence' : 1,
'email_subject': _('''Regarding '''),
'mail_body' : lambda *a:_('''
Date : %(date)s
@ -93,8 +93,6 @@ Thanks,
'''),
}
hr_evaluation_plan_phase()
class hr_employee(osv.osv):
@ -106,6 +104,8 @@ class hr_employee(osv.osv):
}
def run_employee_evaluation(self, cr, uid, automatic=False, use_new_cursor=False, context=None):
if context is None:
context = {}
for id in self.browse(cr, uid, self.search(cr, uid, [], context=context), context=context):
if id.evaluation_plan_id and id.evaluation_date:
if (dt.ISO.ParseAny(id.evaluation_date) + dt.RelativeDateTime(months = int(id.evaluation_plan_id.month_next))).strftime('%Y-%m-%d') <= time.strftime("%Y-%m-%d"):
@ -113,7 +113,7 @@ class hr_employee(osv.osv):
self.pool.get("hr_evaluation.evaluation").create(cr, uid, {'employee_id' : id.id, 'plan_id': id.evaluation_plan_id}, context)
return True
def onchange_evaluation_plan_id(self, cr, uid, ids, evaluation_plan_id, evaluation_date, context={}):
def onchange_evaluation_plan_id(self, cr, uid, ids, evaluation_plan_id, evaluation_date, context=None):
evaluation_date = evaluation_date or False
evaluation_plan_obj=self.pool.get('hr_evaluation.plan')
if evaluation_plan_id:
@ -127,10 +127,10 @@ class hr_employee(osv.osv):
evaluation_date=(dt.ISO.ParseAny(evaluation_date)+ dt.RelativeDateTime(months=+evaluation_plan.month_next)).strftime('%Y-%m-%d')
flag = True
if ids and flag:
self.pool.get("hr_evaluation.evaluation").create(cr, uid, {'employee_id' : ids[0], 'plan_id': evaluation_plan_id}, context=context)
return {'value': {'evaluation_date':evaluation_date}}
self.pool.get("hr_evaluation.evaluation").create(cr, uid, {'employee_id': ids[0], 'plan_id': evaluation_plan_id}, context=context)
return {'value': {'evaluation_date': evaluation_date}}
def create(self, cr, uid, vals, context={}):
def create(self, cr, uid, vals, context=None):
id = super(hr_employee, self).create(cr, uid, vals, context=context)
if vals.get('evaluation_plan_id', False):
self.pool.get("hr_evaluation.evaluation").create(cr, uid, {'employee_id' : id, 'plan_id': vals['evaluation_plan_id']}, context=context)
@ -183,7 +183,7 @@ class hr_evaluation(osv.osv):
res.append((record['id'], name))
return res
def onchange_employee_id(self, cr, uid, ids, employee_id, context={}):
def onchange_employee_id(self, cr, uid, ids, employee_id, context=None):
employee_obj=self.pool.get('hr.employee')
evaluation_plan_id=''
if employee_id:
@ -193,7 +193,7 @@ class hr_evaluation(osv.osv):
employee_ids=employee_obj.search(cr, uid, [('parent_id','=',employee.id)], context=context)
return {'value': {'plan_id':evaluation_plan_id}}
def button_plan_in_progress(self, cr, uid, ids, context={}):
def button_plan_in_progress(self, cr, uid, ids, context=None):
apprai_id = []
for evaluation in self.browse(cr, uid, ids, context):
wait = False
@ -224,13 +224,8 @@ class hr_evaluation(osv.osv):
hr_eval_inter_obj.survey_req_waiting_answer(cr, uid, [int_id], context=context)
if (not wait) and phase.mail_feature:
body = phase.mail_body % {
'employee_name': child.name,
'user_signature': user.signature,
'eval_name': phase.survey_id.title,
'date': time.strftime('%Y-%m-%d'),
'time': time
}
body = phase.mail_body % {'employee_name': child.name, 'user_signature': user.signature,
'eval_name': phase.survey_id.title, 'date': time.strftime('%Y-%m-%d'), 'time': time }
sub = phase.email_subject
dest = [child.work_email]
if dest:
@ -239,7 +234,7 @@ class hr_evaluation(osv.osv):
self.write(cr, uid, ids, {'state':'wait'}, context=context)
return True
def button_final_validation(self, cr, uid, ids, context={}):
def button_final_validation(self, cr, uid, ids, context=None):
self.write(cr, uid, ids, {'state':'progress'})
request_obj = self.pool.get('hr.evaluation.interview')
for id in self.browse(cr, uid ,ids,context=context):
@ -247,21 +242,21 @@ class hr_evaluation(osv.osv):
raise osv.except_osv(_('Warning !'),_("You cannot change state, because some appraisal in waiting answer or draft state"))
return True
def button_done(self,cr, uid, ids, context={}):
def button_done(self,cr, uid, ids, context=None):
self.write(cr,uid,ids,{'state':'done', 'date_close': time.strftime('%Y-%m-%d')}, context=context)
return True
def button_cancel(self, cr, uid, ids, context={}):
def button_cancel(self, cr, uid, ids, context=None):
self.write(cr, uid, ids,{'state':'cancel'}, context=context)
return True
hr_evaluation()
class survey_request(osv.osv):
_inherit="survey.request"
_inherit = "survey.request"
_columns = {
'is_evaluation':fields.boolean('Is Evaluation?'),
}
'is_evaluation': fields.boolean('Is Evaluation?'),
}
_defaults = {
'state': 'waiting_answer',
}
@ -269,19 +264,19 @@ class survey_request(osv.osv):
survey_request()
class hr_evaluation_interview(osv.osv):
_name='hr.evaluation.interview'
_inherits={'survey.request':'request_id'}
_description='Evaluation Interview'
_name = 'hr.evaluation.interview'
_inherits = {'survey.request': 'request_id'}
_description = 'Evaluation Interview'
_columns = {
'request_id': fields.many2one('survey.request','Request_id', ondelete='cascade'),
'user_to_review_id': fields.many2one('hr.employee', 'Employee to Interview'),
'evaluation_id' : fields.many2one('hr_evaluation.evaluation', 'Evaluation Type'),
}
'evaluation_id': fields.many2one('hr_evaluation.evaluation', 'Evaluation Type'),
}
_defaults = {
'is_evaluation': True,
}
}
def survey_req_waiting_answer(self, cr, uid, ids, context={}):
def survey_req_waiting_answer(self, cr, uid, ids, context=None):
self.write(cr, uid, ids, { 'state' : 'waiting_answer'})
return True
@ -306,16 +301,16 @@ class hr_evaluation_interview(osv.osv):
tot_done_req += 1
if not flag and wating_id:
self.survey_req_waiting_answer(cr, uid, [wating_id], context)
hr_eval_obj.write(cr, uid, [id.evaluation_id.id], {'progress' :tot_done_req * 100 / len(records)}, context=context)
self.write(cr, uid, ids, { 'state' : 'done'})
hr_eval_obj.write(cr, uid, [id.evaluation_id.id], {'progress': tot_done_req * 100 / len(records)}, context=context)
self.write(cr, uid, ids, { 'state': 'done'})
return True
def survey_req_draft(self, cr, uid, ids, context={}):
self.write(cr, uid, ids, { 'state' : 'draft'}, context=context)
def survey_req_draft(self, cr, uid, ids, context=None):
self.write(cr, uid, ids, { 'state': 'draft'}, context=context)
return True
def survey_req_cancel(self, cr, uid, ids, context={}):
self.write(cr, uid, ids, { 'state' : 'cancel'}, context=context)
def survey_req_cancel(self, cr, uid, ids, context=None):
self.write(cr, uid, ids, { 'state': 'cancel'}, context=context)
return True
def action_print_survey(self, cr, uid, ids, context=None):
@ -331,12 +326,12 @@ class hr_evaluation_interview(osv.osv):
"""
if not context:
context = {}
record = self.browse(cr, uid, ids, context)
record = record and record[0]
context.update({'survey_id': record.survey_id.id, 'response_id' : [record.response.id], 'response_no':0,})
context.update({'survey_id': record.survey_id.id, 'response_id': [record.response.id], 'response_no':0,})
value = self.pool.get("survey").action_print_survey(cr, uid, ids, context)
return value
hr_evaluation_interview()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:1

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="survey_2" model="survey">
<field name="title">Employee Evaluation</field>
<field name="max_response_limit">20</field>
@ -10,6 +11,7 @@
<field name="response_user">5</field>
</record>
</data>
<data>
<record id="survey_3" model="survey">
<field name="title">Employee Opinion</field>
@ -20,6 +22,7 @@
<field name="response_user">5</field>
</record>
</data>
<data>
<record id="survey_page_1" model="survey.page">
<field name="title">Employee Evaluation Form</field>
@ -27,6 +30,7 @@
<field eval="1" name="sequence"/>
</record>
</data>
<data>
<record id="survey_page_2" model="survey.page">
<field name="title">Process</field>
@ -42,6 +46,7 @@
<field eval="2" name="sequence"/>
</record>
</data>
<data>
<record id="survey_page_6" model="survey.page">
<field name="title">Employee Performance In Key Areas</field>
@ -81,8 +86,6 @@
</record>
</data>
<data>
<record id="survey_question_0" model="survey.question">
<field name="in_visible_answer_type">1</field>
@ -132,6 +135,7 @@
<field eval="0" name="allow_comment"/>
</record>
</data>
<data>
<record id="survey_question_3" model="survey.question">
<field name="in_visible_answer_type">1</field>
@ -156,6 +160,7 @@
<field eval="0" name="allow_comment"/>
</record>
</data>
<data>
<record id="survey_question_4" model="survey.question">
<field name="in_visible_answer_type">1</field>
@ -203,6 +208,7 @@
<field eval="0" name="allow_comment"/>
</record>
</data>
<data>
<!--record id="survey_question_7" model="survey.question">
<field name="in_visible_answer_type">1</field>
@ -227,6 +233,7 @@
<field eval="0" name="allow_comment"/>
</record-->
</data>
<data>
<record id="survey_question_8" model="survey.question">
<field name="in_visible_answer_type">1</field>
@ -304,8 +311,6 @@
</record>
</data>
<data>
<record id="survey_question_14" model="survey.question">
<field name="in_visible_answer_type">1</field>
@ -331,7 +336,6 @@
</record>
</data>
<data>
<record id="survey_question_17" model="survey.question">
<field name="in_visible_answer_type">1</field>
@ -356,6 +360,7 @@
<field eval="0" name="allow_comment"/>
</record>
</data>
<data>
<record id="survey_question_18" model="survey.question">
<field name="in_visible_answer_type">1</field>
@ -381,8 +386,6 @@
</record>
</data>
<data>
<record id="survey_question_23" model="survey.question">
<field name="in_visible_answer_type">1</field>
@ -436,6 +439,7 @@
<field eval="0" name="allow_comment"/>
</record>
</data>
<data>
<record id="survey_question_40" model="survey.question">
<field name="in_visible_answer_type">1</field>
@ -460,6 +464,7 @@
<field eval="0" name="allow_comment"/>
</record>
</data>
<data>
<record id="survey_question_41" model="survey.question">
<field name="in_visible_answer_type">1</field>
@ -502,7 +507,6 @@
<field name="type">descriptive_text</field>
<field name="comment_valid_err_msg">The comment you entered is in an invalid format.</field>
<field name="descriptive_text">* It is the joint responsibility of the employee and the supervisor (appraiser) to establish a feasible work plan for the coming year, including major employee responsibilities and corresponding benchmarks against which results will be evaluated.
* Critical or key elements of performance and professional development needs (if any), should also be noted at this time</field>
<field eval="0" name="make_comment_field"/>
<field eval="1" name="in_visible_menu_choice"/>
@ -583,7 +587,6 @@ Once the form had been filled, the employee send it to his supervisor.
</record>
</data>
<!--data>
<record id="survey_question_42" model="survey.question">
<field name="in_visible_answer_type">1</field>
@ -727,6 +730,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="0" name="allow_comment"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_4" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -735,6 +739,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_4"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_5" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -743,6 +748,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_4"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_6" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -751,6 +757,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_4"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_7" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -759,6 +766,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_4"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_8" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -767,6 +775,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_4"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_9" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -775,6 +784,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_8"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_10" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -783,6 +793,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_8"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_11" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -791,6 +802,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_8"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_12" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -799,6 +811,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_8"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_13" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -807,6 +820,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_8"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_14" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -815,6 +829,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_3"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_15" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -823,6 +838,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_3"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_16" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -831,6 +847,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_3"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_17" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -839,6 +856,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_3"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_18" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -847,6 +865,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_3"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_19" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -855,6 +874,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_6"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_20" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -863,6 +883,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_6"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_21" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -871,6 +892,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_6"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_22" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -879,6 +901,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_6"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_23" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -887,6 +910,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_6"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_24" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -895,6 +919,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_10"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_25" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -903,6 +928,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_10"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_26" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -911,6 +937,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_10"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_27" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -919,6 +946,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_10"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_28" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -927,6 +955,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_10"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_29" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -935,6 +964,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_14"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_30" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -943,6 +973,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_14"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_31" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -951,6 +982,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_14"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_32" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -959,6 +991,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_14"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_33" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -967,6 +1000,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_14"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_34" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -975,6 +1009,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_18"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_35" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -983,6 +1018,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_18"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_36" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -991,6 +1027,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_18"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_37" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -999,6 +1036,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_18"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_38" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -1007,6 +1045,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_18"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_39" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -1015,6 +1054,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_40"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_40" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -1023,6 +1063,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_40"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_41" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -1031,6 +1072,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_40"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_42" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -1039,6 +1081,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_40"/>
</record>
</data>
<data>
<record id="survey_question_column_heading_43" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -1056,6 +1099,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="1" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_1" model="survey.answer">
<field name="answer">Name</field>
@ -1064,6 +1108,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="1" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_2" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1072,6 +1117,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="1" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_3" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1080,6 +1126,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="1" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_4" model="survey.answer">
<field name="in_visible_answer_type">0</field>
@ -1089,6 +1136,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="1" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_5" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1097,6 +1145,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="1" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_6" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1105,6 +1154,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="1" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_7" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1113,6 +1163,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="1" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_8" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1121,6 +1172,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="2" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_9" model="survey.answer">
<field name="in_visible_answer_type">0</field>
@ -1130,6 +1182,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="2" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_10" model="survey.answer">
<field name="answer">Position Title</field>
@ -1138,6 +1191,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="2" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_11" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1146,6 +1200,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="2" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_12" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1154,6 +1209,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="2" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_13" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1162,6 +1218,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="2" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_14" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1170,6 +1227,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="2" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_15" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1178,6 +1236,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="2" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_16" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1187,6 +1246,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="3" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_17" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1195,6 +1255,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="3" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_18" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1203,6 +1264,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="3" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_19" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1211,6 +1273,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="3" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_20" model="survey.answer">
<field name="answer">Appraisal for Period</field>
@ -1219,6 +1282,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="3" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_21" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1227,6 +1291,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="3" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_22" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1235,6 +1300,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="4" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_23" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1243,6 +1309,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="4" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_24" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1251,6 +1318,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="4" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_25" model="survey.answer">
<field name="answer">Date of Review</field>
@ -1259,6 +1327,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="4" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_26" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1267,6 +1336,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="5" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_27" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1276,8 +1346,6 @@ Once the form had been filled, the employee send it to his supervisor.
</record>
</data>
<data>
<record id="survey_answer_31" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1287,7 +1355,6 @@ Once the form had been filled, the employee send it to his supervisor.
</record>
</data>
<data>
<record id="survey_answer_43" model="survey.answer">
<field name="answer">Appraiser</field>
@ -1296,6 +1363,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="5" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_44" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1304,6 +1372,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="5" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_45" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1312,6 +1381,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="5" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_46" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1320,6 +1390,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="5" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_47" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1328,6 +1399,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="5" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_48" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1336,6 +1408,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="5" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_49" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1344,6 +1417,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="5" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_50" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1352,6 +1426,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="5" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_51" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1360,6 +1435,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="5" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_52" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1377,6 +1453,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="5" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_68" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1385,6 +1462,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="5" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_69" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1393,6 +1471,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="5" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_70" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1401,6 +1480,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="5" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_71" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1409,6 +1489,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="5" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_72" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1417,6 +1498,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="5" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_73" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1425,6 +1507,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="5" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_74" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1433,6 +1516,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="5" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_75" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1441,6 +1525,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="5" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_76" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1449,6 +1534,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="5" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_77" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1457,6 +1543,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="5" name="sequence"/>
</record>
</data>
<data>
<record id="survey_answer_78" model="survey.answer">
<field name="in_visible_answer_type">1</field>
@ -1483,6 +1570,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_9"/>
</record>
</data>
<data>
<record id="survey_tbl_column_heading_results0" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -1491,6 +1579,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="question_id" ref="survey_question_9"/>
</record>
</data>
<data>
<record id="survey_tbl_column_heading_comments0" model="survey.question.column.heading">
<field name="in_visible_rating_weight">1</field>
@ -1500,7 +1589,6 @@ Once the form had been filled, the employee send it to his supervisor.
</record>
</data>
<!-- <data noupdate="1">-->
<!-- <record id="survey_request_1" model="survey.request">-->
<!-- <field name="state">waiting_answer</field>-->
@ -1510,6 +1598,7 @@ Once the form had been filled, the employee send it to his supervisor.
<!-- <field name="date_deadline">2010-02-21</field>-->
<!-- </record>-->
<!-- </data>-->
<data noupdate="1">
<record id="hr_evaluation_plan_managersevaluationplan0" model="hr_evaluation.plan">
<field eval="1" name="active"/>
@ -1519,6 +1608,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field name="company_id" ref="base.main_company"/>
</record>
</data>
<data noupdate="1">
<record id="hr_evaluation_plan_phase_sendtosubordinates0" model="hr_evaluation.plan.phase">
<field name="plan_id" ref="hr_evaluation_plan_managersevaluationplan0"/>
@ -1534,6 +1624,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="0" name="wait"/>
</record>
</data>
<data noupdate="1">
<record id="hr_evaluation_plan_phase_sendtomanagers0" model="hr_evaluation.plan.phase">
<field name="plan_id" ref="hr_evaluation_plan_managersevaluationplan0"/>
@ -1549,6 +1640,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="0" name="wait"/>
</record>
</data>
<data noupdate="1">
<record id="hr_evaluation_plan_phase_sendtoemployee0" model="hr_evaluation.plan.phase">
<field name="plan_id" ref="hr_evaluation_plan_managersevaluationplan0"/>
@ -1564,6 +1656,7 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="0" name="wait"/>
</record>
</data>
<data noupdate="1">
<record id="hr_evaluation_plan_phase_finalinterviewwithmanager0" model="hr_evaluation.plan.phase">
<field name="plan_id" ref="hr_evaluation_plan_managersevaluationplan0"/>
@ -1603,8 +1696,7 @@ Once the form had been filled, the employee send it to his supervisor.
<!-- </data>-->
<data>
<record forcecreate="True" id="ir_cron_scheduler_evaluation"
model="ir.cron">
<record forcecreate="True" id="ir_cron_scheduler_evaluation" model="ir.cron">
<field name="name">Run Employee Evaluation</field>
<field eval="True" name="active" />
<field name="user_id" ref="base.user_root" />

View File

@ -61,13 +61,10 @@
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem name="Evaluations" parent="hr.menu_hr_root" id="menu_eval_hr" sequence="6"/>
<menuitem
name="Periodic Evaluations" parent="hr.menu_hr_configuration" id="menu_eval_hr_config" sequence="4"/>
<menuitem
parent="menu_eval_hr_config"
id="menu_open_view_hr_evaluation_plan_tree"
<menuitem name="Evaluations" parent="hr.menu_hr_root" id="menu_eval_hr" sequence="6"/>
<menuitem name="Periodic Evaluations" parent="hr.menu_hr_configuration" id="menu_eval_hr_config" sequence="4"/>
<menuitem parent="menu_eval_hr_config" id="menu_open_view_hr_evaluation_plan_tree"
action="open_view_hr_evaluation_plan_tree"/>
<record model="ir.ui.view" id="view_hr_evaluation_plan_phase_form">
@ -185,30 +182,19 @@
<newline/>
<group col="6" colspan="4">
<field name="state"/>
<button name="button_plan_in_progress"
string="Start Evaluation"
states="draft"
type="object"
<button name="button_plan_in_progress" string="Start Evaluation" states="draft" type="object"
icon="gtk-execute"/>
<button name="button_final_validation"
string="Final Validation"
states="wait"
type="object"
<button name="button_final_validation" string="Final Validation" states="wait" type="object"
icon="gtk-execute"/>
<button name="button_done"
string="Done"
states="progress"
type="object"
<button name="button_done" string="Done" states="progress" type="object"
icon="gtk-jump-to"/>
<button name="button_cancel"
string="Cancel"
states="draft,wait,progress"
type="object"
<button name="button_cancel" string="Cancel" states="draft,wait,progress" type="object"
icon="gtk-cancel"/>
</group>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_hr_evaluation_tree">
<field name="name">hr_evaluation.evaluation.tree</field>
<field name="model">hr_evaluation.evaluation</field>
@ -225,6 +211,7 @@
</tree>
</field>
</record>
<record model="ir.ui.view" id="view_hr_evaluation_graph">
<field name="name">hr_evaluation.evaluation.graph</field>
<field name="model">hr_evaluation.evaluation</field>
@ -236,6 +223,7 @@
</graph>
</field>
</record>
<record id="hr_evaluation.evaluation_search" model="ir.ui.view">
<field name="name">hr_evaluation.evaluation_search</field>
<field name="model">hr_evaluation.evaluation</field>
@ -243,22 +231,17 @@
<field name="arch" type="xml">
<search string="Search Evaluation">
<group col='10' colspan='4'>
<filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]"/>
<filter icon="terp-check" string="In progress" domain="[('state','=','wait')]"/>
<filter icon="terp-dialog-close" string="Final Step" domain="[('state','=','progress')]"/>
<separator orientation="vertical"/>
<filter icon="terp-go-week" string="7 Days"
help="Evaluations to close within the next 7 days"
domain="[('date','&gt;=',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
/>
<filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]"/>
<filter icon="terp-check" string="In progress" domain="[('state','=','wait')]"/>
<filter icon="terp-dialog-close" string="Final Step" domain="[('state','=','progress')]"/>
<separator orientation="vertical"/>
<filter icon="terp-go-week" string="7 Days" help="Evaluations to close within the next 7 days"
domain="[('date', '&gt;=', (datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]" />
<filter icon="terp-gnome-cpu-frequency-applet+" string="Overpassed"
help="Evaluations that overpassed the deadline"
domain="[('date','&gt;=',(datetime.date.today()))]"
/>
help="Evaluations that overpassed the deadline" domain="[('date','&gt;=',(datetime.date.today()))]" />
<separator orientation="vertical"/>
<field name="employee_id" select="1"/>
<field name="plan_id" widget="selection" select="1"/>
<field name="employee_id" />
<field name="plan_id" widget="selection" />
</group>
<newline/>
<group expand='0' string='Group by...'>
@ -278,9 +261,8 @@
<field name="view_mode">tree,form,graph</field>
<field name="search_view_id" ref="hr_evaluation.evaluation_search"/>
</record>
<menuitem
name="Evaluation" parent="menu_eval_hr"
id="menu_open_view_hr_evaluation_tree"
<menuitem name="Evaluation" parent="menu_eval_hr" id="menu_open_view_hr_evaluation_tree"
action="open_view_hr_evaluation_tree"/>
<record model="ir.ui.view" id="view_hr_evaluation_interview_form">
@ -293,10 +275,8 @@
<field name="survey_id"/>
<field name="evaluation_id"/>
<group col="2" colspan="2">
<button name="%(survey.action_view_survey_question_message)d" string="Interview Question" type="action" states="waiting_answer,done,cancel"
icon="gtk-execute" context="{'survey_id': survey_id, 'response_id': [response], 'response_no':0, 'active' : response,'request' : True, 'object' : 'hr.evaluation.interview', 'cur_id' : active_id}" attrs="{'readonly':[('survey_id','=',False)]}"/>
<button name="%(survey.survey_browse_response)d" string="Print Interview" type="action" states="done"
icon="gtk-print" context="{'survey_id': survey_id, 'response_id' : [response], 'response_no':0,}" attrs="{'readonly':[('response','=',False)]}" />
<button name="%(survey.action_view_survey_question_message)d" string="Interview Question" type="action" states="waiting_answer,done,cancel" icon="gtk-execute" context="{'survey_id': survey_id, 'response_id': [response], 'response_no':0, 'active' : response,'request' : True, 'object' : 'hr.evaluation.interview', 'cur_id' : active_id}" attrs="{'readonly':[('survey_id','=',False)]}"/>
<button name="%(survey.survey_browse_response)d" string="Print Interview" type="action" states="done" icon="gtk-print" context="{'survey_id': survey_id, 'response_id' : [response], 'response_no':0,}" attrs="{'readonly':[('response','=',False)]}" />
</group>
<field name="date_deadline"/>
<field name="response" readonly="1"/>
@ -327,10 +307,8 @@
<field name="user_id" string="Interviewer"/>
<field name="user_to_review_id"/>
<field name="response" readonly="1" invisible="True"/>
<button name="%(survey.action_view_survey_question_message)d" string="Interview Question" type="action" states="waiting_answer,done,cancel"
icon="gtk-execute" context="{'survey_id': survey_id, 'response_id': [response], 'response_no':0, 'active' : response, 'request' : True, 'object' : 'hr.evaluation.interview', 'cur_id' : active_id}" attrs="{'readonly':[('survey_id','=',False)]}"/>
<button name="%(survey.survey_browse_response)d" string="Print Interview" type="action" states="done"
icon="gtk-print" context="{'survey_id': survey_id, 'response_id' : [response], 'response_no':0}" attrs="{'readonly':[('response','=',False)]}" />
<button name="%(survey.action_view_survey_question_message)d" string="Interview Question" type="action" states="waiting_answer,done,cancel" icon="gtk-execute" context="{'survey_id': survey_id, 'response_id': [response], 'response_no':0, 'active' : response, 'request' : True, 'object' : 'hr.evaluation.interview', 'cur_id' : active_id}" attrs="{'readonly':[('survey_id','=',False)]}"/>
<button name="%(survey.survey_browse_response)d" string="Print Interview" type="action" states="done" icon="gtk-print" context="{'survey_id': survey_id, 'response_id' : [response], 'response_no':0}" attrs="{'readonly':[('response','=',False)]}" />
<field name="state"/>
</tree>
</field>
@ -369,17 +347,13 @@
<field name="search_view_id" ref="view_hr_evaluation_interview_search"/>
</record>
<menuitem
name="Interview Requests" parent="menu_eval_hr"
id="menu_open_hr_evaluation_interview_requests"
<menuitem name="Interview Requests" parent="menu_eval_hr" id="menu_open_hr_evaluation_interview_requests"
action="action_hr_evaluation_interview_tree"/>
<menuitem name="Evaluation Reminders" parent="menu_eval_hr"
id="menu_eval_send_mail"
action="action_hr_evaluation_send_mail"
sequence="45"/>
<menuitem name="Evaluation Reminders" parent="menu_eval_hr" id="menu_eval_send_mail"
action="action_hr_evaluation_send_mail" sequence="45"/>
<!-- Evaluation Interviews Button on Employee Form -->
<act_window domain="[('user_to_review_id', '=', active_id)]" id="act_hr_employee_2_hr__evaluation_interview" name="Evaluation Interviews" res_model="hr.evaluation.interview" src_model="hr.employee"/>
</data>
</openerp>

View File

@ -18,6 +18,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import hr_evaluation_report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -18,6 +18,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import tools
from osv import fields,osv
@ -75,9 +76,9 @@ class hr_evaluation_report(osv.osv):
s.state
from
hr_evaluation_interview l
left join
LEFT JOIN
hr_evaluation_evaluation s on (s.id=l.evaluation_id)
group by
GROUP BY
s.create_date,
date_trunc('day',s.create_date),
to_char(s.create_date, 'YYYY-MM-DD'),
@ -92,5 +93,8 @@ class hr_evaluation_report(osv.osv):
s.plan_id
)
""")
hr_evaluation_report()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<data>
<record id="view_evaluation_report_tree" model="ir.ui.view">
<field name="name">hr.evaluation.report.tree</field>
<field name="model">hr.evaluation.report</field>
@ -43,33 +44,18 @@
<search string="Evaluations Analysis">
<group>
<filter icon="terp-go-year" string="365 Days"
domain="[('create_date','&lt;=', time.strftime('%%Y-%%m-%%d')),('create_date','&gt;',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]"
help="Tasks performed in last 365 days"/>
<filter icon="terp-go-month" string="30 Days"
name="month"
domain="[('create_date','&lt;=', time.strftime('%%Y-%%m-%%d')), ('create_date','&gt;',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]"
help="Tasks performed in last 30 days"/>
<filter icon="terp-go-week"
string=" 7 Days "
separator="1"
domain="[('create_date','&lt;=', time.strftime('%%Y-%%m-%%d')), ('create_date','&gt;',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
help="Tasks during last 7 days"/>
domain="[('create_date','&lt;=', time.strftime('%%Y-%%m-%%d')), ('create_date', '&gt;',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]" help="Tasks performed in last 365 days"/>
<filter icon="terp-go-month" string="30 Days" name="month" domain="[('create_date','&lt;=', time.strftime('%%Y-%%m-%%d')), ('create_date','&gt;',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]" help="Tasks performed in last 30 days"/>
<filter icon="terp-go-week" string=" 7 Days " separator="1"
domain="[('create_date','&lt;=', time.strftime('%%Y-%%m-%%d')), ('create_date','&gt;',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]" help="Tasks during last 7 days"/>
<separator orientation="vertical"/>
<filter string="Draft"
icon="terp-document-new"
domain="[('state','=','draft')]"
<filter string="Draft" icon="terp-document-new" domain="[('state','=','draft')]"
help = "Draft Evaluations"/>
<filter string="Plan In Progress"
icon="terp-camera_test"
domain="[('state', '=' ,'wait')]"
<filter string="Plan In Progress" icon="terp-camera_test" domain="[('state', '=' ,'wait')]"
help = "In progress Evaluations"/>
<filter string="Final Validation"
icon="terp-check"
domain="[('state','=','progress')]"
<filter string="Final Validation" icon="terp-check" domain="[('state','=','progress')]"
help = "Final Validation Evaluations"/>
<filter icon="terp-dialog-close"
string="Done"
domain="[('state','=','done')]"/>
<filter icon="terp-dialog-close" string="Done" domain="[('state','=','done')]"/>
<separator orientation="vertical"/>
<field name="employee_id" widget="selection"/>
<field name="plan_id" widget="selection"/>
@ -86,13 +72,13 @@
<filter string="Month" icon="terp-go-month" context="{'group_by':'create_date'}"/>
<filter string="Year" icon="terp-go-month" context="{'group_by':'year'}"/>
</group>
<newline/>
<newline/>
<group expand="0" string="Extended options..." groups="base.group_extended">
<field name="rating"/>
<separator orientation="vertical"/>
<field name="deadline"/>
<separator orientation="vertical"/>
<field name="state"/>
<field name="rating"/>
<separator orientation="vertical"/>
<field name="deadline"/>
<separator orientation="vertical"/>
<field name="state"/>
</group>
</search>
</field>
@ -110,5 +96,5 @@
<menuitem id="hr.menu_hr_reporting" name="Reporting" parent="hr.menu_hr_root" sequence="10"/>
<menuitem action="action_evaluation_report_all" id="menu_evaluation_report_all" parent="hr.menu_hr_reporting" sequence="3"/>
</data>
</data>
</openerp>

View File

@ -21,5 +21,4 @@
import hr_evaluation_mail
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -28,7 +28,7 @@ class hr_evaluation_reminder(osv.osv_memory):
'evaluation_id': fields.many2one('hr_evaluation.evaluation', 'Evaluations', required=True)
}
def send_mail(self, cr, uid, ids, context={}):
def send_mail(self, cr, uid, ids, context=None):
hr_evaluation_obj = self.pool.get('hr_evaluation.evaluation')
evaluation_data = self.read(cr, uid, ids, context=context)[0]
for waiting_id in hr_evaluation_obj.browse(cr, uid, evaluation_data['evaluation_id'], context=context).survey_request_ids:
@ -40,4 +40,4 @@ class hr_evaluation_reminder(osv.osv_memory):
hr_evaluation_reminder()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,36 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_hr_evaluation_send_mail" model="ir.ui.view">
<field name="name">hr.evaluation.send.mail</field>
<field name="model">hr.evaluation.reminder</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Evaluation Reminders">
<group width="340">
<separator string="Send evaluation reminder" colspan="4"/>
<field name="evaluation_id"/>
<separator colspan="4"/>
<group colspan="4">
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
<button name="send_mail" string="Send Mail" type="object" icon="gtk-ok"/>
</group>
<record id="view_hr_evaluation_send_mail" model="ir.ui.view">
<field name="name">hr.evaluation.send.mail</field>
<field name="model">hr.evaluation.reminder</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Evaluation Reminders">
<group width="340">
<separator string="Send evaluation reminder" colspan="4"/>
<field name="evaluation_id"/>
<separator colspan="4"/>
<group colspan="4">
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
<button name="send_mail" string="Send Mail" type="object" icon="gtk-ok"/>
</group>
</form>
</field>
</record>
</group>
</form>
</field>
</record>
<record id="action_hr_evaluation_send_mail" model="ir.actions.act_window">
<field name="name">Evaluation Send Mail</field>
<field name="res_model">hr.evaluation.reminder</field>
<field name="type">ir.actions.act_window</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_hr_evaluation_send_mail"/>
<field name="context">{'record_id':active_id}</field>
<field name="target">new</field>
</record>
<field name="name">Evaluation Send Mail</field>
<field name="res_model">hr.evaluation.reminder</field>
<field name="type">ir.actions.act_window</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_hr_evaluation_send_mail"/>
<field name="context">{'record_id':active_id}</field>
<field name="target">new</field>
</record>
</data>
</openerp>

View File

@ -51,10 +51,11 @@
'process/hr_expense_process.xml',
'report/hr_expense_report_view.xml',
'board_hr_expense_view.xml',
],
'demo_xml': ['hr_expense_demo.xml',
# 'hr.expense.expense.csv'
],
],
'demo_xml': [
'hr_expense_demo.xml',
# 'hr.expense.expense.csv'
],
'test': ['test/test_hr_expense.yml'],
'installable': True,
'active': False,

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="action_my_expense" model="ir.actions.act_window">
<field name="name">My Expenses</field>
<field name="res_model">hr.expense.expense</field>
@ -20,5 +21,6 @@
</xpath>
</field>
</record>
</data>
</openerp>

View File

@ -25,7 +25,7 @@ from osv import fields, osv
from tools.translate import _
def _employee_get(obj, cr, uid, context=None):
ids = obj.pool.get('hr.employee').search(cr, uid, [('user_id','=', uid)])
ids = obj.pool.get('hr.employee').search(cr, uid, [('user_id', '=', uid)])
if ids:
return ids[0]
return False
@ -34,15 +34,15 @@ class hr_expense_expense(osv.osv):
def copy(self, cr, uid, id, default=None, context=None):
if not default: default = {}
default.update( {'invoice_id':False,'date_confirm':False,'date_valid':False,'user_valid':False})
default.update({'invoice_id': False, 'date_confirm': False, 'date_valid': False, 'user_valid': False})
return super(hr_expense_expense, self).copy(cr, uid, id, default, context)
def _amount(self, cr, uid, ids, field_name, arg, context):
cr.execute("SELECT s.id,COALESCE(SUM(l.unit_amount*l.unit_quantity),0) AS amount FROM hr_expense_expense s LEFT OUTER JOIN hr_expense_line l ON (s.id=l.expense_id) WHERE s.id IN %s GROUP BY s.id ",(tuple(ids),))
def _amount(self, cr, uid, ids, field_name, arg, context=None):
cr.execute("SELECT s.id,COALESCE(SUM(l.unit_amount*l.unit_quantity),0) AS amount FROM hr_expense_expense s LEFT OUTER JOIN hr_expense_line l ON (s.id=l.expense_id) WHERE s.id IN %s GROUP BY s.id ", (tuple(ids),))
res = dict(cr.fetchall())
return res
def _get_currency(self, cr, uid, context):
def _get_currency(self, cr, uid, context=None):
user = self.pool.get('res.users').browse(cr, uid, [uid])[0]
if user.company_id:
return user.company_id.currency_id.id
@ -158,18 +158,17 @@ class hr_expense_expense(osv.osv):
'fiscal_position': exp.employee_id.address_id.partner_id.property_account_position.id
}
if payment_term_id:
to_update = invoice_obj.onchange_payment_term_date_invoice(cr, uid, [],
payment_term_id, None)
to_update = invoice_obj.onchange_payment_term_date_invoice(cr, uid, [], payment_term_id, None)
if to_update:
inv.update(to_update['value'])
if exp.journal_id:
inv['journal_id']=exp.journal_id.id
inv_id = invoice_obj.create(cr, uid, inv, {'type':'in_invoice'})
invoice_obj.button_compute(cr, uid, [inv_id], {'type':'in_invoice'},
set_total=True)
inv_id = invoice_obj.create(cr, uid, inv, {'type': 'in_invoice'})
invoice_obj.button_compute(cr, uid, [inv_id], {'type': 'in_invoice'}, set_total=True)
self.write(cr, uid, [exp.id], {'invoice_id': inv_id, 'state': 'invoiced'})
res = inv_id
return res
hr_expense_expense()
class product_product(osv.osv):
@ -184,7 +183,7 @@ class hr_expense_line(osv.osv):
_name = "hr.expense.line"
_description = "Expense Line"
def _amount(self, cr, uid, ids, field_name, arg, context):
def _amount(self, cr, uid, ids, field_name, arg, context=None):
if not len(ids):
return {}
cr.execute("SELECT l.id,COALESCE(SUM(l.unit_amount*l.unit_quantity),0) AS amount FROM hr_expense_line l WHERE id IN %s GROUP BY l.id ",(tuple(ids),))
@ -204,11 +203,11 @@ class hr_expense_line(osv.osv):
'analytic_account': fields.many2one('account.analytic.account','Analytic account'),
'ref': fields.char('Reference', size=32),
'sequence' : fields.integer('Sequence', help="Gives the sequence order when displaying a list of expense lines."),
}
}
_defaults = {
'unit_quantity': lambda *a: 1,
'date_value' : lambda *a: time.strftime('%Y-%m-%d'),
}
'unit_quantity': 1,
'date_value': time.strftime('%Y-%m-%d'),
}
_order = "sequence"
def onchange_product_id(self, cr, uid, ids, product_id, uom_id, employee_id, context=None):
@ -218,13 +217,11 @@ class hr_expense_line(osv.osv):
if product_id:
product=self.pool.get('product.product').browse(cr, uid, product_id, context=context)
v['name']=product.name
# Compute based on pricetype of employee company
pricetype_id = self.pool.get('hr.employee').browse(cr, uid, employee_id).user_id.company_id.property_valuation_price_type.id
context['currency_id']=self.pool.get('hr.employee').browse(cr, uid, employee_id).user_id.company_id.currency_id.id
pricetype=self.pool.get('product.price.type').browse(cr, uid, pricetype_id)
amount_unit=product.price_get(pricetype.field, context)[product.id]
v['unit_amount']=amount_unit
if not uom_id:
v['uom_id']=product.uom_id.id

View File

@ -58,6 +58,7 @@
<field name="uom_id" ref="product.product_uom_unit"/>
<field eval="1.0" name="unit_quantity"/>
</record>
<record id="hr_expense_line_basicpcserverforseagate0" model="hr.expense.line">
<field name="name">Basic PC - Server for Seagate</field>
<field name="date_value">2010-05-03</field>
@ -68,7 +69,9 @@
<field name="uom_id" ref="product.product_uom_unit"/>
<field eval="1.0" name="unit_quantity"/>
</record>
</data>
<data noupdate="1">
<record id="hr_expense_expense_septemberexpenses1" model="hr.expense.expense">
<field name="currency_id" ref="base.EUR"/>
@ -79,6 +82,7 @@
<field name="date">2010-04-20</field>
<field name="state">draft</field>
</record>
<record id="hr_expense_line_hotelexpensesthymbra0" model="hr.expense.line">
<field name="name">Hotel Expenses - Thymbra</field>
<field name="date_value">2010-05-03</field>
@ -89,17 +93,17 @@
<field name="uom_id" ref="product.product_uom_unit"/>
<field eval="5.0" name="unit_quantity"/>
</record>
<record id="hr_expense_line_car_travel" model="hr.expense.line">
<field name="name">Bruxelles - Paris</field>
<field name="date_value">2010-05-03</field>
<field name="analytic_account" ref="account.analytic_thymbra"/>
<field name="product_id" ref="product_product_expense_car"/>
<field model="hr.expense.expense" name="expense_id" search="[('name', '=', u'Travel Expenses')]"/>
<field eval="0.30" name="unit_amount"/>
<field name="uom_id" ref="product.product_uom_km"/>
<field eval="622.0" name="unit_quantity"/>
</record>
<record id="hr_expense_line_car_travel" model="hr.expense.line">
<field name="name">Bruxelles - Paris</field>
<field name="date_value">2010-05-03</field>
<field name="analytic_account" ref="account.analytic_thymbra"/>
<field name="product_id" ref="product_product_expense_car"/>
<field model="hr.expense.expense" name="expense_id" search="[('name', '=', u'Travel Expenses')]"/>
<field eval="0.30" name="unit_amount"/>
<field name="uom_id" ref="product.product_uom_km"/>
<field eval="622.0" name="unit_quantity"/>
</record>
</data>
</openerp>

View File

@ -1,6 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<report auto="False" id="hr_expenses" model="hr.expense.expense" name="hr.expense" rml="hr_expense/report/expense.rml" string="HR expenses"/>
</data>
</openerp>

Some files were not shown because too many files have changed in this diff Show More