[IMP/MERGE]:improved and merged from trunk
bzr revid: apa@tinyerp.com-20101229134355-y9yzo1n0chgxr5ft
This commit is contained in:
commit
1ee479f973
|
@ -6,7 +6,6 @@
|
|||
groups="group_account_user,group_account_manager,group_account_invoice"
|
||||
web_icon="images/accounting.png"
|
||||
web_icon_hover="images/accounting-hover.png"/>
|
||||
<menuitem id="menu_partners" name="Partners" parent="menu_finance" sequence="1"/>
|
||||
<menuitem id="menu_finance_receivables" name="Customers" parent="menu_finance" sequence="2"/>
|
||||
<menuitem id="menu_finance_payables" name="Suppliers" parent="menu_finance" sequence="3"/>
|
||||
<menuitem id="menu_finance_bank_and_cash" name="Bank and Cash" parent="menu_finance" sequence="4"
|
||||
|
|
|
@ -2762,11 +2762,13 @@ action = self.pool.get('res.config').next(cr, uid, [], context)
|
|||
<field name="filter" eval="True"/>
|
||||
</record>
|
||||
|
||||
<menuitem id="menu_partners_partners"
|
||||
name="Partners"
|
||||
parent="menu_partners"
|
||||
action="action_partner_all"
|
||||
sequence="1"/>
|
||||
<menuitem id="menu_account_customer" name="Customers"
|
||||
parent="menu_finance_receivables"
|
||||
action="base.action_partner_customer_form" sequence="100"/>
|
||||
|
||||
<menuitem id="menu_account_supplier" name="Suppliers"
|
||||
parent="menu_finance_payables"
|
||||
action="base.action_partner_supplier_form" sequence="100"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -27,6 +27,10 @@
|
|||
<lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
|
||||
<lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_General_Detail_Content">
|
||||
<blockAlignment value="LEFT"/>
|
||||
|
@ -41,6 +45,10 @@
|
|||
<lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
|
||||
<lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table7">
|
||||
<blockAlignment value="LEFT"/>
|
||||
|
@ -178,7 +186,7 @@
|
|||
<para style="terp_default_8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="177.0,177.0,177.0" style="Table_Invoice_General_Header">
|
||||
<blockTable colWidths="132.50,132.50,132.50,132.50" style="Table_Invoice_General_Header">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">Description</para>
|
||||
|
@ -186,12 +194,15 @@
|
|||
<td>
|
||||
<para style="terp_tblheader_General_Centre">Invoice Date</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">Origin</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">Your Reference</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="177.0,177.0,177.0" style="Table_General_Detail_Content">
|
||||
<blockTable colWidths="132.50,132.50,132.50,132.50" style="Table_General_Detail_Content">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Centre_9">[[ o.name or ' ' ]]</para>
|
||||
|
@ -199,6 +210,9 @@
|
|||
<td>
|
||||
<para style="terp_default_Centre_9">[[ formatLang(o.date_invoice,date=True) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Centre_9">[[ o.name or '' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Centre_9">[[ (o.address_invoice_id and o.address_invoice_id.partner_id and o.address_invoice_id.partner_id.ref) or ' ' ]]</para>
|
||||
</td>
|
||||
|
|
|
@ -9,9 +9,7 @@
|
|||
"access_account_account_user","account.account user","model_account_account","base.group_user",1,0,0,0
|
||||
"access_account_account_partner_manager","account.account partner manager","model_account_account","base.group_partner_manager",1,0,0,0
|
||||
"access_account_journal_view","account.journal.view","model_account_journal_view","account.group_account_user",1,0,0,0
|
||||
"access_account_journal_view_hruser","account.journal.view hruser","model_account_journal_view","base.group_hr_user",1,0,0,0
|
||||
"access_account_journal_column","account.journal.column","model_account_journal_column","account.group_account_user",1,0,0,0
|
||||
"access_account_journal_column_hruser","account.journal.column hruser","model_account_journal_column","base.group_hr_user",1,0,0,0
|
||||
"access_account_journal","account.journal","model_account_journal","account.group_account_user",1,0,0,0
|
||||
"access_account_period","account.period","model_account_period","account.group_account_user",1,0,0,0
|
||||
"access_account_journal_period_manager","account.journal.period manager","model_account_journal_period","account.group_account_manager",1,0,0,0
|
||||
|
|
|
|
@ -79,7 +79,8 @@ class account_aged_trial_balance(osv.osv_memory):
|
|||
}
|
||||
start = stop + relativedelta(days=1)
|
||||
data['form'].update(res)
|
||||
if data.get('form',False):data['ids']=[data['form'].get('chart_account_id',False)]
|
||||
if data.get('form',False):
|
||||
data['ids']=[data['form'].get('chart_account_id',False)]
|
||||
return {
|
||||
'type': 'ir.actions.report.xml',
|
||||
'report_name': 'account.aged_trial_balance',
|
||||
|
|
|
@ -27,6 +27,10 @@
|
|||
<lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
|
||||
<lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_General_Detail_Content">
|
||||
<blockAlignment value="LEFT"/>
|
||||
|
@ -41,6 +45,10 @@
|
|||
<lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
|
||||
<lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Tableau6">
|
||||
<blockAlignment value="LEFT"/>
|
||||
|
@ -237,7 +245,7 @@
|
|||
<para style="terp_default_8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="180.0,179.0,180.0" style="Table_Invoice_General_Header">
|
||||
<blockTable colWidths="132.50,132.50,132.50,132.50" style="Table_Invoice_General_Header">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">Description</para>
|
||||
|
@ -245,12 +253,15 @@
|
|||
<td>
|
||||
<para style="terp_tblheader_General_Centre">Invoice Date</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">Origin</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">Your Reference</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="179.0,179.0,180.0" style="Table_General_Detail_Content">
|
||||
<blockTable colWidths="132.50,132.50,132.50,132.50" style="Table_General_Detail_Content">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Centre_8">[[ o.name ]]</para>
|
||||
|
@ -258,6 +269,9 @@
|
|||
<td>
|
||||
<para style="terp_default_Centre_8">[[ formatLang(o.date_invoice,date=True) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Centre_9">[[ o.name or '' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Centre_9">[[ (o.address_invoice_id and o.address_invoice_id.partner_id and o.address_invoice_id.partner_id.ref) or ' ' ]]</para>
|
||||
</td>
|
||||
|
|
|
@ -27,6 +27,10 @@
|
|||
<lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
|
||||
<lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_General_Detail_Content">
|
||||
<blockAlignment value="LEFT"/>
|
||||
|
@ -41,6 +45,10 @@
|
|||
<lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
|
||||
<lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Tableau6">
|
||||
<blockAlignment value="LEFT"/>
|
||||
|
@ -241,7 +249,7 @@
|
|||
<para style="terp_default_8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="180.0,179.0,180.0" style="Table_Invoice_General_Header">
|
||||
<blockTable colWidths="132.50,132.50,132.50,132.50" style="Table_Invoice_General_Header">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">Description</para>
|
||||
|
@ -249,12 +257,15 @@
|
|||
<td>
|
||||
<para style="terp_tblheader_General_Centre">Invoice Date</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">Origin</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">Your Reference</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="179.0,179.0,180.0" style="Table_General_Detail_Content">
|
||||
<blockTable colWidths="132.50,132.50,132.50,132.50" style="Table_General_Detail_Content">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Centre_9">[[ o.name ]]</para>
|
||||
|
@ -262,6 +273,9 @@
|
|||
<td>
|
||||
<para style="terp_default_Centre_9">[[ formatLang(o.date_invoice,date=True) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Centre_9">[[ o.name or '' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Centre_9">[[ (o.address_invoice_id and o.address_invoice_id.partner_id and o.address_invoice_id.partner_id.ref) or ' ' ]]</para>
|
||||
</td>
|
||||
|
|
|
@ -25,3 +25,4 @@
|
|||
"access_report_document_file_group_system","report.document.file group system","model_report_document_file","base.group_system",1,0,0,0
|
||||
"access_report_document_wall_group_document_manager","report.document.wall document manager","model_report_document_wall","base.group_system",1,0,0,0
|
||||
"access_report_document_wall_group_system","report.document.wall group system","model_report_document_wall","base.group_system",1,0,0,0
|
||||
"access_report_document_user_knowledgeuser","report.document.user knowledgeuser","document.model_report_document_user","base.group_document_user",1,0,0,0
|
||||
|
|
|
|
@ -275,7 +275,8 @@
|
|||
id="act_hr_employee_2_hr_contract"
|
||||
name="Contracts"
|
||||
res_model="hr.contract"
|
||||
src_model="hr.employee"/>
|
||||
src_model="hr.employee"
|
||||
groups="base.group_hr_manager"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
|
||||
"access_hr_contract_wage_type_period_user","hr.contract.wage.type.period.user","model_hr_contract_wage_type_period","base.group_hr_user",1,1,1,1
|
||||
"access_hr_contract_wage_type_user","hr.contract.wage.type.user","model_hr_contract_wage_type","base.group_hr_user",1,1,1,1
|
||||
"access_hr_contract_user","hr.contract.user","model_hr_contract","base.group_hr_user",1,1,1,1
|
||||
"access_hr_resource_manager","hr.employee.resource.manager","resource.model_resource_resource","base.group_hr_manager",1,1,1,1
|
||||
"access_hr_resource_calendar_user","hr.employee.resource.calendar.user","resource.model_resource_calendar","base.group_hr_user",1,1,1,1
|
||||
"access_hr_contract_type_manager","hr.contract.type.manager","model_hr_contract_type","base.group_hr_manager",1,1,1,1
|
||||
"access_hr_contract_manager","hr.contract.manager","model_hr_contract","base.group_hr_manager",1,1,1,1
|
||||
|
|
|
|
@ -1,5 +1,6 @@
|
|||
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
|
||||
"access_hr_evaluation_evaluation_user","hr_evaluation.evaluation.user","model_hr_evaluation_evaluation","base.group_hr_user",1,1,1,1
|
||||
"access_hr_evaluation_evaluation_employee","hr_evaluation.evaluation.employee","model_hr_evaluation_evaluation","base.group_user",1,0,0,0
|
||||
"access_hr_evaluation_plan_user","hr_evaluation.plan.user","model_hr_evaluation_plan","base.group_hr_user",1,1,1,1
|
||||
"access_hr_evaluation_plan_phase_user","hr_evaluation.plan.phase.user","model_hr_evaluation_plan_phase","base.group_hr_user",1,1,1,1
|
||||
"access_hr_evaluation_interview_user","hr.evaluation.interview.user","model_hr_evaluation_interview","base.group_hr_user",1,1,1,1
|
||||
|
|
|
|
@ -17,3 +17,5 @@
|
|||
"access_account_move_line_user","account.move.line.user","account.model_account_move_line","base.group_hr_user",1,1,1,1
|
||||
"access_account_analytic_line_user","account.ianalytic.line.user","account.model_account_analytic_line","base.group_hr_user",1,1,1,1
|
||||
"access_account_journal_period_manager","account.journal.period.manager","account.model_account_journal_period","base.group_hr_manager",1,1,1,1
|
||||
"hr.access_account_journal_view_hruser","account.journal.view hruser","account.model_account_journal_view","base.group_hr_user",1,0,0,0
|
||||
"hr.access_account_journal_column_hruser","account.journal.column hruser","account.model_account_journal_column","base.group_hr_user",1,0,0,0
|
||||
|
|
|
|
@ -35,37 +35,11 @@ class hr_holidays_status(osv.osv):
|
|||
_name = "hr.holidays.status"
|
||||
_description = "Leave Type"
|
||||
|
||||
def get_days_cat(self, cr, uid, ids, category_id, return_false, context=None):
|
||||
|
||||
cr.execute("""SELECT id, type, number_of_days, holiday_status_id FROM hr_holidays WHERE category_id = %s AND state='validate' AND holiday_status_id in %s""",
|
||||
[category_id, tuple(ids)])
|
||||
result = sorted(cr.dictfetchall(), key=lambda x: x['holiday_status_id'])
|
||||
|
||||
grouped_lines = dict((k, [v for v in itr]) for k, itr in groupby(result, itemgetter('holiday_status_id')))
|
||||
|
||||
res = {}
|
||||
for record in self.browse(cr, uid, ids, context=context):
|
||||
res[record.id] = {}
|
||||
max_leaves = leaves_taken = 0
|
||||
if not return_false:
|
||||
if record.id in grouped_lines:
|
||||
leaves_taken = -sum([item['number_of_days'] for item in grouped_lines[record.id] if item['type'] == 'remove'])
|
||||
max_leaves = sum([item['number_of_days'] for item in grouped_lines[record.id] if item['type'] == 'add'])
|
||||
|
||||
res[record.id]['max_leaves'] = max_leaves
|
||||
res[record.id]['leaves_taken'] = leaves_taken
|
||||
res[record.id]['remaining_leaves'] = max_leaves - leaves_taken
|
||||
|
||||
return res
|
||||
|
||||
def get_days(self, cr, uid, ids, employee_id, return_false, context=None):
|
||||
|
||||
cr.execute("""SELECT id, type, number_of_days, holiday_status_id FROM hr_holidays WHERE employee_id = %s AND state='validate' AND holiday_status_id in %s""",
|
||||
[employee_id, tuple(ids)])
|
||||
result = sorted(cr.dictfetchall(), key=lambda x: x['holiday_status_id'])
|
||||
|
||||
grouped_lines = dict((k, [v for v in itr]) for k, itr in groupby(result, itemgetter('holiday_status_id')))
|
||||
|
||||
res = {}
|
||||
for record in self.browse(cr, uid, ids, context=context):
|
||||
res[record.id] = {}
|
||||
|
@ -74,18 +48,15 @@ class hr_holidays_status(osv.osv):
|
|||
if record.id in grouped_lines:
|
||||
leaves_taken = -sum([item['number_of_days'] for item in grouped_lines[record.id] if item['type'] == 'remove'])
|
||||
max_leaves = sum([item['number_of_days'] for item in grouped_lines[record.id] if item['type'] == 'add'])
|
||||
|
||||
res[record.id]['max_leaves'] = max_leaves
|
||||
res[record.id]['leaves_taken'] = leaves_taken
|
||||
res[record.id]['remaining_leaves'] = max_leaves - leaves_taken
|
||||
|
||||
return res
|
||||
|
||||
def _user_left_days(self, cr, uid, ids, name, args, context=None):
|
||||
return_false = False
|
||||
employee_id = False
|
||||
res = {}
|
||||
|
||||
if context and context.has_key('employee_id'):
|
||||
if not context['employee_id']:
|
||||
return_false = True
|
||||
|
@ -102,10 +73,9 @@ class hr_holidays_status(osv.osv):
|
|||
res = dict.fromkeys(ids, {'leaves_taken': 0, 'remaining_leaves': 0, 'max_leaves': 0})
|
||||
return res
|
||||
|
||||
# To do: we can add remaining_leaves_category field to display remaining leaves for particular type
|
||||
_columns = {
|
||||
'name': fields.char('Leave Type', size=64, required=True, translate=True),
|
||||
'categ_id': fields.many2one('crm.case.categ', 'Meeting Category', domain="[('object_id.model', '=', 'crm.meeting')]", help='If you link this type of leave with a category in the CRM, it will synchronize each leave asked with a case in this category, to display it in the company shared calendar for example.'),
|
||||
'categ_id': fields.many2one('crm.case.categ', 'Meeting', domain="[('object_id.model', '=', 'crm.meeting')]", help='If you set a meeting type, OpenERP will create a meeting in the calendar once a leave is validated.'),
|
||||
'color_name': fields.selection([('red', 'Red'),('blue','Blue'), ('lightgreen', 'Light Green'), ('lightblue','Light Blue'), ('lightyellow', 'Light Yellow'), ('magenta', 'Magenta'),('lightcyan', 'Light Cyan'),('black', 'Black'),('lightpink', 'Light Pink'),('brown', 'Brown'),('violet', 'Violet'),('lightcoral', 'Light Coral'),('lightsalmon', 'Light Salmon'),('lavender', 'Lavender'),('wheat', 'Wheat'),('ivory', 'Ivory')],'Color in Report', required=True, help='This color will be used in the leaves summary located in Reporting\Leaves by Departement'),
|
||||
'limit': fields.boolean('Allow to Override Limit', help='If you tick this checkbox, the system will allow, for this section, the employees to take more leaves than the available ones.'),
|
||||
'active': fields.boolean('Active', help="If the active field is set to false, it will allow you to hide the leave type without removing it."),
|
||||
|
@ -118,7 +88,6 @@ class hr_holidays_status(osv.osv):
|
|||
'color_name': 'red',
|
||||
'active': True,
|
||||
}
|
||||
|
||||
hr_holidays_status()
|
||||
|
||||
class hr_holidays(osv.osv):
|
||||
|
@ -132,12 +101,23 @@ class hr_holidays(osv.osv):
|
|||
return ids[0]
|
||||
return False
|
||||
|
||||
def _compute_number_of_days(self, cr, uid, ids, name, args, context=None):
|
||||
result = {}
|
||||
for hol in self.browse(cr, uid, ids, context=context):
|
||||
if hol.type=='remove':
|
||||
result[hol.id] = -hol.number_of_days_temp
|
||||
else:
|
||||
result[hol.id] = hol.number_of_days_temp
|
||||
return result
|
||||
|
||||
_columns = {
|
||||
'name': fields.char('Description', required=True, size=64),
|
||||
'state': fields.selection([('draft', 'Draft'), ('confirm', 'Waiting Approval'), ('refuse', 'Refused'), ('validate1', 'Waiting Second Approval'), ('validate', 'Approved'), ('cancel', 'Cancelled')], 'State', readonly=True, help='When the holiday request is created the state is \'Draft\'.\n It is confirmed by the user and request is sent to admin, the state is \'Waiting Approval\'.\
|
||||
'state': fields.selection([('draft', 'Draft'), ('confirm', 'Waiting Approval'), ('refuse', 'Refused'),
|
||||
('validate1', 'Waiting Second Approval'), ('validate', 'Approved'), ('cancel', 'Cancelled')],
|
||||
'State', readonly=True, help='When the holiday request is created the state is \'Draft\'.\n It is confirmed by the user and request is sent to admin, the state is \'Waiting Approval\'.\
|
||||
If the admin accepts it, the state is \'Approved\'. If it is refused, the state is \'Refused\'.'),
|
||||
'user_id':fields.related('employee_id', 'user_id', type='many2one', relation='res.users', string='User', store=True),
|
||||
'date_from': fields.datetime('Start Date', readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'user_id':fields.many2one('res.users', 'User', states={'draft':[('readonly',False)]}, select=True, readonly=True),
|
||||
'date_to': fields.datetime('End Date', readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'holiday_status_id': fields.many2one("hr.holidays.status", "Leave Type", required=True,readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'employee_id': fields.many2one('hr.employee', "Employee", select=True, invisible=False, readonly=True, states={'draft':[('readonly',False)]}, help='Leave Manager can let this field empty if this leave request/allocation is for every employee'),
|
||||
|
@ -145,27 +125,29 @@ class hr_holidays(osv.osv):
|
|||
#'notes': fields.text('Notes',readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'manager_id': fields.many2one('hr.employee', 'First Approval', invisible=False, readonly=True, help='This area is automaticly filled by the user who validate the leave'),
|
||||
'notes': fields.text('Reasons',readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'number_of_days': fields.float('Number of Days', readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'number_of_days_temp': fields.float('Number of Days', readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'case_id': fields.many2one('crm.meeting', 'Case'),
|
||||
'number_of_days': fields.function(_compute_number_of_days, method=True, string='Number of Days', store=True),
|
||||
'case_id': fields.many2one('crm.meeting', 'Meeting'),
|
||||
'type': fields.selection([('remove','Leave Request'),('add','Allocation Request')], 'Request Type', required=True, readonly=True, states={'draft':[('readonly',False)]}, help="Choose 'Leave Request' if someone wants to take an off-day. \nChoose 'Allocation Request' if you want to increase the number of leaves available for someone"),
|
||||
'allocation_type': fields.selection([('employee','Employee Request'),('company','Company Allocation')], 'Allocation Type', required=True, readonly=True, states={'draft':[('readonly',False)]}, help='This field is only for informative purposes, to depict if the leave request/allocation comes from an employee or from the company'),
|
||||
'parent_id': fields.many2one('hr.holidays', 'Parent'),
|
||||
'linked_request_ids': fields.one2many('hr.holidays', 'parent_id', 'Linked Requests',),
|
||||
'department_id':fields.related('employee_id', 'department_id', string='Department', type='many2one', relation='hr.department', readonly=True, store=True),
|
||||
'category_id': fields.many2one('hr.employee.category', "Category", help='Category Of employee'),
|
||||
'category_id': fields.many2one('hr.employee.category', "Category", help='Category of Employee'),
|
||||
'holiday_type': fields.selection([('employee','By Employee'),('category','By Employee Category')], 'Allocation Type', help='By Employee: Allocation/Request for individual Employee, By Employee Category: Allocation/Request for group of employees in category', required=True),
|
||||
'manager_id2': fields.many2one('hr.employee', 'Second Approval', readonly=True, help='This area is automaticly filled by the user who validate the leave with second level (If Leave type need second validation)')
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'employee_id': _employee_get,
|
||||
'state': 'draft',
|
||||
'type': 'remove',
|
||||
'allocation_type': 'employee',
|
||||
'user_id': lambda obj, cr, uid, context: uid,
|
||||
'holiday_type': 'employee'
|
||||
}
|
||||
_sql_constraints = [
|
||||
('type_value', "CHECK( (holiday_type='employee' AND employee_id IS NOT NULL) or (holiday_type='category' AND category_id IS NOT NULL))", "You have to select an employee or a category"),
|
||||
('date_check', "CHECK ( number_of_days_temp > 0 )", "The number of days must be greater than 0 !"),
|
||||
('date_check2', "CHECK ( (type='add') OR (date_from < date_to))", "The start date must be before the end date !")
|
||||
]
|
||||
|
||||
def _create_resource_leave(self, cr, uid, vals, context=None):
|
||||
'''This method will create entry in resource calendar leave object at the time of holidays validated '''
|
||||
|
@ -178,28 +160,6 @@ class hr_holidays(osv.osv):
|
|||
leave_ids = obj_res_leave.search(cr, uid, [('holiday_id', 'in', ids)], context=context)
|
||||
return obj_res_leave.unlink(cr, uid, leave_ids)
|
||||
|
||||
def create(self, cr, uid, vals, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
if 'holiday_type' in vals:
|
||||
if vals['holiday_type'] == 'employee':
|
||||
vals.update({'category_id': False})
|
||||
else:
|
||||
vals.update({'employee_id': False})
|
||||
if context.has_key('type'):
|
||||
vals['type'] = context['type']
|
||||
if context.has_key('allocation_type'):
|
||||
vals['allocation_type'] = context['allocation_type']
|
||||
return super(hr_holidays, self).create(cr, uid, vals, context=context)
|
||||
|
||||
def write(self, cr, uid, ids, vals, context=None):
|
||||
if 'holiday_type' in vals:
|
||||
if vals['holiday_type'] == 'employee':
|
||||
vals.update({'category_id': False})
|
||||
else:
|
||||
vals.update({'employee_id': False})
|
||||
return super(hr_holidays, self).write(cr, uid, ids, vals, context=context)
|
||||
|
||||
def onchange_type(self, cr, uid, ids, holiday_type):
|
||||
result = {}
|
||||
if holiday_type == 'employee':
|
||||
|
@ -210,6 +170,7 @@ class hr_holidays(osv.osv):
|
|||
}
|
||||
return result
|
||||
|
||||
# TODO: can be improved using resource calendar method
|
||||
def _get_number_of_days(self, date_from, date_to):
|
||||
"""Returns a float equals to the timedelta between two dates given as string."""
|
||||
|
||||
|
@ -220,35 +181,10 @@ class hr_holidays(osv.osv):
|
|||
diff_day = timedelta.days + float(timedelta.seconds) / 86400
|
||||
return diff_day
|
||||
|
||||
def _update_user_holidays(self, cr, uid, ids):
|
||||
obj_crm_meeting = self.pool.get('crm.meeting')
|
||||
for record in self.browse(cr, uid, ids):
|
||||
if record.state=='validate':
|
||||
if record.case_id:
|
||||
obj_crm_meeting.unlink(cr, uid, [record.case_id.id])
|
||||
if record.linked_request_ids:
|
||||
list_ids = [ lr.id for lr in record.linked_request_ids]
|
||||
self.holidays_cancel(cr, uid, list_ids)
|
||||
self.unlink(cr, uid, list_ids)
|
||||
return True
|
||||
|
||||
def _check_date(self, cr, uid, ids, context=None):
|
||||
for rec in self.read(cr, uid, ids, ['number_of_days_temp', 'date_from','date_to', 'type']):
|
||||
if rec['number_of_days_temp'] < 0:
|
||||
return False
|
||||
if rec['type'] == 'add':
|
||||
continue
|
||||
date_from = time.strptime(rec['date_from'], '%Y-%m-%d %H:%M:%S')
|
||||
date_to = time.strptime(rec['date_to'], '%Y-%m-%d %H:%M:%S')
|
||||
if date_from > date_to:
|
||||
return False
|
||||
return True
|
||||
|
||||
_constraints = [(_check_date, 'Start date should not be larger than end date!\nNumber of Days should be greater than 1!', ['number_of_days_temp'])]
|
||||
|
||||
def unlink(self, cr, uid, ids, context=None):
|
||||
self._update_user_holidays(cr, uid, ids)
|
||||
self._remove_resouce_leave(cr, uid, ids, context=context)
|
||||
for rec in self.browse(cr, uid, ids, context=context):
|
||||
if rec.state<>'draft':
|
||||
raise osv.except_osv(_('Warning!'),_('You cannot delete a leave which is not in draft state !'))
|
||||
return super(hr_holidays, self).unlink(cr, uid, ids, context)
|
||||
|
||||
def onchange_date_from(self, cr, uid, ids, date_to, date_from):
|
||||
|
@ -264,13 +200,10 @@ class hr_holidays(osv.osv):
|
|||
}
|
||||
return result
|
||||
|
||||
def onchange_date_to(self, cr, uid, ids, date_from, date_to):
|
||||
return self.onchange_date_from(cr, uid, ids, date_to, date_from)
|
||||
|
||||
def onchange_sec_id(self, cr, uid, ids, status, context=None):
|
||||
warning = {}
|
||||
if status:
|
||||
brows_obj = self.pool.get('hr.holidays.status').browse(cr, uid, [status], context=context)[0]
|
||||
brows_obj = self.pool.get('hr.holidays.status').browse(cr, uid, status, context=context)
|
||||
if brows_obj.categ_id and brows_obj.categ_id.section_id and not brows_obj.categ_id.section_id.allow_unlink:
|
||||
warning = {
|
||||
'title': "Warning for ",
|
||||
|
@ -279,61 +212,46 @@ class hr_holidays(osv.osv):
|
|||
return {'warning': warning}
|
||||
|
||||
def set_to_draft(self, cr, uid, ids, *args):
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
self.write(cr, uid, ids, {
|
||||
'state': 'draft',
|
||||
'manager_id': False,
|
||||
'number_of_days': 0,
|
||||
})
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
for id in ids:
|
||||
wf_service.trg_create(uid, 'hr.holidays', id, cr)
|
||||
return True
|
||||
|
||||
def holidays_validate2(self, cr, uid, ids, *args):
|
||||
obj_emp = self.pool.get('hr.employee')
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
vals = {'state':'validate1'}
|
||||
self.check_holidays(cr, uid, ids)
|
||||
ids2 = obj_emp.search(cr, uid, [('user_id', '=', uid)])
|
||||
if ids2:
|
||||
vals['manager_id'] = ids2[0]
|
||||
else:
|
||||
raise osv.except_osv(_('Warning !'),_('No user related to the selected employee.'))
|
||||
# Second Time Validate all the leave requests of the category
|
||||
for leave_id in self._get_category_leave_ids(cr, uid, ids):
|
||||
wf_service.trg_validate(uid, 'hr.holidays', leave_id, 'second_validate', cr)
|
||||
return self.write(cr, uid, ids, vals)
|
||||
|
||||
def holidays_validate(self, cr, uid, ids, *args):
|
||||
obj_emp = self.pool.get('hr.employee')
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
data_holiday = self.browse(cr, uid, ids)
|
||||
self.check_holidays(cr, uid, ids)
|
||||
vals = {'state':'validate'}
|
||||
obj_emp = self.pool.get('hr.employee')
|
||||
ids2 = obj_emp.search(cr, uid, [('user_id', '=', uid)])
|
||||
if ids2:
|
||||
if data_holiday[0].state == 'validate1':
|
||||
vals['manager_id2'] = ids2[0]
|
||||
else:
|
||||
vals['manager_id'] = ids2[0]
|
||||
else:
|
||||
raise osv.except_osv(_('Warning !'), _('No user related to the selected employee.'))
|
||||
self.write(cr, uid, ids, vals)
|
||||
manager = ids2 and ids2[0] or False
|
||||
return self.write(cr, uid, ids, {'state':'validate1', 'manager_id': manager})
|
||||
|
||||
def holidays_validate2(self, cr, uid, ids, *args):
|
||||
self.check_holidays(cr, uid, ids)
|
||||
obj_emp = self.pool.get('hr.employee')
|
||||
ids2 = obj_emp.search(cr, uid, [('user_id', '=', uid)])
|
||||
manager = ids2 and ids2[0] or False
|
||||
self.write(cr, uid, ids, {'state':'validate', 'manager_id2': manager})
|
||||
data_holiday = self.browse(cr, uid, ids)
|
||||
for record in data_holiday:
|
||||
if record.holiday_type == 'employee' and record.type == 'remove':
|
||||
meeting_obj = self.pool.get('crm.meeting')
|
||||
vals = {
|
||||
'name': record.name,
|
||||
'date_from': record.date_from,
|
||||
'date_to': record.date_to,
|
||||
'calendar_id': record.employee_id.calendar_id.id,
|
||||
'company_id': record.employee_id.company_id.id,
|
||||
'resource_id': record.employee_id.resource_id.id,
|
||||
'holiday_id': record.id
|
||||
'categ_id': record.holiday_status_id.categ_id.id,
|
||||
'duration': record.number_of_days_temp * 8,
|
||||
'note': record.notes,
|
||||
'user_id': record.user_id.id,
|
||||
'date': record.date_from,
|
||||
'end_date': record.date_to,
|
||||
'date_deadline': record.date_to,
|
||||
}
|
||||
self._create_resource_leave(cr, uid, vals)
|
||||
case_id = meeting_obj.create(cr, uid, vals)
|
||||
self.write(cr, uid, ids, {'case_id': case_id})
|
||||
elif record.holiday_type == 'category':
|
||||
# Create leave/allocation request for employees in the category
|
||||
emp_ids = obj_emp.search(cr, uid, [('category_ids', '=', record.category_id.id)])
|
||||
emp_ids = obj_emp.search(cr, uid, [('category_ids', 'child_of', [record.category_id.id])])
|
||||
leave_ids = []
|
||||
for emp in obj_emp.browse(cr, uid, emp_ids):
|
||||
vals = {
|
||||
|
@ -349,124 +267,48 @@ class hr_holidays(osv.osv):
|
|||
'employee_id': emp.id
|
||||
}
|
||||
leave_ids.append(self.create(cr, uid, vals, context=None))
|
||||
# Confirm and validate all the leave requests of the category
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
for leave_id in leave_ids:
|
||||
wf_service.trg_validate(uid, 'hr.holidays', leave_id, 'confirm', cr)
|
||||
wf_service.trg_validate(uid, 'hr.holidays', leave_id, 'validate', cr)
|
||||
wf_service.trg_validate(uid, 'hr.holidays', leave_id, 'second_validate', cr)
|
||||
return True
|
||||
|
||||
def holidays_confirm(self, cr, uid, ids, *args):
|
||||
obj_hr_holiday_status = self.pool.get('hr.holidays.status')
|
||||
for record in self.browse(cr, uid, ids):
|
||||
user_id = False
|
||||
leave_asked = record.number_of_days_temp
|
||||
if record.holiday_type == 'employee' and record.type == 'remove':
|
||||
if record.employee_id and not record.holiday_status_id.limit:
|
||||
leaves_rest = obj_hr_holiday_status.get_days( cr, uid, [record.holiday_status_id.id], record.employee_id.id, False)[record.holiday_status_id.id]['remaining_leaves']
|
||||
if leaves_rest < leave_asked:
|
||||
raise osv.except_osv(_('Warning!'),_('You cannot validate leaves for employee %s while there are too few remaining leave days.') % (record.employee_id.name))
|
||||
nb = -(record.number_of_days_temp)
|
||||
elif record.holiday_type == 'category' and record.type == 'remove':
|
||||
if record.category_id and not record.holiday_status_id.limit:
|
||||
leaves_rest = obj_hr_holiday_status.get_days_cat( cr, uid, [record.holiday_status_id.id], record.category_id.id, False)[record.holiday_status_id.id]['remaining_leaves']
|
||||
if leaves_rest < leave_asked:
|
||||
raise osv.except_osv(_('Warning!'),_('You cannot validate leaves for category %s while there are too few remaining leave days.') % (record.category_id.name))
|
||||
nb = -(record.number_of_days_temp)
|
||||
else:
|
||||
nb = record.number_of_days_temp
|
||||
|
||||
if record.holiday_type == 'employee' and record.employee_id:
|
||||
user_id = record.employee_id.user_id and record.employee_id.user_id.id or uid
|
||||
|
||||
self.write(cr, uid, [record.id], {'state':'confirm', 'number_of_days': nb, 'user_id': user_id})
|
||||
return True
|
||||
self.check_holidays(cr, uid, ids)
|
||||
return self.write(cr, uid, ids, {'state':'confirm'})
|
||||
|
||||
def holidays_refuse(self, cr, uid, ids, *args):
|
||||
obj_emp = self.pool.get('hr.employee')
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
vals = {'state': 'refuse'}
|
||||
ids2 = obj_emp.search(cr, uid, [('user_id','=', uid)])
|
||||
if ids2:
|
||||
vals['manager_id'] = ids2[0]
|
||||
# Refuse all the leave requests of the category
|
||||
for leave_id in self._get_category_leave_ids(cr, uid, ids):
|
||||
wf_service.trg_validate(uid, 'hr.holidays', leave_id, 'refuse', cr)
|
||||
self.write(cr, uid, ids, vals)
|
||||
ids2 = obj_emp.search(cr, uid, [('user_id', '=', uid)])
|
||||
manager = ids2 and ids2[0] or False
|
||||
self.write(cr, uid, ids, {'state': 'refuse', 'manager_id2': manager})
|
||||
self.holidays_cancel(cr, uid, ids)
|
||||
return True
|
||||
|
||||
def holidays_cancel(self, cr, uid, ids, *args):
|
||||
self._update_user_holidays(cr, uid, ids)
|
||||
self.write(cr, uid, ids, {'state': 'cancel'})
|
||||
self._remove_resouce_leave(cr, uid, ids)
|
||||
return True
|
||||
obj_crm_meeting = self.pool.get('crm.meeting')
|
||||
for record in self.browse(cr, uid, ids):
|
||||
# Delete the meeting
|
||||
if record.case_id:
|
||||
obj_crm_meeting.unlink(cr, uid, [record.case_id.id])
|
||||
|
||||
def holidays_draft(self, cr, uid, ids, *args):
|
||||
# If a category that created several holidays, cancel all related
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
for leave_id in self._get_category_leave_ids(cr, uid, ids):
|
||||
wf_service.trg_validate(uid, 'hr.holidays', leave_id, 'draft', cr)
|
||||
return self.write(cr, uid, ids, {'state': 'draft'})
|
||||
for id in record.linked_request_ids or []:
|
||||
wf_service.trg_validate(uid, 'hr.holidays', id, 'cancel', cr)
|
||||
|
||||
return True
|
||||
|
||||
def check_holidays(self, cr, uid, ids):
|
||||
holi_status_obj = self.pool.get('hr.holidays.status')
|
||||
emp_obj = self.pool.get('hr.employee')
|
||||
meeting_obj = self.pool.get('crm.meeting')
|
||||
for record in self.browse(cr, uid, ids):
|
||||
if not record.number_of_days:
|
||||
raise osv.except_osv(_('Warning!'), _('Wrong leave definition.'))
|
||||
if record.holiday_type=='employee' and record.employee_id:
|
||||
leave_asked = record.number_of_days
|
||||
if leave_asked < 0.00:
|
||||
if not record.holiday_status_id.limit:
|
||||
leaves_rest = holi_status_obj.get_days(cr, uid, [record.holiday_status_id.id], record.employee_id.id, False)[record.holiday_status_id.id]['remaining_leaves']
|
||||
if leaves_rest < -(leave_asked):
|
||||
raise osv.except_osv(_('Warning!'),_('You Cannot Validate leaves while available leaves are less than asked leaves.'))
|
||||
elif record.holiday_type == 'category' and record.category_id:
|
||||
leave_asked = record.number_of_days
|
||||
if leave_asked < 0.00:
|
||||
if not record.holiday_status_id.limit:
|
||||
leaves_rest = holi_status_obj.get_days_cat(cr, uid, [record.holiday_status_id.id], record.category_id.id, False)[record.holiday_status_id.id]['remaining_leaves']
|
||||
if leaves_rest < -(leave_asked):
|
||||
raise osv.except_osv(_('Warning!'),_('You Cannot Validate leaves while available leaves are less than asked leaves.'))
|
||||
else:# This condition will never meet!!
|
||||
holiday_ids = []
|
||||
vals = {
|
||||
'name': record.name,
|
||||
'holiday_status_id': record.holiday_status_id.id,
|
||||
'state': 'draft',
|
||||
'date_from': record.date_from,
|
||||
'date_to': record.date_to,
|
||||
'notes': record.notes,
|
||||
'number_of_days': record.number_of_days,
|
||||
'number_of_days_temp': record.number_of_days_temp,
|
||||
'type': record.type,
|
||||
'allocation_type': record.allocation_type,
|
||||
'parent_id': record.id,
|
||||
}
|
||||
employee_ids = emp_obj.search(cr, uid, [])
|
||||
for employee in employee_ids:
|
||||
vals['employee_id'] = employee
|
||||
user_id = emp_obj.search(cr, uid, [('user_id','=',uid)])
|
||||
if user_id:
|
||||
vals['user_id'] = user_id[0]
|
||||
holiday_ids.append(self.create(cr, uid, vals, context=None))
|
||||
self.holidays_confirm(cr, uid, holiday_ids)
|
||||
self.holidays_validate(cr, uid, holiday_ids)
|
||||
|
||||
if record.holiday_status_id.categ_id and record.date_from and record.date_to and record.employee_id:
|
||||
diff_day = self._get_number_of_days(record.date_from, record.date_to)
|
||||
vals = {
|
||||
'name': record.name,
|
||||
'categ_id': record.holiday_status_id.categ_id.id,
|
||||
'duration': (diff_day) * 8,
|
||||
'note': record.notes,
|
||||
'user_id': record.user_id.id,
|
||||
'date': record.date_from,
|
||||
}
|
||||
case_id = meeting_obj.create(cr, uid, vals)
|
||||
self.write(cr, uid, ids, {'case_id': case_id})
|
||||
|
||||
if record.holiday_type == 'employee' and record.type == 'remove':
|
||||
if record.employee_id and not record.holiday_status_id.limit:
|
||||
leaves_rest = holi_status_obj.get_days( cr, uid, [record.holiday_status_id.id], record.employee_id.id, False)[record.holiday_status_id.id]['remaining_leaves']
|
||||
if leaves_rest < record.number_of_days_temp:
|
||||
raise osv.except_osv(_('Warning!'),_('You cannot validate leaves for employee %s: too few remaining days (%s).') % (record.employee_id.name, leaves_rest))
|
||||
return True
|
||||
|
||||
hr_holidays()
|
||||
|
||||
class resource_calendar_leaves(osv.osv):
|
||||
|
@ -478,4 +320,3 @@ class resource_calendar_leaves(osv.osv):
|
|||
|
||||
resource_calendar_leaves()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -83,7 +83,7 @@
|
|||
<field name="holiday_status_id" on_change="onchange_sec_id(holiday_status_id)" context="{'employee_id':employee_id}" />
|
||||
<field name="department_id"/>
|
||||
<field name="date_from" on_change="onchange_date_from(date_to, date_from)" required="1"/>
|
||||
<field name="date_to" on_change="onchange_date_to(date_from, date_to)" required="1"/>
|
||||
<field name="date_to" on_change="onchange_date_from(date_to, date_from)" required="1"/>
|
||||
<field name="number_of_days_temp"/>
|
||||
<newline/>
|
||||
<field name="manager_id"/>
|
||||
|
@ -93,12 +93,11 @@
|
|||
<newline/>
|
||||
<field name="state" colspan="2"/>
|
||||
<group colspan="2" col="6">
|
||||
<button string="Cancel" name="cancel" states="validate,refuse" type="workflow" icon="gtk-cancel" groups="base.group_hr_manager"/>
|
||||
<button string="Refuse" name="refuse" states="confirm,validate1" type="workflow" icon="gtk-no" groups="base.group_hr_manager"/>
|
||||
<button string="Refuse" name="refuse" states="confirm,validate,validate1" type="workflow" icon="gtk-no" groups="base.group_hr_manager"/>
|
||||
<button string="Confirm" name="confirm" states="draft" type="workflow" icon="gtk-yes" groups="base.group_hr_user,base.group_hr_manager"/>
|
||||
<button string="Approve" name="validate" states="confirm" type="workflow" icon="gtk-apply" groups="base.group_hr_manager"/>
|
||||
<button string="Approved" name="second_validate" states="validate1" type="workflow" icon="gtk-apply" groups="base.group_hr_manager"/>
|
||||
<button string="Set to Draft" name="set_to_draft" states="cancel" type="object" icon="gtk-convert" groups="base.group_hr_manager"/>
|
||||
<button string="Set to Draft" name="set_to_draft" states="refuse" type="object" icon="gtk-convert" groups="base.group_hr_manager"/>
|
||||
</group>
|
||||
</page>
|
||||
</notebook>
|
||||
|
@ -136,8 +135,7 @@
|
|||
<newline/>
|
||||
<field name="state" colspan="2"/>
|
||||
<group colspan="2" col="6">
|
||||
<button string="Cancel" name="cancel" states="validate,refuse" type="workflow" icon="gtk-cancel" groups="base.group_hr_manager"/>
|
||||
<button string="Refuse" name="refuse" states="confirm,validate1" type="workflow" icon="gtk-no" groups="base.group_hr_manager"/>
|
||||
<button string="Refuse" name="refuse" states="confirm,validate,validate1" type="workflow" icon="gtk-no" groups="base.group_hr_manager"/>
|
||||
<button string="Confirm" name="confirm" states="draft" type="workflow" icon="gtk-yes" groups="base.group_hr_user,base.group_hr_manager"/>
|
||||
<button string="Approve" name="validate" states="confirm" type="workflow" icon="gtk-apply" groups="base.group_hr_manager"/>
|
||||
<button string="Approved" name="second_validate" states="validate1" type="workflow" icon="gtk-apply" groups="base.group_hr_manager"/>
|
||||
|
@ -154,7 +152,7 @@
|
|||
<field name="model">hr.holidays</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree colors="red:state in ('refuse');blue:state in (' draft');black:state in ('confirm','validate','validate1');gray:state in ('cancel') " string="Leaves" >
|
||||
<tree colors="red:state in ('refuse');blue:state in ('draft');black:state in ('confirm','validate','validate1')" string="Leaves" >
|
||||
<field name="employee_id"/>
|
||||
<field name="department_id" invisible="1"/>
|
||||
<field name="holiday_status_id"/>
|
||||
|
@ -181,7 +179,7 @@
|
|||
<field name="holiday_status_id" />
|
||||
<field name="type"/>
|
||||
<field name="date_from" on_change="onchange_date_from(date_to, date_from)" attrs="{'readonly':[('type','=','add')], 'required':[('type','=','remove')]}"/>
|
||||
<field name="date_to" on_change="onchange_date_to(date_from, date_to)" attrs="{'readonly':[('type','=','add')], 'required':[('type','=','remove')]}"/>
|
||||
<field name="date_to" on_change="onchange_date_from(date_to, date_from)" attrs="{'readonly':[('type','=','add')], 'required':[('type','=','remove')]}"/>
|
||||
<field name="number_of_days_temp"/>
|
||||
<notebook colspan="4">
|
||||
<page string="General">
|
||||
|
@ -190,10 +188,9 @@
|
|||
<newline/>
|
||||
<field name="state" colspan="2"/>
|
||||
<group colspan="2">
|
||||
<button string="Cancel" name="cancel" states="validate,refuse,validate1" type="workflow" icon="gtk-cancel"/>
|
||||
<button string="Confirm" name="confirm" states="draft" type="workflow" icon="gtk-yes"/>
|
||||
<button string="Approve" name="validate" states="confirm" type="workflow" icon="gtk-apply"/>
|
||||
<button string="Refuse" name="refuse" states="confirm" type="workflow" icon="gtk-no"/>
|
||||
<button string="Refuse" name="refuse" states="confirm,validate,draft" type="workflow" icon="gtk-no"/>
|
||||
<button string="Set to Draft" name="set_to_draft" states="cancel" type="object" icon="gtk-convert"/>
|
||||
</group>
|
||||
</page>
|
||||
|
@ -203,12 +200,12 @@
|
|||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_holiday_simple">
|
||||
<field name="name">hr.holidays.reprot_tree</field>
|
||||
<field name="name">hr.holidays.report_tree</field>
|
||||
<field name="model">hr.holidays</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="priority">20</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree colors="red:state in ('refuse');blue:state in (' draft');black:state in ('confirm','validate','validate1');gray:state in ('cancel')" string="Leaves Summary">
|
||||
<tree colors="red:state in ('refuse');blue:state in (' draft');black:state in ('confirm','validate','validate1')" string="Leaves Summary">
|
||||
<field name="employee_id"/>
|
||||
<field name="department_id" invisible="1"/>
|
||||
<field name="type"/>
|
||||
|
@ -220,11 +217,9 @@
|
|||
<field name="manager_id" invisible="1"/>
|
||||
<field name="user_id" invisible="1"/>
|
||||
<field name="state"/>
|
||||
<button string="Cancel" name="cancel" states="validate,refuse,validate1" type="workflow" icon="gtk-cancel" groups="base.group_hr_manager"/>
|
||||
<button string="Confirm" name="confirm" states="draft" type="workflow" icon="gtk-yes" groups="base.group_hr_user,base.group_hr_manager"/>
|
||||
<button string="Approve" name="validate" states="confirm" type="workflow" icon="gtk-apply" groups="base.group_hr_manager"/>
|
||||
<button string="Refuse" name="refuse" states="confirm" type="workflow" icon="gtk-no" groups="base.group_hr_manager"/>
|
||||
<button string="Set to Draft" name="set_to_draft" states="cancel" type="object" icon="gtk-convert" groups="base.group_hr_manager"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
@ -235,7 +230,7 @@
|
|||
<field name="model">hr.holidays</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree colors="red:state in ('refuse');blue:state in (' draft');black:state in ('confirm','validate','validate1');gray:state in ('cancel')">
|
||||
<tree colors="red:state in ('refuse');blue:state in (' draft');black:state in ('confirm','validate','validate1')">
|
||||
<field name="employee_id"/>
|
||||
<field name="department_id" invisible="not context.get('set_visible',False)"/>
|
||||
<field name="holiday_status_id"/>
|
||||
|
@ -299,7 +294,7 @@
|
|||
<field name="name">Allocation Requests</field>
|
||||
<field name="res_model">hr.holidays</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="context">{"search_default_my_leaves": 1,'type':'add',"search_default_department_id": department_id}</field>
|
||||
<field name="context">{"search_default_my_leaves": 1,'default_type':'add',"search_default_department_id": department_id}</field>
|
||||
<field name="domain">[('type','=','add')]</field>
|
||||
<field name="view_id" ref="allocation_leave_new"/>
|
||||
<field name="search_view_id" ref="view_hr_holidays_filter"/>
|
||||
|
@ -328,6 +323,7 @@
|
|||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" eval="view_holiday_simple"/>
|
||||
<field name="context">{'search_default_my_leaves': 1, 'search_default_group_type': 1}</field>
|
||||
<field name="domain">[('holiday_type','=','employee')]</field>
|
||||
<field name="search_view_id" ref="view_hr_holidays_filter"/>
|
||||
</record>
|
||||
|
||||
|
@ -347,10 +343,6 @@
|
|||
<search string="Search Leave Type">
|
||||
<field name="name"/>
|
||||
<field name="categ_id" widget="selection"/>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By...">
|
||||
<filter string="Meeting Category" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'categ_id'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
@ -368,17 +360,14 @@
|
|||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Details">
|
||||
<group name="selection" col="4" colspan="4">
|
||||
<group colspan="2">
|
||||
<separator string="Validation" />
|
||||
<newline/>
|
||||
<field name="active" />
|
||||
<newline/>
|
||||
<group colspan="2" col="2">
|
||||
<separator string="Validation" colspan="2"/>
|
||||
<field name="double_validation"/>
|
||||
<newline/>
|
||||
<field name="limit"/>
|
||||
</group>
|
||||
<group name="second" colspan="2"/>
|
||||
<group name="second" colspan="2" col="2">
|
||||
<separator string="Misc" colspan="2"/>
|
||||
<field name="active" />
|
||||
</group>
|
||||
</page>
|
||||
</notebook>
|
||||
|
@ -393,9 +382,10 @@
|
|||
<field name="arch" type="xml">
|
||||
<tree string="Leave Type">
|
||||
<field name="name"/>
|
||||
<field name="max_leaves"/>
|
||||
<field name="leaves_taken"/>
|
||||
<field name="remaining_leaves"/>
|
||||
<field name="limit" />
|
||||
<field name="categ_id" invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
|
|
@ -43,17 +43,9 @@
|
|||
<field name="wkf_id" ref="wkf_holidays" />
|
||||
<field name="name">refuse</field>
|
||||
<field name="kind">function</field>
|
||||
<field name="action">holidays_refuse()</field>
|
||||
|
||||
</record>
|
||||
|
||||
<record model="workflow.activity" id="act_cancel">
|
||||
<field name="wkf_id" ref="wkf_holidays" />
|
||||
<field name="name">cancel</field>
|
||||
<field name="flow_stop">True</field>
|
||||
<field name="kind">stopall</field>
|
||||
<field name="action">holidays_cancel()</field>
|
||||
<field name="join_mode">XOR</field>
|
||||
<field name="action">holidays_refuse()</field>
|
||||
</record>
|
||||
|
||||
<!--
|
||||
|
@ -70,7 +62,7 @@
|
|||
<field name="act_from" ref="act_confirm" />
|
||||
<field name="act_to" ref="act_validate" />
|
||||
<field name="signal">validate</field>
|
||||
<field name="condition">(holiday_status_id.double_validation == False)</field>
|
||||
<field name="condition">True</field>
|
||||
</record>
|
||||
|
||||
<record model="workflow.transition" id="t3">
|
||||
|
@ -81,25 +73,14 @@
|
|||
|
||||
<record model="workflow.transition" id="t4">
|
||||
<field name="act_from" ref="act_validate" />
|
||||
<field name="act_to" ref="act_cancel" />
|
||||
<field name="signal">cancel</field>
|
||||
</record>
|
||||
|
||||
<record model="workflow.transition" id="t5">
|
||||
<field name="act_from" ref="act_refuse" />
|
||||
<field name="act_to" ref="act_cancel" />
|
||||
<field name="signal">cancel</field>
|
||||
</record>
|
||||
|
||||
<record model="workflow.transition" id="t7">
|
||||
<field name="act_from" ref="act_cancel" />
|
||||
<field name="act_to" ref="act_draft" />
|
||||
<field name="signal">set_to_draft</field>
|
||||
<field name="act_to" ref="act_refuse" />
|
||||
<field name="signal">refuse</field>
|
||||
</record>
|
||||
|
||||
<record model="workflow.transition" id="t8">
|
||||
<field name="act_from" ref="act_validate1" />
|
||||
<field name="act_to" ref="act_validate" />
|
||||
<field name="act_from" ref="act_validate" />
|
||||
<field name="act_to" ref="act_validate1" />
|
||||
<field name="group_id" ref="base.group_hr_user"/>
|
||||
<field name="signal">second_validate</field>
|
||||
</record>
|
||||
|
||||
|
@ -110,10 +91,10 @@
|
|||
</record>
|
||||
|
||||
<record model="workflow.transition" id="t11">
|
||||
<field name="act_from" ref="act_confirm" />
|
||||
<field name="act_from" ref="act_validate" />
|
||||
<field name="act_to" ref="act_validate1" />
|
||||
<field name="condition">(holiday_status_id.double_validation == True)</field>
|
||||
<field name="signal">validate</field>
|
||||
<field name="condition">not holiday_status_id.double_validation</field>
|
||||
<field name="signal" eval="False"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
__name__ = "Change signs of old holiday requests"
|
||||
|
||||
def migrate(cr, version):
|
||||
cr.execute("DELETE FROM hr_holidays WHERE number_of_days < 0")
|
||||
cr.execute("UPDATE hr_holidays SET number_of_days = -number_of_days, type ='remove'")
|
|
@ -1,35 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
__name__ = "Convert the Holidays Per User limits into positive leave request"
|
||||
|
||||
def migrate(cr, version):
|
||||
# cr.execute("""SELECT id, employee_id, holiday_status, max_leaves, notes, create_uid
|
||||
# FROM hr_holidays_per_user;""")
|
||||
# for record in cr.fetchall():
|
||||
# cr.execute("""INSERT INTO hr_holidays
|
||||
# (employee_id, type, allocation_type, name, holiday_status_id,
|
||||
# state, number_of_days, notes, manager_id) VALUES
|
||||
# (%s, 'add', 'company', 'imported holiday_per_user', %s,
|
||||
# 'validated', %s, %s, %s) """, (record[1],record[2],record[3],record[4],record[5]))
|
||||
return {}
|
||||
|
||||
|
||||
|
|
@ -42,7 +42,6 @@
|
|||
I allocate leave request for employee "Phil Graves".
|
||||
-
|
||||
!record {model: hr.holidays, id: hr_holidays_allocateleaveforuser0}:
|
||||
allocation_type: employee
|
||||
employee_id: 'hr_employee_philgraves0'
|
||||
holiday_status_id: hr_holidays_status_sick0
|
||||
name: Sick Leaves for Phil Graves
|
||||
|
@ -64,7 +63,6 @@
|
|||
I connect as "test_holiday_user1", and create a new leave request for employee "Phil Graves".
|
||||
-
|
||||
!record {model: hr.holidays, id: hr_holidays_iwanttoleaveforgotohospital0}:
|
||||
allocation_type: employee
|
||||
date_from: '2010-05-20 11:48:00'
|
||||
date_to: '2010-05-21 11:48:00'
|
||||
employee_id: 'hr_employee_philgraves0'
|
||||
|
|
|
@ -256,6 +256,10 @@ class hr_payslip(osv.osv):
|
|||
period_pool = self.pool.get('account.period')
|
||||
|
||||
for slip in self.browse(cr, uid, ids, context=context):
|
||||
if not slip.bank_journal_id or not slip.journal_id:
|
||||
# Call super method to process sheet if journal_id or bank_journal_id are not specified.
|
||||
super(hr_payslip, self).process_sheet(cr, uid, [slip.id], context=context)
|
||||
continue
|
||||
line_ids = []
|
||||
partner = False
|
||||
partner_id = False
|
||||
|
@ -411,6 +415,10 @@ class hr_payslip(osv.osv):
|
|||
payslip_pool = self.pool.get('hr.payslip.line')
|
||||
|
||||
for slip in self.browse(cr, uid, ids, context=context):
|
||||
if not slip.journal_id:
|
||||
# Call super method to verify sheet if journal_id is not specified.
|
||||
super(hr_payslip, self).verify_sheet(cr, uid, [slip.id], context=context)
|
||||
continue
|
||||
total_deduct = 0.0
|
||||
|
||||
line_ids = []
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
|
||||
"access_hr_analytic_timesheet","hr.analytic.timesheet","model_hr_analytic_timesheet","base.group_hr_user",1,1,1,1
|
||||
"access_hr_account_analytic_line","account.account.analytic.line","account.model_account_analytic_line","base.group_hr_user",1,1,1,1
|
||||
"access_hr_account_analytic_line_employee","account.account.analytic.line employee","account.model_account_analytic_line","base.group_user",1,0,0,0
|
||||
"access_account_analytic_journal","account.account.analytic.journal","account.model_account_analytic_journal","base.group_hr_user",1,1,1,1
|
||||
"access_product_product_user","product.product user","product.model_product_product","base.group_hr_user",1,1,1,1
|
||||
"access_product_template_hr_timesheet","product.template.hr.timesheet","product.model_product_template","base.group_hr_user",1,1,1,1
|
||||
"access_product_uom_hr_timesheet","product.uom.hr.timesheet","product.model_product_uom","base.group_hr_user",1,1,1,1
|
||||
"access_account_fiscalyear_hr_user","account.account.fiscalyear.user","account.model_account_fiscalyear","base.group_hr_user",1,1,1,1
|
||||
"hr.access_account_journal_view_hruser","account.journal.view hruser","account.model_account_journal_view","base.group_hr_user",1,0,0,0
|
||||
"hr.access_account_journal_column_hruser","account.journal.column hruser","account.model_account_journal_column","base.group_hr_user",1,0,0,0
|
||||
|
|
|
|
@ -84,14 +84,13 @@
|
|||
<field name="type">search</field>
|
||||
<field name="inherit_id" ref="account.view_account_analytic_line_filter"/>
|
||||
<field name="arch" type="xml">
|
||||
<filter name="others" position="after">
|
||||
<separator orientation="vertical"/>
|
||||
<field name="date" position="before">
|
||||
<filter name="to_invoice" string="To Invoice" context="{'to_invoice': 1}" domain="[('invoice_id','=',False),('to_invoice','<>',False)]" icon="terp-dolar"/>
|
||||
</filter>
|
||||
<separator orientation="vertical"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="view_account_analytic_line_tree_inherit" model="ir.ui.view">
|
||||
<field name="name">account.analytic.line.tree.to_invoice</field>
|
||||
<field name="model">account.analytic.line</field>
|
||||
|
|
|
@ -237,27 +237,23 @@ class hr_timesheet_sheet(osv.osv):
|
|||
self.write(cr, uid, [sheet.id], {'date_current': sheet.date_to,}, context=context)
|
||||
return True
|
||||
|
||||
def sign_in(self, cr, uid, ids, context=None):
|
||||
def sign(self, cr, uid, ids, typ, context=None):
|
||||
emp_obj = self.pool.get('hr.employee')
|
||||
sheet = self.browse(cr, uid, ids, context=context)[0]
|
||||
if context is None:
|
||||
context = {}
|
||||
if not self.browse(cr, uid, ids, context=context)[0].date_current == time.strftime('%Y-%m-%d'):
|
||||
if not sheet.date_current == time.strftime('%Y-%m-%d'):
|
||||
raise osv.except_osv(_('Error !'), _('You can not sign in from an other date than today'))
|
||||
emp_ids = emp_obj.search(cr, uid, [('user_id', '=', uid)], context=context)
|
||||
emp_id = sheet.employee_id.id
|
||||
context['sheet_id']=ids[0]
|
||||
emp_obj.attendance_action_change(cr, uid, emp_ids, type='sign_in', context=context,)
|
||||
emp_obj.attendance_action_change(cr, uid, [emp_id], type=typ, context=context,)
|
||||
return True
|
||||
|
||||
def sign_in(self, cr, uid, ids, context=None):
|
||||
return self.sign(cr,uid,ids,'sign_in',context=None)
|
||||
|
||||
def sign_out(self, cr, uid, ids, context=None):
|
||||
emp_obj = self.pool.get('hr.employee')
|
||||
if context is None:
|
||||
context = {}
|
||||
if not self.browse(cr, uid, ids, context=context)[0].date_current == time.strftime('%Y-%m-%d'):
|
||||
raise osv.except_osv(_('Error !'), _('You can not sign out from an other date than today'))
|
||||
emp_ids = emp_obj.search(cr, uid, [('user_id', '=', uid)])
|
||||
context['sheet_id']=ids[0]
|
||||
emp_obj.attendance_action_change(cr, uid, emp_ids, type='sign_out', context=context,)
|
||||
return True
|
||||
return self.sign(cr,uid,ids,'sign_out',context=None)
|
||||
|
||||
_columns = {
|
||||
'name': fields.char('Description', size=64, select=1,
|
||||
|
|
|
@ -185,7 +185,7 @@
|
|||
parent="base.menu_main_pm" sequence="5"/>
|
||||
|
||||
<menuitem action="act_hr_timesheet_sheet_form" id="menu_act_hr_timesheet_sheet_form" parent="hr_attendance.menu_hr_time_tracking"
|
||||
sequence="2"/>
|
||||
sequence="2" groups="base.group_hr_user,base.group_hr_manager"/>
|
||||
|
||||
<!--
|
||||
Company inheritancy
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
|
||||
"access_hr_timesheet_sheet_sheet_user","hr_timesheet_sheet.sheet.user","model_hr_timesheet_sheet_sheet","base.group_hr_user",1,1,1,1
|
||||
"access_hr_timesheet_sheet_sheet_system_user","hr_timesheet_sheet.sheet.system.user","model_hr_timesheet_sheet_sheet","base.group_user",1,0,0,0
|
||||
"access_hr_timesheet_sheet_sheet_user","hr_timesheet_sheet.sheet.user","model_hr_timesheet_sheet_sheet","base.group_user",1,1,1,1
|
||||
"access_hr_timesheet_sheet_sheet_system_employee","hr_timesheet_sheet.sheet.system.employee","model_hr_timesheet_sheet_sheet","base.group_user",1,0,0,0
|
||||
"access_hr_timesheet_sheet_sheet_day","hr_timesheet_sheet.sheet.day","model_hr_timesheet_sheet_sheet_day","base.group_hr_user",1,1,1,1
|
||||
"access_hr_timesheet_sheet_sheet_account","hr_timesheet_sheet.sheet.account","model_hr_timesheet_sheet_sheet_account","base.group_hr_user",1,1,1,1
|
||||
"access_hr_timesheet_report","hr.timesheet.report","model_hr_timesheet_report","base.group_hr_manager",1,1,1,1
|
||||
"access_hr_analytic_timesheet_system_user","hr.analytic.timesheet.system.user","model_hr_analytic_timesheet","base.group_user",1,0,0,0
|
||||
"access_hr_timesheet_sheet_sheet_day","hr.timesheet.sheet.sheet.day.user","model_hr_timesheet_sheet_sheet_day","base.group_user",1,0,0,0
|
||||
"access_timesheet_report_user","timesheet.report.user","model_timesheet_report","base.group_hr_manager",1,1,1,1
|
||||
|
|
|
|
@ -1,4 +1,4 @@
|
|||
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
|
||||
"access_ir_attachment_sale_manager","ir_attachment manager","base.model_ir_attachment","base.group_sale_manager",1,1,1,1
|
||||
"access_ir_attachment_partner_manager","ir_attachment_partner manager","base.model_ir_attachment","base.group_partner_manager",1,1,1,1
|
||||
"access_report_document_user_knowledgeuser","report.document.user knowledgeuser","document.model_report_document_user","base.group_document_user",1,0,0,0
|
||||
|
||||
|
|
|
|
@ -726,7 +726,7 @@
|
|||
<field name="arch" type="xml">
|
||||
<search string="Search Production">
|
||||
<group col='9' colspan='4'>
|
||||
<filter icon="terp-camera_test" string="Ready"
|
||||
<filter icon="terp-camera_test" string="Ready" name="ready"
|
||||
domain="[('state','=','ready')]"
|
||||
help="Non confirmed manufacturing orders"/>
|
||||
<filter icon="terp-check" string="Current" name="current"
|
||||
|
@ -763,7 +763,7 @@
|
|||
<field name="view_mode">tree,form,calendar,graph,gantt</field>
|
||||
<field name="view_id" eval="False"/>
|
||||
<field name="search_view_id" ref="view_mrp_production_filter"/>
|
||||
<field name="context">{'search_default_current':1}</field>
|
||||
<field name="context">{'search_default_ready':1}</field>
|
||||
<field name="help">Manufacturing Orders are usually proposed automatically by OpenERP based on the bill of materials and the procurement rules, but you can also create manufacturing orders manually. OpenERP will handle the consumption of the raw materials (stock decrease) and the production of the finished products (stock increase) when the order is processed.</field>
|
||||
</record>
|
||||
<menuitem action="mrp_production_action" id="menu_mrp_production_action"
|
||||
|
|
|
@ -92,5 +92,3 @@
|
|||
"access_account_account_mrp_manager","account.account mrp manager","account.model_account_account","mrp.group_mrp_manager",1,0,0,0
|
||||
"access_account_journal_mrp_manager","account.journal mrp manager","account.model_account_journal","mrp.group_mrp_manager",1,0,0,0
|
||||
"access_stock_location_mrp_manager","stock.location product mrp manager","stock.model_stock_location","mrp.group_mrp_manager",1,0,0,0
|
||||
"access_sale_order_manufacturing_user","sale.order manufacturing.user","sale.model_sale_order","mrp.group_mrp_user",1,1,0,0
|
||||
"access_sale_order_line_manufacturing_user","sale.order.line manufacturing.user","sale.model_sale_order_line","mrp.group_mrp_user",1,1,0,0
|
||||
|
|
|
|
@ -27,7 +27,7 @@
|
|||
test_reports.try_report_action(cr, uid, 'action_view_mrp_product_price_wizard',wiz_data=data_dict, context=ctx, our_module='mrp')
|
||||
|
||||
-
|
||||
Print Workcenter Load Report through the wizard
|
||||
Print Work Center Load Report through the wizard
|
||||
-
|
||||
!python {model: mrp.workcenter}: |
|
||||
ctx={}
|
||||
|
|
|
@ -13,9 +13,8 @@ class SidebarTemplateEditor(openobject.templating.TemplateEditor):
|
|||
'\n',
|
||||
output.index(self.ADD_ATTACHMENT_BUTTON)) + 1
|
||||
output = output[:form_opener_insertion] + \
|
||||
'''<a href="#" id="add-pad" class="button-a"
|
||||
style="float: right; line-height: 13px; margin-right: 3px;"
|
||||
>${_("Pad")}</a>\n''' + \
|
||||
'''<a href="#" id="add-pad" class="button-a
|
||||
attachment-button">${_(" Add pad")}</a>\n''' + \
|
||||
output[form_opener_insertion:]
|
||||
return output
|
||||
|
||||
|
|
|
@ -51,7 +51,8 @@ class pos_details(osv.osv_memory):
|
|||
res = self.read(cr, uid, ids, ['date_start', 'date_end'], context=context)
|
||||
res = res and res[0] or {}
|
||||
datas['form'] = res
|
||||
if res.get('id',False):datas['ids']=[res['id']]
|
||||
if res.get('id',False):
|
||||
datas['ids']=[res['id']]
|
||||
return {
|
||||
'type': 'ir.actions.report.xml',
|
||||
'report_name': 'pos.details',
|
||||
|
|
|
@ -44,7 +44,8 @@ class pos_payment_report_date(osv.osv_memory):
|
|||
res = self.read(cr, uid, ids, ['date_start', 'date_end', 'user_id'], context=context)
|
||||
res = res and res[0] or {}
|
||||
datas['form'] = res
|
||||
if res.get('id',False):datas['ids']=[res['id']]
|
||||
if res.get('id',False):
|
||||
datas['ids']=[res['id']]
|
||||
return {
|
||||
'type': 'ir.actions.report.xml',
|
||||
'report_name': 'pos.payment.report.date',
|
||||
|
|
|
@ -272,7 +272,7 @@
|
|||
<menuitem id="menu_stock_sched" name="Schedulers" parent="stock.menu_stock_root" sequence="4"/>
|
||||
<menuitem action="action_compute_schedulers" id="menu_stock_proc_schedulers" parent="menu_stock_sched" sequence="20" groups="stock.group_stock_manager"/>
|
||||
<menuitem action="procurement_exceptions" id="menu_stock_procurement_action" parent="menu_stock_sched" sequence="50" groups="stock.group_stock_manager"/>
|
||||
<menuitem id="menu_stock_procurement" name="Automatic Procurements" parent="stock.menu_stock_configuration" sequence="5" groups="base.group_extended"/>
|
||||
<menuitem id="menu_stock_procurement" name="Automatic Procurements" parent="stock.menu_stock_configuration" sequence="5"/>
|
||||
<menuitem action="action_orderpoint_form" id="menu_stock_order_points" parent="menu_stock_procurement" sequence="10"/>
|
||||
|
||||
</data>
|
||||
|
|
|
@ -1,6 +1,2 @@
|
|||
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
|
||||
"access_product_manufacturer_attribute","product.manufacturer.attribute","model_product_manufacturer_attribute",base.group_user,1,0,0,0
|
||||
"access_product_manufacturer_attribute sale_manager","product.manufacturer.attribute","model_product_manufacturer_attribute","base.group_sale_manager",1,1,1,1
|
||||
"access_product_manufacturer_attribute_purchasemanager","product.manufacturer.attribute purchasemanager","model_product_manufacturer_attribute","purchase.group_purchase_manager",1,1,1,1
|
||||
"access_product_manufacturer_attribute_stockmanager","product.manufacturer.attribute stockmanager","model_product_manufacturer_attribute","stock.group_stock_manager",1,1,1,1
|
||||
"access_product_manufacturer_attribute_mrpmanager","product.manufacturer.attribute mrpmanager","model_product_manufacturer_attribute","mrp.group_mrp_manager",1,1,1,1
|
||||
"access_product_manufacturer_attribute","product.manufacturer.attribute","model_product_manufacturer_attribute",base.group_user,1,1,1,1
|
||||
|
|
|
|
@ -84,7 +84,7 @@
|
|||
</field>
|
||||
</record>
|
||||
|
||||
<menuitem icon="STOCK_JUSTIFY_FILL" action="product_margin_act_window" id="menu_action_product_margin" name="Product Margins" sequence="5" parent="base.menu_product" groups="base.group_sale_salesman,base.group_sale_manager,purchase.group_purchase_manager,stock.group_stock_manager,mrp.group_mrp_manager"/>
|
||||
<menuitem icon="STOCK_JUSTIFY_FILL" action="product_margin_act_window" id="menu_action_product_margin" name="Product Margins" sequence="5" parent="base.menu_product"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -42,7 +42,6 @@
|
|||
<group col="2" colspan="2" name="misc">
|
||||
<separator colspan="2" string="Miscelleanous"/>
|
||||
<field name="company_id" select="1" groups="base.group_multi_company" widget="selection" required="1"/>
|
||||
<field name="currency_id" select="1" groups="base.group_multi_company" required="1"/>
|
||||
<field name="warn_manager"/>
|
||||
</group>
|
||||
<newline/>
|
||||
|
@ -74,6 +73,7 @@
|
|||
<field colspan="4" name="partner_id" on_change="onchange_partner_id(partner_id)" select="1" string="Customer"/>
|
||||
<field domain="[('partner_id','=',partner_id)]" name="contact_id" string="Invoice Address"/>
|
||||
<field name="warn_customer"/>
|
||||
<field name="currency_id" select="1" groups="base.group_multi_company" required="1"/>
|
||||
<newline/>
|
||||
<group colspan="4" col="4" groups="base.group_extended">
|
||||
<separator colspan="2" string="Mail Header"/>
|
||||
|
|
|
@ -76,40 +76,6 @@
|
|||
</field>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_account_analytic_line_filter_inherit_buttons" model="ir.ui.view">
|
||||
<field name="name">account.analytic.line.inherit.select</field>
|
||||
<field name="model">account.analytic.line</field>
|
||||
<field name="type">search</field>
|
||||
<field name="priority">10</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Analytic Lines">
|
||||
<group col='6' colspan='4'>
|
||||
<field name="name"/>
|
||||
<field name="date"/>
|
||||
<field name="account_id"/>
|
||||
<field name="user_id">
|
||||
<filter string="My Entries" domain="[('user_id','=',uid)]" icon="terp-personal"/>
|
||||
</field>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Extended Filters...">
|
||||
<field name="journal_id" widget="selection"/>
|
||||
<field name="product_id" widget="selection"/>
|
||||
<field name="amount" select="1"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group string="Group By..." expand="0">
|
||||
<filter string="Account" context="{'group_by':'account_id'}" groups="base.group_extended" icon="terp-folder-green"/>
|
||||
<filter string="Journal" context="{'group_by':'journal_id'}" icon="terp-folder-orange"/>
|
||||
<filter string="User" context="{'group_by':'user_id'}" icon="terp-personal"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Fin.Account" context="{'group_by':'general_account_id'}" icon="terp-folder-green"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Product" context="{'group_by':'product_id'}" icon="terp-accessories-archiver"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Menus -->
|
||||
<record id="action_project_timesheet_bill_task" model="ir.actions.act_window">
|
||||
|
@ -120,7 +86,6 @@
|
|||
<field name="domain">[]</field>
|
||||
<field name="context">{'search_default_to_invoice': 1}</field>
|
||||
<field name="view_id" ref="view_account_analytic_line_tree_inherit_account_id"/>
|
||||
<field name="search_view_id" ref="view_account_analytic_line_filter_inherit_buttons"/>
|
||||
<field name="help">This lists show you every task work you can invoice to the customer. Select the lines in order to generate the invoices automatically.</field>
|
||||
</record>
|
||||
<menuitem action="hr_timesheet.action_hr_timesheet_sign_in"
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
parent="base.menu_purchase_root" sequence="1" />
|
||||
|
||||
<menuitem id="menu_purchase_config_purchase" name="Configuration"
|
||||
groups="group_purchase_manager"
|
||||
parent="base.menu_purchase_root" sequence="100"/>
|
||||
|
||||
<menuitem
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
date_order: '2010-05-11'
|
||||
invoice_method: order
|
||||
location_id: stock.stock_location_stock
|
||||
name: PO00003
|
||||
order_line:
|
||||
- date_planned: '2010-05-13'
|
||||
name: iPod
|
||||
|
|
|
@ -4,4 +4,3 @@
|
|||
"access_report_intrastat_code_sale_manager","report.intrastat.code sale manager","model_report_intrastat_code","base.group_sale_manager",1,1,1,1
|
||||
"access_report_intrastat_code_purchase_manager","report.intrastat.code purchase manager","model_report_intrastat_code","purchase.group_purchase_manager",1,1,1,1
|
||||
"access_report_intrastat_code_stock_manager","report.intrastat.code stock manager","model_report_intrastat_code","stock.group_stock_manager",1,1,1,1
|
||||
"access_report_intrastat_code_mrp_manager","report.intrastat.code mrp manager","model_report_intrastat_code","mrp.group_mrp_manager",1,1,1,1
|
||||
|
|
|
|
@ -400,7 +400,7 @@ class sale_order(osv.osv):
|
|||
inv_line_id = obj_invoice_line.copy(cr, uid, preline.id, {'invoice_id': False, 'price_unit': -preline.price_unit})
|
||||
lines.append(inv_line_id)
|
||||
inv = {
|
||||
'name': order.origin or order.client_order_ref or order.name,
|
||||
'name': order.origin or order.client_order_ref or '',
|
||||
'origin': order.name,
|
||||
'type': 'out_invoice',
|
||||
'reference': "P%dSO%d" % (order.partner_id.id, order.id),
|
||||
|
|
|
@ -8,10 +8,10 @@
|
|||
<field name="shop_id" ref="shop"/>
|
||||
<field model="product.pricelist" name="pricelist_id" search="[]"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
<field model="res.partner" name="partner_id" search="[]"/>
|
||||
<field model="res.partner.address" name="partner_invoice_id" search="[]"/>
|
||||
<field model="res.partner.address" name="partner_shipping_id" search="[]"/>
|
||||
<field model="res.partner.address" name="partner_order_id" search="[]"/>
|
||||
<field ref="base.res_partner_agrolait" name="partner_id"/>
|
||||
<field ref="base.res_partner_address_8" name="partner_invoice_id"/>
|
||||
<field ref="base.res_partner_address_8" name="partner_shipping_id"/>
|
||||
<field ref="base.res_partner_address_8" name="partner_order_id"/>
|
||||
</record>
|
||||
|
||||
<!--Resource: sale.order.line-->
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
!record {model: sale.order, id: sale_order_so5}:
|
||||
date_order: '2010-07-17'
|
||||
invoice_quantity: order
|
||||
name: SO004
|
||||
order_line:
|
||||
- name: LG Viewty Smart
|
||||
price_unit: 170.0
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
|
||||
"access_mrp_bom_user","mrp.bom","mrp.model_mrp_bom","base.group_sale_salesman",1,0,0,0
|
||||
"access_mrp_bom_manager","mrp.bom","mrp.model_mrp_bom","base.group_sale_manager",1,0,0,0
|
||||
"access_sale_order_manufacturing_user","sale.order manufacturing.user","sale.model_sale_order","mrp.group_mrp_user",1,1,0,0
|
||||
"access_sale_order_line_manufacturing_user","sale.order.line manufacturing.user","sale.model_sale_order_line","mrp.group_mrp_user",1,1,0,0
|
||||
|
|
|
|
@ -1668,7 +1668,8 @@
|
|||
<group col="8" colspan="4">
|
||||
<filter icon="terp-go-today" string="Today" domain="[('date','<=',time.strftime('%%Y-%%m-%%d 23:59:59')),('date','>=',time.strftime('%%Y-%%m-%%d 00:00:00'))]" help="Orders planned for today"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter icon="terp-gtk-go-back-rtl" name="receive" string="To Do" domain="[('state','in',('confirmed','assigned'))]" help="Stock to be received"/>
|
||||
<filter icon="terp-gtk-go-back-rtl" name="receive" string="To Do" domain="[('state','in',('confirmed','assigned'))]" help="Stock to be delivered (available or not)"/>
|
||||
<filter icon="terp-check" name="available" string="Available" domain="[('state','in',('assigned',))]" help="Stock available to be delivered"/>
|
||||
<filter icon="terp-dialog-close" name="received" string="Done" domain="[('state','=','done')]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="origin"/>
|
||||
|
|
|
@ -2,16 +2,12 @@
|
|||
"access_product_pulled_flow_user","product_pulled_flow user","model_product_pulled_flow","stock.group_stock_user",1,0,0,0
|
||||
"access_product_pulled_flow_manager","product_pulled_flow manager","model_product_pulled_flow","stock.group_stock_manager",1,1,1,1
|
||||
"access_product_pulled_flow_salemanager","product_pulled_flow salemanager","model_product_pulled_flow","base.group_sale_manager",1,1,1,1
|
||||
"access_product_pulled_flow_purchase_manager","product_pulled_flow purchase manager","model_product_pulled_flow","purchase.group_purchase_manager",1,1,1,1
|
||||
"access_product_pulled_flow_stock_manager","product_pulled_flow stock manager","model_product_pulled_flow","stock.group_stock_manager",1,1,1,1
|
||||
"access_product_pulled_flow_mrp_manager","product_pulled_flow mrp manager","model_product_pulled_flow","mrp.group_mrp_manager",1,1,1,1
|
||||
"access_stock_location_path_user","stock location path user","model_stock_location_path","stock.group_stock_user",1,0,0,0
|
||||
"access_stock_location_path_internal_user","stock location path internal user","model_stock_location_path","base.group_user",1,0,0,0
|
||||
"access_stock_location_path_manager","stock location path manager","model_stock_location_path","stock.group_stock_manager",1,1,1,1
|
||||
"access_stock_location_path_sale_manager","stock.location.path partner salemanager","model_stock_location_path","base.group_sale_manager",1,1,1,1
|
||||
"access_stock_location_path_purchase_manager","stock.location.path purchase manager","model_stock_location_path","purchase.group_purchase_manager",1,1,1,1
|
||||
"access_stock_location_path_stock_manager","stock.location.path stock manager","model_stock_location_path","stock.group_stock_manager",1,1,1,1
|
||||
"access_stock_location_path_mrp_manager","stock.location.path mrp manager","model_stock_location_path","mrp.group_mrp_manager",1,1,1,1
|
||||
"access_stock_location_path_stock_user","stock.location.path stock user","model_stock_location_path","stock.group_stock_user",1,1,1,1
|
||||
"access_stock_location_path","stock.location.path","model_stock_location_path","base.group_sale_salesman",1,0,0,0
|
||||
"access_product_pulled_flow","product.pulled.flow","model_product_pulled_flow","base.group_sale_salesman",1,0,0,0
|
||||
|
|
|
Loading…
Reference in New Issue