[MERGE] merged with main addons
bzr revid: bde@tinyerp.com-20121106061200-56jo8blsf8d00k3e
This commit is contained in:
commit
b65e10b9ac
|
@ -123,10 +123,10 @@ openerp.base_import = function (instance) {
|
|||
this.exit();
|
||||
}
|
||||
},
|
||||
init: function (parent, params) {
|
||||
init: function (parent, action) {
|
||||
var self = this;
|
||||
this._super.apply(this, arguments);
|
||||
this.res_model = params.model;
|
||||
this.res_model = action.params.model;
|
||||
// import object id
|
||||
this.id = null;
|
||||
this.Import = new instance.web.Model('base_import.import');
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
'version': '1.1',
|
||||
'author': 'OpenERP SA',
|
||||
'category': 'Human Resources',
|
||||
'sequence': 12,
|
||||
'sequence': 21,
|
||||
'website': 'http://www.openerp.com',
|
||||
'summary': 'Jobs, Departments, Employees Details',
|
||||
'description': """
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
'version': '0.1',
|
||||
'author': 'OpenERP SA',
|
||||
'category': 'Human Resources',
|
||||
'sequence': 31,
|
||||
'website': 'http://www.openerp.com',
|
||||
'summary': 'Periodical Evaluations, Appraisals, Surveys',
|
||||
'images': ['images/hr_evaluation_analysis.jpeg','images/hr_evaluation.jpeg'],
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
'name': 'Expense Management',
|
||||
'version': '1.0',
|
||||
'category': 'Human Resources',
|
||||
'sequence': 30,
|
||||
'sequence': 29,
|
||||
'summary': 'Expenses Validation, Invoicing',
|
||||
'description': """
|
||||
Manage expenses by Employees
|
||||
|
|
|
@ -123,8 +123,8 @@
|
|||
<separator string="Notes"/>
|
||||
<field name="note" placeholder="Free Notes"/>
|
||||
</div>
|
||||
<group class="oe_subtotal_footer">
|
||||
<field name="amount" widget="monetary" options="{'currency_field': 'currency_id'}"/>
|
||||
<group class="oe_subtotal_footer oe_right">
|
||||
<field name="amount" widget="monetary" options="{'currency_field': 'currency_id'}" class="oe_subtotal_footer_separator"/>
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
'version': '1.5',
|
||||
'author': 'OpenERP SA',
|
||||
'category': 'Human Resources',
|
||||
'sequence': 28,
|
||||
'sequence': 27,
|
||||
'summary': 'Holidays, Allocation and Leave Requests',
|
||||
'website': 'http://www.openerp.com',
|
||||
'description': """
|
||||
|
|
|
@ -27,6 +27,7 @@ from operator import itemgetter
|
|||
|
||||
import math
|
||||
import netsvc
|
||||
import tools
|
||||
from osv import fields, osv
|
||||
from tools.translate import _
|
||||
|
||||
|
@ -147,10 +148,10 @@ class hr_holidays(osv.osv):
|
|||
}
|
||||
_sql_constraints = [
|
||||
('type_value', "CHECK( (holiday_type='employee' AND employee_id IS NOT NULL) or (holiday_type='category' AND category_id IS NOT NULL))", "The employee or employee category of this request is missing."),
|
||||
('date_check2', "CHECK ( (type='add') OR (date_from <= date_to))", "The start date must be before the end date !"),
|
||||
('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 anterior to the end date."),
|
||||
('date_check', "CHECK ( number_of_days_temp >= 0 )", "The number of days must be greater than 0."),
|
||||
]
|
||||
|
||||
|
||||
def _create_resource_leave(self, cr, uid, leaves, context=None):
|
||||
'''This method will create entry in resource calendar leave object at the time of holidays validated '''
|
||||
obj_res_leave = self.pool.get('resource.calendar.leaves')
|
||||
|
@ -182,6 +183,13 @@ class hr_holidays(osv.osv):
|
|||
}
|
||||
return result
|
||||
|
||||
def onchange_employee(self, cr, uid, ids, employee_id):
|
||||
result = {'value': {'department_id': False}}
|
||||
if employee_id:
|
||||
employee = self.pool.get('hr.employee').browse(cr, uid, employee_id)
|
||||
result['value'] = {'department_id': employee.department_id.id}
|
||||
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."""
|
||||
|
@ -196,20 +204,53 @@ class hr_holidays(osv.osv):
|
|||
def unlink(self, cr, uid, ids, context=None):
|
||||
for rec in self.browse(cr, uid, ids, context=context):
|
||||
if rec.state not in ['draft', 'cancel', 'confirm']:
|
||||
raise osv.except_osv(_('Warning!'),_('You cannot delete a leave which is in %s state!')%(rec.state))
|
||||
raise osv.except_osv(_('Warning!'),_('You cannot delete a leave which is in %s state.')%(rec.state))
|
||||
return super(hr_holidays, self).unlink(cr, uid, ids, context)
|
||||
|
||||
def onchange_date_from(self, cr, uid, ids, date_to, date_from):
|
||||
result = {}
|
||||
if date_to and date_from:
|
||||
"""
|
||||
If there are no date set for date_to, automatically set one 8 hours later than
|
||||
the date_from.
|
||||
Also update the number_of_days.
|
||||
"""
|
||||
# date_to has to be greater than date_from
|
||||
if (date_from and date_to) and (date_from > date_to):
|
||||
raise osv.except_osv(_('Warning!'),_('The start date must be anterior to the end date.'))
|
||||
|
||||
result = {'value': {}}
|
||||
|
||||
# No date_to set so far: automatically compute one 8 hours later
|
||||
if date_from and not date_to:
|
||||
date_to_with_delta = datetime.datetime.strptime(date_from, tools.DEFAULT_SERVER_DATETIME_FORMAT) + datetime.timedelta(hours=8)
|
||||
result['value']['date_to'] = str(date_to_with_delta)
|
||||
|
||||
# Compute and update the number of days
|
||||
if (date_to and date_from) and (date_from <= date_to):
|
||||
diff_day = self._get_number_of_days(date_from, date_to)
|
||||
result['value'] = {
|
||||
'number_of_days_temp': round(math.floor(diff_day))+1
|
||||
}
|
||||
return result
|
||||
result['value'] = {
|
||||
'number_of_days_temp': 0,
|
||||
}
|
||||
result['value']['number_of_days_temp'] = round(math.floor(diff_day))+1
|
||||
else:
|
||||
result['value']['number_of_days_temp'] = 0
|
||||
|
||||
return result
|
||||
|
||||
def onchange_date_to(self, cr, uid, ids, date_to, date_from):
|
||||
"""
|
||||
Update the number_of_days.
|
||||
"""
|
||||
|
||||
# date_to has to be greater than date_from
|
||||
if (date_from and date_to) and (date_from > date_to):
|
||||
raise osv.except_osv(_('Warning!'),_('The start date must be anterior to the end date.'))
|
||||
|
||||
result = {'value': {}}
|
||||
|
||||
# Compute and update the number of days
|
||||
if (date_to and date_from) and (date_from <= date_to):
|
||||
diff_day = self._get_number_of_days(date_from, date_to)
|
||||
result['value']['number_of_days_temp'] = round(math.floor(diff_day))+1
|
||||
else:
|
||||
result['value']['number_of_days_temp'] = 0
|
||||
|
||||
return result
|
||||
|
||||
def set_to_draft(self, cr, uid, ids, context=None):
|
||||
|
@ -430,10 +471,10 @@ class hr_employee(osv.osv):
|
|||
def _get_remaining_days(self, cr, uid, ids, name, args, context=None):
|
||||
cr.execute("""SELECT
|
||||
sum(h.number_of_days) as days,
|
||||
h.employee_id
|
||||
h.employee_id
|
||||
from
|
||||
hr_holidays h
|
||||
join hr_holidays_status s on (s.id=h.holiday_status_id)
|
||||
join hr_holidays_status s on (s.id=h.holiday_status_id)
|
||||
where
|
||||
h.state='validate' and
|
||||
s.limit=False and
|
||||
|
@ -448,9 +489,9 @@ class hr_employee(osv.osv):
|
|||
remaining[employee_id] = 0.0
|
||||
return remaining
|
||||
|
||||
def _get_leave_status(self, cr, uid, ids, name, args, context=None):
|
||||
def _get_leave_status(self, cr, uid, ids, name, args, context=None):
|
||||
holidays_obj = self.pool.get('hr.holidays')
|
||||
holidays_id = holidays_obj.search(cr, uid,
|
||||
holidays_id = holidays_obj.search(cr, uid,
|
||||
[('employee_id', 'in', ids), ('date_from','<=',time.strftime('%Y-%m-%d %H:%M:%S')),
|
||||
('date_to','>=',time.strftime('%Y-%m-%d 23:59:59')),('type','=','remove'),('state','not in',('cancel','refuse'))],
|
||||
context=context)
|
||||
|
@ -476,7 +517,7 @@ class hr_employee(osv.osv):
|
|||
('validate1', 'Waiting Second Approval'), ('validate', 'Approved'), ('cancel', 'Cancelled')]),
|
||||
'current_leave_id': fields.function(_get_leave_status, multi="leave_status", string="Current Leave Type",type='many2one', relation='hr.holidays.status'),
|
||||
'leave_date_from': fields.function(_get_leave_status, multi='leave_status', type='date', string='From Date'),
|
||||
'leave_date_to': fields.function(_get_leave_status, multi='leave_status', type='date', string='To Date'),
|
||||
'leave_date_to': fields.function(_get_leave_status, multi='leave_status', type='date', string='To Date'),
|
||||
}
|
||||
|
||||
hr_employee()
|
||||
|
|
|
@ -13,9 +13,9 @@
|
|||
<record id="action_holidays_unread" model="ir.values">
|
||||
<field name="name">action_holidays_unread</field>
|
||||
<field name="action_id" ref="actions_server_holidays_unread"/>
|
||||
<field name="value" eval="'ir.actions.server,' + str(ref('actions_server_holidays_unread'))" />
|
||||
<field name="value" eval="'ir.actions.server,' + str(ref('actions_server_holidays_unread'))"/>
|
||||
<field name="key">action</field>
|
||||
<field name="model_id" ref="model_hr_holidays" />
|
||||
<field name="model_id" ref="model_hr_holidays"/>
|
||||
<field name="model">hr.holidays</field>
|
||||
<field name="key2">client_action_multi</field>
|
||||
</record>
|
||||
|
@ -31,9 +31,9 @@
|
|||
<record id="action_holidays_read" model="ir.values">
|
||||
<field name="name">action_holidays_read</field>
|
||||
<field name="action_id" ref="actions_server_holidays_read"/>
|
||||
<field name="value" eval="'ir.actions.server,' + str(ref('actions_server_holidays_read'))" />
|
||||
<field name="value" eval="'ir.actions.server,' + str(ref('actions_server_holidays_read'))"/>
|
||||
<field name="key">action</field>
|
||||
<field name="model_id" ref="model_hr_holidays" />
|
||||
<field name="model_id" ref="model_hr_holidays"/>
|
||||
<field name="model">hr.holidays</field>
|
||||
<field name="key2">client_action_multi</field>
|
||||
</record>
|
||||
|
@ -83,7 +83,7 @@
|
|||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="edit_holiday_new">
|
||||
<record id="edit_holiday_new" model="ir.ui.view">
|
||||
<field name="name">Leave Request</field>
|
||||
<field name="model">hr.holidays</field>
|
||||
<field name="priority">1</field>
|
||||
|
@ -93,7 +93,7 @@
|
|||
<button string="Approve" name="validate" states="confirm" type="workflow" groups="base.group_hr_user" class="oe_highlight"/>
|
||||
<button string="Validate" name="second_validate" states="validate1" type="workflow" groups="base.group_hr_user" class="oe_highlight"/>
|
||||
<button string="Refuse" name="refuse" states="confirm,validate1,validate" type="workflow" groups="base.group_hr_user"/>
|
||||
<button string="Reset to New" name="set_to_draft" states="refuse" type="object" groups="base.group_hr_user" />
|
||||
<button string="Reset to New" name="set_to_draft" states="refuse" type="object" groups="base.group_hr_user"/>
|
||||
<field name="state" widget="statusbar" statusbar_visible="draft,confirm,validate" statusbar_colors='{"confirm":"blue","validate1":"blue","refuse":"red"}'/>
|
||||
</header>
|
||||
<sheet string="Leave Request">
|
||||
|
@ -101,11 +101,11 @@
|
|||
<group>
|
||||
<field name="name" attrs="{'readonly':[('state','!=','draft'),('state','!=','confirm')]}"/>
|
||||
<field name="holiday_status_id" context="{'employee_id':employee_id}"/>
|
||||
<label for="number_of_days_temp" string="Duration"/>
|
||||
<label for="number_of_days_temp" string="Duration" help="The default duration interval between the start date and the end date is 8 hours. Feel free to adapt it to your needs."/>
|
||||
<div>
|
||||
<group col="3">
|
||||
<field name="date_from" nolabel="1" on_change="onchange_date_from(date_to, date_from)" required="1" class="oe_inline"/><label string="-" class="oe_inline" />
|
||||
<field name="date_to" nolabel="1" on_change="onchange_date_from(date_to, date_from)" required="1" class="oe_inline"/>
|
||||
<field name="date_from" nolabel="1" on_change="onchange_date_from(date_to, date_from)" required="1" class="oe_inline"/><label string="-" class="oe_inline"/>
|
||||
<field name="date_to" nolabel="1" on_change="onchange_date_to(date_to, date_from)" required="1" class="oe_inline"/>
|
||||
</group>
|
||||
<div>
|
||||
<field name="number_of_days_temp" class="oe_inline"/> days
|
||||
|
@ -115,7 +115,7 @@
|
|||
</group>
|
||||
<group>
|
||||
<field name="holiday_type" on_change="onchange_type(holiday_type)" attrs="{'readonly':[('state','!=','draft')]}" width="130" string="Mode" groups="base.group_hr_user"/>
|
||||
<field name="employee_id" attrs="{'required':[('holiday_type','=','employee')],'invisible':[('holiday_type','=','category')]}" groups="base.group_hr_user"/>
|
||||
<field name="employee_id" attrs="{'required':[('holiday_type','=','employee')],'invisible':[('holiday_type','=','category')]}" on_change="onchange_employee(employee_id)" groups="base.group_hr_user"/>
|
||||
<field name="department_id" attrs="{'readonly':[('holiday_type','=','category')]}" groups="base.group_hr_user"/>
|
||||
</group>
|
||||
</group>
|
||||
|
@ -138,7 +138,7 @@
|
|||
<button string="Approve" name="validate" states="confirm" type="workflow" groups="base.group_hr_user" class="oe_highlight"/>
|
||||
<button string="Validate" name="second_validate" states="validate1" type="workflow" groups="base.group_hr_user" class="oe_highlight"/>
|
||||
<button string="Refuse" name="refuse" states="confirm,validate,validate1" type="workflow" groups="base.group_hr_user"/>
|
||||
<button string="Reset to New" name="set_to_draft" states="cancel,refuse" type="object" groups="base.group_hr_user" />
|
||||
<button string="Reset to New" name="set_to_draft" states="cancel,refuse" type="object" groups="base.group_hr_user"/>
|
||||
<field name="state" widget="statusbar" statusbar_visible="draft,confirm,validate" statusbar_colors='{"confirm":"blue","validate1":"blue","refuse":"red"}'/>
|
||||
</header>
|
||||
<sheet>
|
||||
|
@ -233,7 +233,6 @@
|
|||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_holiday">
|
||||
<field name="name">hr.holidays.tree</field>
|
||||
<field name="model">hr.holidays</field>
|
||||
|
@ -251,7 +250,6 @@
|
|||
<field name="holiday_status_id" invisible="1"/>
|
||||
<field name="manager_id" invisible="1"/>
|
||||
<field name="user_id" invisible="1"/>
|
||||
<!--field name="type"/-->
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
@ -268,7 +266,7 @@
|
|||
<field name="search_view_id" ref="view_hr_holidays_filter"/>
|
||||
<field name="help" type="html">
|
||||
<p class="oe_view_nocontent_create">
|
||||
Click to create a new leave request.
|
||||
Click to create a new leave request.
|
||||
</p><p>
|
||||
Once you have recorded your leave request, it will be sent
|
||||
to a manager for validation. Be sure to set the right leave
|
||||
|
@ -298,7 +296,7 @@
|
|||
<field name="view_id" ref="view_holiday_new_calendar"/>
|
||||
<field name="act_window_id" ref="open_ask_holidays"/>
|
||||
</record>
|
||||
|
||||
|
||||
<menuitem name="My Leave Requests" parent="menu_open_ask_holidays" id="menu_open_ask_holidays_new" action="open_ask_holidays"/>
|
||||
|
||||
<record model="ir.actions.act_window" id="request_approve_holidays">
|
||||
|
@ -392,7 +390,7 @@
|
|||
|
||||
<menuitem name="Leaves Summary" parent="menu_open_ask_holidays" id="menu_open_company_allocation" action="open_company_allocation" sequence="40"/>
|
||||
|
||||
<!-- holidays status -->
|
||||
<!-- Holidays status -->
|
||||
<record id="view_holidays_status_filter" model="ir.ui.view">
|
||||
<field name="name">hr.holidays.status.filter</field>
|
||||
<field name="model">hr.holidays.status</field>
|
||||
|
@ -443,6 +441,7 @@
|
|||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_holiday_status_normal_tree">
|
||||
<field name="name">hr.holidays.status.normal.tree</field>
|
||||
<field name="model">hr.holidays.status</field>
|
||||
|
@ -477,9 +476,9 @@
|
|||
</record>
|
||||
|
||||
<menuitem sequence="3" id="hr.menu_open_view_attendance_reason_config" parent="hr.menu_hr_configuration" name="Leaves"/>
|
||||
<menuitem name="Leave Type" action="open_view_holiday_status" id="menu_open_view_holiday_status" parent="hr.menu_hr_configuration" sequence="10" />
|
||||
<menuitem name="Leave Type" action="open_view_holiday_status" id="menu_open_view_holiday_status" parent="hr.menu_hr_configuration" sequence="10"/>
|
||||
|
||||
<!-- holiday on resource leave -->
|
||||
<!-- Holiday on resource leave -->
|
||||
<record id="resource_calendar_leave_form_inherit" model="ir.ui.view">
|
||||
<field name="name">resource.calendar.leaves.form.inherit</field>
|
||||
<field name="model">resource.calendar.leaves</field>
|
||||
|
@ -491,7 +490,7 @@
|
|||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Shortcuts -->
|
||||
<!-- Shortcuts -->
|
||||
<record id="act_hr_employee_holiday_request" model="ir.actions.act_window">
|
||||
<field name="name">Leaves</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
|
@ -504,8 +503,7 @@
|
|||
<field name="view_id" eval="view_holiday"/>
|
||||
</record>
|
||||
|
||||
<!-- Assing leave -->
|
||||
|
||||
<!-- Assing leave -->
|
||||
<record id="hr_holidays_leaves_assign_tree_view" model="ir.ui.view">
|
||||
<field name="name">hr.employee.leave.tree</field>
|
||||
<field name="model">hr.employee</field>
|
||||
|
@ -534,7 +532,6 @@
|
|||
</record>
|
||||
|
||||
<!-- Hr employee inherit Legal Leaves -->
|
||||
|
||||
<record id="view_employee_form_leave_inherit" model="ir.ui.view">
|
||||
<field name="name">hr.employee.leave.form.inherit</field>
|
||||
<field name="model">hr.employee</field>
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
'name': 'Recruitment Process',
|
||||
'version': '1.0',
|
||||
'category': 'Human Resources',
|
||||
'sequence': 24,
|
||||
'sequence': 25,
|
||||
'summary': 'Jobs, Recruitment, Applications, Job Interviews',
|
||||
'description': """
|
||||
Manage job positions and the recruitment process
|
||||
|
|
|
@ -258,6 +258,17 @@ class hr_applicant(base_stage, osv.Model):
|
|||
stage_id = stage_ids and stage_ids[0] or False
|
||||
return {'value': {'stage_id': stage_id}}
|
||||
|
||||
def onchange_partner_id(self, cr, uid, ids, partner_id, context=None):
|
||||
data = {'partner_phone': False,
|
||||
'partner_mobile': False,
|
||||
'email_from': False}
|
||||
if partner_id:
|
||||
addr = self.pool.get('res.partner').browse(cr, uid, partner_id, context)
|
||||
data.update({'partner_phone': addr.phone,
|
||||
'partner_mobile': addr.mobile,
|
||||
'email_from': addr.email})
|
||||
return {'value': data}
|
||||
|
||||
def stage_find(self, cr, uid, cases, section_id, domain=[], order='sequence', context=None):
|
||||
""" Override of the base.stage method
|
||||
Parameter of the stage search taken from the lead:
|
||||
|
|
|
@ -135,7 +135,7 @@
|
|||
<group>
|
||||
<group>
|
||||
<field name="partner_id"
|
||||
on_change="onchange_partner_id(partner_id, email_from)"/>
|
||||
on_change="onchange_partner_id(partner_id)"/>
|
||||
<field name="email_from" widget="email"/>
|
||||
<field name="partner_phone"/>
|
||||
<field name="partner_mobile"/>
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
'name': 'Timesheets',
|
||||
'version': '1.0',
|
||||
'category': 'Human Resources',
|
||||
'sequence': 23,
|
||||
'description': """
|
||||
This module implements a timesheet system.
|
||||
==========================================
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
'name': 'Timesheets',
|
||||
'version': '1.0',
|
||||
'category': 'Human Resources',
|
||||
'sequence': 16,
|
||||
'sequence': 24,
|
||||
'summary': 'Timesheets, Attendances, Activities',
|
||||
'description': """
|
||||
Record and validate timesheets and attendances easily
|
||||
|
|
|
@ -1385,7 +1385,8 @@ openerp.mail = function (session) {
|
|||
* When you use this option, the domain is not used for the fetch root.
|
||||
* @param {String} [no_message] Message to display when there are no message
|
||||
*/
|
||||
init: function (parent, options) {
|
||||
init: function (parent, action) {
|
||||
var options = action.params || {};
|
||||
this._super(parent);
|
||||
this.domain = options.domain || [];
|
||||
this.context = options.context || {};
|
||||
|
@ -1513,7 +1514,7 @@ openerp.mail = function (session) {
|
|||
this.root.destroy();
|
||||
}
|
||||
// create and render Thread widget
|
||||
this.root = new mail.Widget(this, {
|
||||
this.root = new mail.Widget(this, { params: {
|
||||
'domain' : domain,
|
||||
'context' : this.options.context,
|
||||
'typeof_thread': this.options.context['typeof_thread'] || 'other',
|
||||
|
@ -1524,7 +1525,7 @@ openerp.mail = function (session) {
|
|||
'message_ids': message_ids,
|
||||
'show_compact_message': true,
|
||||
'no_message': this.node.attrs.help
|
||||
}
|
||||
}}
|
||||
);
|
||||
|
||||
return this.root.replace(this.$('.oe_mail-placeholder'));
|
||||
|
@ -1552,9 +1553,10 @@ openerp.mail = function (session) {
|
|||
* @param {Object} [options.context] context, is an object. It should
|
||||
* contain default_model, default_res_id, to give it to the threads.
|
||||
*/
|
||||
init: function (parent, options) {
|
||||
init: function (parent, action) {
|
||||
this._super(parent);
|
||||
this.options = options || {};
|
||||
var options = action.params || {};
|
||||
this.options = options;
|
||||
this.options.domain = options.domain || [];
|
||||
this.options.context = options.context || {};
|
||||
this.search_results = {'domain': [], 'context': {}, 'groupby': {}}
|
||||
|
@ -1611,7 +1613,7 @@ openerp.mail = function (session) {
|
|||
message_render: function (search) {
|
||||
var domain = this.options.domain.concat(this.search_results['domain']);
|
||||
var context = _.extend(this.options.context, search&&search.search_results['context'] ? search.search_results['context'] : {});
|
||||
this.root = new mail.Widget(this, {
|
||||
this.root = new mail.Widget(this, { params: {
|
||||
'domain' : domain,
|
||||
'context' : context,
|
||||
'typeof_thread': context['typeof_thread'] || 'other',
|
||||
|
@ -1620,7 +1622,7 @@ openerp.mail = function (session) {
|
|||
'show_read_unread_button': 11,
|
||||
'show_compose_message': true,
|
||||
'show_compact_message': false,
|
||||
}
|
||||
}}
|
||||
);
|
||||
|
||||
return this.root.replace(this.$('.oe_mail-placeholder'));
|
||||
|
|
|
@ -196,8 +196,8 @@ class mrp_bom(osv.osv):
|
|||
'code': fields.char('Reference', size=16),
|
||||
'active': fields.boolean('Active', help="If the active field is set to False, it will allow you to hide the bills of material without removing it."),
|
||||
'type': fields.selection([('normal','Normal BoM'),('phantom','Sets / Phantom')], 'BoM Type', required=True,
|
||||
help= "If a sub-product is used in several products, it can be useful to create its own BoM. "\
|
||||
"Though if you don't want separated production orders for this sub-product, select Set/Phantom as BoM type. "\
|
||||
help= "If a by-product is used in several products, it can be useful to create its own BoM. "\
|
||||
"Though if you don't want separated production orders for this by-product, select Set/Phantom as BoM type. "\
|
||||
"If a Phantom BoM is used for a root product, it will be sold and shipped as a set of components, instead of being produced."),
|
||||
'method': fields.function(_compute_type, string='Method', type='selection', selection=[('',''),('stock','On Stock'),('order','On Order'),('set','Set / Pack')]),
|
||||
'date_start': fields.date('Valid From', help="Validity of this BoM or component. Keep empty if it's always valid."),
|
||||
|
@ -230,7 +230,7 @@ class mrp_bom(osv.osv):
|
|||
_parent_name = "bom_id"
|
||||
_sql_constraints = [
|
||||
('bom_qty_zero', 'CHECK (product_qty>0)', 'All product quantities must be greater than 0.\n' \
|
||||
'You should install the mrp_subproduct module if you want to manage extra products on BoMs !'),
|
||||
'You should install the mrp_byproduct module if you want to manage extra products on BoMs !'),
|
||||
]
|
||||
|
||||
def _check_recursion(self, cr, uid, ids, context=None):
|
||||
|
|
|
@ -507,7 +507,7 @@
|
|||
<p class="oe_view_nocontent_create">
|
||||
Click to add a component to a bill of material.
|
||||
</p><p>
|
||||
Bills of materials components are components and sub-products
|
||||
Bills of materials components are components and by-products
|
||||
used to create master bills of materials. Use this menu to
|
||||
search in which BoM a specific component is used.
|
||||
</p>
|
||||
|
|
|
@ -44,11 +44,11 @@ class mrp_config_settings(osv.osv_memory):
|
|||
'module_mrp_operations': fields.boolean("Allow detailed planning of work order",
|
||||
help="""This allows to add state, date_start,date_stop in production order operation lines (in the "Work Centers" tab).
|
||||
This installs the module mrp_operations."""),
|
||||
'module_mrp_subproduct': fields.boolean("Produce several products from one manufacturing order",
|
||||
help="""You can configure sub-products in the bill of material.
|
||||
'module_mrp_byproduct': fields.boolean("Produce several products from one manufacturing order",
|
||||
help="""You can configure by-products in the bill of material.
|
||||
Without this module: A + B + C -> D.
|
||||
With this module: A + B + C -> D + E.
|
||||
This installs the module mrp_subproduct."""),
|
||||
This installs the module mrp_byproduct."""),
|
||||
'module_mrp_jit': fields.boolean("Generate procurement in real time",
|
||||
help="""This allows Just In Time computation of procurement orders.
|
||||
All procurement orders will be processed immediately, which could in some
|
||||
|
|
|
@ -28,8 +28,8 @@
|
|||
<label for="id" string="Order"/>
|
||||
<div>
|
||||
<div>
|
||||
<field name="module_mrp_subproduct" class="oe_inline"/>
|
||||
<label for="module_mrp_subproduct"/>
|
||||
<field name="module_mrp_byproduct" class="oe_inline"/>
|
||||
<label for="module_mrp_byproduct"/>
|
||||
</div>
|
||||
<div>
|
||||
<field name="module_mrp_repair" class="oe_inline"/>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
-
|
||||
In order to test mrp_subproduct with OpenERP, I add subproduct in bill of material.
|
||||
I make a production order, confirm it so stock moves for subproducts are generated.
|
||||
In order to test mrp_byproduct with OpenERP, I add byproduct in bill of material.
|
||||
I make a production order, confirm it so stock moves for byproducts are generated.
|
||||
-
|
||||
I add a sub product in Bill of material for product External Hard Disk.
|
||||
-
|
||||
|
@ -37,7 +37,7 @@
|
|||
!assert {model: mrp.production, id: mrp_production_mo0, severity: error, string: Production order should be in state confirmed}:
|
||||
- state == 'confirmed'
|
||||
-
|
||||
Now I check the stock moves for the subproduct I created in the bill of material.
|
||||
Now I check the stock moves for the byproduct I created in the bill of material.
|
||||
This move is created automatically when I confirmed the production order.
|
||||
-
|
||||
!python {model: stock.move}: |
|
||||
|
|
|
@ -465,7 +465,7 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal
|
|||
|
||||
var product_list = this.pos.get('product_list');
|
||||
var product = this.get_product();
|
||||
var taxes_ids = product.taxes_id;
|
||||
var taxes_ids = product.get('taxes_id');;
|
||||
var taxes = self.pos.get('taxes');
|
||||
var taxtotal = 0;
|
||||
_.each(taxes_ids, function(el) {
|
||||
|
|
|
@ -202,12 +202,8 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
|
|||
this.currentOrderLines.bind('remove', this.renderElement, this);
|
||||
},
|
||||
update_numpad: function() {
|
||||
var reset = false;
|
||||
if (this.selected_line !== this.pos.get('selectedOrder').getSelectedLine()) {
|
||||
reset = true;
|
||||
}
|
||||
this.selected_line = this.pos.get('selectedOrder').getSelectedLine();
|
||||
if (reset && this.numpadState)
|
||||
if (this.numpadState)
|
||||
this.numpadState.reset();
|
||||
},
|
||||
renderElement: function() {
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
'name': 'Todo Lists',
|
||||
'version': '1.0',
|
||||
'category': 'Project Management',
|
||||
'sequence': 20,
|
||||
'sequence': 9,
|
||||
'summary': 'Personal Tasks, Contexts, Timeboxes',
|
||||
'description': """
|
||||
Implement concepts of the "Getting Things Done" methodology
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
'name': 'Issue Tracker',
|
||||
'version': '1.0',
|
||||
'category': 'Project Management',
|
||||
'sequence': 22,
|
||||
'sequence': 9,
|
||||
'summary': 'Support, Bug Tracker, Helpdesk',
|
||||
'description': """
|
||||
Track Issues/Bugs Management for Projects
|
||||
|
|
Loading…
Reference in New Issue