[MERGE]: Merged with lp:openobject-addons
bzr revid: atp@tinyerp.com-20121107043932-idazuoqwrhgha1xw
This commit is contained in:
commit
c6010c04b8
|
@ -127,7 +127,6 @@
|
|||
<field name="view_id" ref="account_journal_bank_view"/>
|
||||
<field name="name">Status</field>
|
||||
<field name="field">state</field>
|
||||
<field eval="True" name="invisible"/>
|
||||
<field eval="19" name="sequence"/>
|
||||
</record>
|
||||
<record id="bank_col20" model="account.journal.column">
|
||||
|
@ -215,7 +214,6 @@
|
|||
<field name="view_id" ref="account_journal_bank_view_multi"/>
|
||||
<field name="name">Status</field>
|
||||
<field name="field">state</field>
|
||||
<field eval="True" name="invisible"/>
|
||||
<field eval="19" name="sequence"/>
|
||||
</record>
|
||||
<record id="bank_col20_multi" model="account.journal.column">
|
||||
|
@ -291,7 +289,6 @@
|
|||
<field name="view_id" ref="account_journal_view"/>
|
||||
<field name="name">Status</field>
|
||||
<field name="field">state</field>
|
||||
<field eval="True" name="invisible"/>
|
||||
<field eval="19" name="sequence"/>
|
||||
</record>
|
||||
|
||||
|
@ -373,7 +370,6 @@
|
|||
<field name="view_id" ref="account_sp_journal_view"/>
|
||||
<field name="name">Status</field>
|
||||
<field name="field">state</field>
|
||||
<field eval="True" name="invisible"/>
|
||||
<field eval="19" name="sequence"/>
|
||||
</record>
|
||||
<record id="sp_journal_col20" model="account.journal.column">
|
||||
|
@ -460,7 +456,6 @@
|
|||
<field name="view_id" ref="account_sp_refund_journal_view"/>
|
||||
<field name="name">Status</field>
|
||||
<field name="field">state</field>
|
||||
<field eval="True" name="invisible"/>
|
||||
<field eval="19" name="sequence"/>
|
||||
</record>
|
||||
<record id="sp_refund_journal_col20" model="account.journal.column">
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -712,14 +712,14 @@ class account_voucher(osv.osv):
|
|||
'move_line_id':line.id,
|
||||
'account_id':line.account_id.id,
|
||||
'amount_original': amount_original,
|
||||
'amount': (move_line_found == line.id) and min(price, amount_unreconciled) or 0.0,
|
||||
'amount': (move_line_found == line.id) and min(abs(price), amount_unreconciled) or 0.0,
|
||||
'date_original':line.date,
|
||||
'date_due':line.date_maturity,
|
||||
'amount_unreconciled': amount_unreconciled,
|
||||
'currency_id': line_currency_id,
|
||||
}
|
||||
|
||||
#split voucher amount by most old first, but only for lines in the same currency
|
||||
#in case a corresponding move_line hasn't been found, we now try to assign the voucher amount
|
||||
#on existing invoices: we split voucher amount by most old first, but only for lines in the same currency
|
||||
if not move_line_found:
|
||||
if currency_id == line_currency_id:
|
||||
if line.credit:
|
||||
|
|
|
@ -300,7 +300,7 @@ trigger date, like sending a reminder 15 minutes before a meeting."),
|
|||
write['date_action_last'] = time.strftime('%Y-%m-%d %H:%M:%S')
|
||||
if hasattr(obj, 'state') and action.act_state:
|
||||
write['state'] = action.act_state
|
||||
|
||||
|
||||
model_obj.write(cr, uid, [obj.id], write, context)
|
||||
if hasattr(obj, 'state') and hasattr(obj, 'message_post') and action.act_state:
|
||||
model_obj.message_post(cr, uid, [obj], _(action.act_state), context=context)
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
access_base_import_tests_models_char,base.import.tests.models.char,model_base_import_tests_models_char,base.group_user,1,1,1,1
|
||||
access_base_import_tests_models_char_required,base.import.tests.models.char.required,model_base_import_tests_models_char_required,base.group_user,1,1,1,1
|
||||
access_base_import_tests_models_char_readonly,base.import.tests.models.char.readonly,model_base_import_tests_models_char_readonly,base.group_user,1,1,1,1
|
||||
access_base_import_tests_models_char_states,base.import.tests.models.char.states,model_base_import_tests_models_char_states,base.group_user,1,1,1,1
|
||||
access_base_import_tests_models_char_noreadonly,base.import.tests.models.char.noreadonly,model_base_import_tests_models_char_noreadonly,base.group_user,1,1,1,1
|
||||
access_base_import_tests_models_char_stillreadonly,base.import.tests.models.char.stillreadonly,model_base_import_tests_models_char_stillreadonly,base.group_user,1,1,1,1
|
||||
access_base_import_tests_models_m2o,base.import.tests.models.m2o,model_base_import_tests_models_m2o,base.group_user,1,1,1,1
|
||||
access_base_import_tests_models_m2o_related,base.import.tests.models.m2o.related,model_base_import_tests_models_m2o_related,base.group_user,1,1,1,1
|
||||
access_base_import_tests_models_m2o_required,base.import.tests.models.m2o.required,model_base_import_tests_models_m2o_required,base.group_user,1,1,1,1
|
||||
access_base_import_tests_models_m2o_required_related,base.import.tests.models.m2o.required.related,model_base_import_tests_models_m2o_required_related,base.group_user,1,1,1,1
|
||||
access_base_import_tests_models_o2m,base.import.tests.models.o2m,model_base_import_tests_models_o2m,base.group_user,1,1,1,1
|
||||
access_base_import_tests_models_o2m_child,base.import.tests.models.o2m.child,model_base_import_tests_models_o2m_child,base.group_user,1,1,1,1
|
||||
access_base_import_tests_models_preview,base.import.tests.models.preview,model_base_import_tests_models_preview,base.group_user,1,1,1,1
|
||||
|
|
|
@ -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');
|
||||
|
@ -179,7 +179,8 @@ openerp.base_import = function (instance) {
|
|||
|
||||
//- File & settings change section
|
||||
onfile_loaded: function () {
|
||||
this.$('.oe_import_button').prop('disabled', true);
|
||||
this.$('.oe_import_button, .oe_import_file_reload')
|
||||
.prop('disabled', true);
|
||||
if (!this.$('input.oe_import_file').val()) { return; }
|
||||
|
||||
this.$el.removeClass('oe_import_preview oe_import_error');
|
||||
|
@ -189,7 +190,8 @@ openerp.base_import = function (instance) {
|
|||
},
|
||||
onpreviewing: function () {
|
||||
var self = this;
|
||||
this.$('.oe_import_button').prop('disabled', true);
|
||||
this.$('.oe_import_button, .oe_import_file_reload')
|
||||
.prop('disabled', true);
|
||||
this.$el.addClass('oe_import_with_file');
|
||||
// TODO: test that write // succeeded?
|
||||
this.$el.removeClass('oe_import_preview_error oe_import_error');
|
||||
|
@ -205,6 +207,7 @@ openerp.base_import = function (instance) {
|
|||
},
|
||||
onpreview_error: function (event, from, to, result) {
|
||||
this.$('.oe_import_options').show();
|
||||
this.$('.oe_import_file_reload').prop('disabled', false);
|
||||
this.$el.addClass('oe_import_preview_error oe_import_error');
|
||||
this.$('.oe_import_error_report').html(
|
||||
QWeb.render('ImportView.preview.error', result));
|
||||
|
@ -212,7 +215,8 @@ openerp.base_import = function (instance) {
|
|||
onpreview_success: function (event, from, to, result) {
|
||||
this.$('.oe_import_import').removeClass('oe_highlight');
|
||||
this.$('.oe_import_validate').addClass('oe_highlight');
|
||||
this.$('.oe_import_button').prop('disabled', false);
|
||||
this.$('.oe_import_button, .oe_import_file_reload')
|
||||
.prop('disabled', false);
|
||||
this.$el.addClass('oe_import_preview');
|
||||
this.$('table').html(QWeb.render('ImportView.preview', result));
|
||||
|
||||
|
|
|
@ -30,7 +30,9 @@
|
|||
<label t-attf-for="file_#{_id}" autofocus="autofocus">CSV File:</label>
|
||||
<input type="file" id-attf-id="file_#{_id}"
|
||||
name="file" class="oe_import_file"/>
|
||||
<button type="button" class="oe_import_file_reload" title="Reload data to check changes.">
|
||||
<button type="button" class="oe_import_file_reload"
|
||||
disabled="disabled"
|
||||
title="Reload data to check changes.">
|
||||
<img src="/web/static/src/img/icons/gtk-refresh.png"/>
|
||||
</button>
|
||||
<div class="oe_import_with_file">
|
||||
|
|
|
@ -322,7 +322,6 @@
|
|||
|
||||
<record id="view_picking_withcarrier_in_form" model="ir.ui.view">
|
||||
<field name="name">delivery.stock.picking_withcarrier.in.form.view</field>
|
||||
<field name="type">form</field>
|
||||
<field name="model">stock.picking.in</field>
|
||||
<field name="inherit_id" ref="stock.view_picking_form"/>
|
||||
<field name="arch" type="xml">
|
||||
|
|
|
@ -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>
|
||||
|
@ -211,8 +211,7 @@
|
|||
<field name="search_view_id" ref="product.product_search_form_view"/>
|
||||
</record>
|
||||
|
||||
<menuitem id="menu_product_hr_config_expense" name="Expenses" parent="hr.menu_hr_configuration"/>
|
||||
<menuitem id="menu_hr_product" name="Products" parent="menu_product_hr_config_expense" action="hr_expense_product"/>
|
||||
<menuitem id="menu_hr_product" name="Type of Expenses" parent="hr.menu_hr_configuration" action="hr_expense_product"/>
|
||||
<menuitem id="next_id_49" name="Expenses" sequence="15" parent="hr.menu_hr_root"/>
|
||||
<menuitem action="expense_all" id="menu_expense_all" name="Expenses" parent="next_id_49"/>
|
||||
|
||||
|
|
|
@ -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 _
|
||||
|
||||
|
@ -160,10 +161,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')
|
||||
|
@ -195,6 +196,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."""
|
||||
|
@ -209,20 +217,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 write(self, cr, uid, ids, vals, context=None):
|
||||
|
@ -450,10 +491,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
|
||||
|
@ -468,9 +509,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)
|
||||
|
@ -496,7 +537,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>
|
||||
|
@ -467,7 +466,7 @@
|
|||
</record>
|
||||
|
||||
<record id="open_view_holiday_status" model="ir.actions.act_window">
|
||||
<field name="name">Leave Type</field>
|
||||
<field name="name">Leave Types</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">hr.holidays.status</field>
|
||||
<field name="view_type">form</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>
|
||||
|
|
|
@ -312,12 +312,7 @@ class hr_payslip(osv.osv):
|
|||
company_id = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.id
|
||||
default.update({
|
||||
'line_ids': [],
|
||||
'move_ids': [],
|
||||
'move_line_ids': [],
|
||||
'company_id': company_id,
|
||||
'period_id': False,
|
||||
'basic_before_leaves': 0.0,
|
||||
'basic_amount': 0.0,
|
||||
'number': '',
|
||||
'payslip_run_id': False,
|
||||
'paid': False,
|
||||
|
|
|
@ -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"/>
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
applicant_ids = self.search(cr, uid, [('email_from','=', 'Mr. Richard Anderson <Richard_Anderson@yahoo.com>')])
|
||||
assert applicant_ids, "Applicant is not created after getting the mail"
|
||||
applicant = self.browse(cr, uid, applicant_ids[0], context=context)
|
||||
resume_ids = self.pool.get('ir.attachment').search(cr, uid, [('datas_fname','=','resume.doc'),('res_model','=',self._name),('res_id','=',applicant.id)])
|
||||
resume_ids = self.pool.get('ir.attachment').search(cr, uid, [('datas_fname','=','resume.pdf'),('res_model','=',self._name),('res_id','=',applicant.id)])
|
||||
assert applicant.name == "Application for the post of Jr.application Programmer.", "Applicant name does not match."
|
||||
assert applicant.stage_id.id == ref('hr_recruitment.stage_job1'), "Stage should be 'Initial qualification' and is '%s'." % (applicant.stage_id.name)
|
||||
assert applicant.state == "draft", "Applicant state should be 'draft'."
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -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
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<data noupdate="1">
|
||||
|
||||
<record id="account.action_wizard_multi_chart_todo" model="ir.actions.todo">
|
||||
<field name="state">open</field>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<openerp>
|
||||
<data>
|
||||
<data noupdate="1">
|
||||
|
||||
<record id="account.action_wizard_multi_chart_todo" model="ir.actions.todo">
|
||||
<field name="state">open</field>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<openerp>
|
||||
<data>
|
||||
<data noupdate="1">
|
||||
|
||||
<record id="account.action_wizard_multi_chart_todo" model="ir.actions.todo">
|
||||
<field name="state">open</field>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<openerp>
|
||||
<data>
|
||||
<data noupdate="1">
|
||||
<record id="account.action_wizard_multi_chart_todo" model="ir.actions.todo">
|
||||
<field name="state">open</field>
|
||||
</record>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<data noupdate="1">
|
||||
<record id="account.action_wizard_multi_chart_todo" model="ir.actions.todo">
|
||||
<field name="state">open</field>
|
||||
</record>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<openerp>
|
||||
<data>
|
||||
<data noupdate="1">
|
||||
<record id="account.action_wizard_multi_chart_todo" model="ir.actions.todo">
|
||||
<field name="state">open</field>
|
||||
</record>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<openerp>
|
||||
<data>
|
||||
<data noupdate="1">
|
||||
|
||||
<record id="account.action_wizard_multi_chart_todo" model="ir.actions.todo">
|
||||
<field name="state">open</field>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<openerp>
|
||||
<data>
|
||||
<data noupdate="1">
|
||||
<record id="account.action_wizard_multi_chart_todo" model="ir.actions.todo">
|
||||
<field name="state">open</field>
|
||||
</record>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<data noupdate="1">
|
||||
<record id="account.action_wizard_multi_chart_todo" model="ir.actions.todo">
|
||||
<field name="state">open</field>
|
||||
</record>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<openerp>
|
||||
<data>
|
||||
<data noupdate="1">
|
||||
<record id="account.action_wizard_multi_chart_todo" model="ir.actions.todo">
|
||||
<field name="state">open</field>
|
||||
</record>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<data noupdate="1">
|
||||
<record id="account.action_wizard_multi_chart_todo" model="ir.actions.todo">
|
||||
<field name="state">open</field>
|
||||
</record>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<openerp>
|
||||
<data>
|
||||
<data noupdate="1">
|
||||
<record id="account.action_wizard_multi_chart_todo" model="ir.actions.todo">
|
||||
<field name="state">open</field>
|
||||
</record>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<openerp>
|
||||
<data>
|
||||
<data noupdate="1">
|
||||
<record id="account.action_wizard_multi_chart_todo" model="ir.actions.todo">
|
||||
<field name="state">open</field>
|
||||
</record>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<openerp>
|
||||
<data>
|
||||
<data noupdate="1">
|
||||
<record id="account.action_wizard_multi_chart_todo" model="ir.actions.todo">
|
||||
<field name="state">open</field>
|
||||
</record>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<openerp>
|
||||
<data>
|
||||
<data noupdate="1">
|
||||
<record id="account.action_wizard_multi_chart_todo" model="ir.actions.todo">
|
||||
<field name="state">open</field>
|
||||
</record>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<openerp>
|
||||
<data>
|
||||
<data noupdate="1">
|
||||
<record id="account.action_wizard_multi_chart_todo" model="ir.actions.todo">
|
||||
<field name="state">open</field>
|
||||
</record>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<data noupdate="1">
|
||||
|
||||
<record id="account.action_wizard_multi_chart_todo" model="ir.actions.todo">
|
||||
<field name="state">open</field>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<openerp>
|
||||
<data>
|
||||
<data noupdate="1">
|
||||
<record id="account.action_wizard_multi_chart_todo" model="ir.actions.todo">
|
||||
<field name="state">open</field>
|
||||
</record>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<openerp>
|
||||
<data>
|
||||
<data noupdate="1">
|
||||
<record id="account.action_wizard_multi_chart_todo" model="ir.actions.todo">
|
||||
<field name="state">open</field>
|
||||
</record>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<openerp>
|
||||
<data>
|
||||
<data noupdate="1">
|
||||
<record id="account.action_wizard_multi_chart_todo" model="ir.actions.todo">
|
||||
<field name="state">open</field>
|
||||
</record>
|
||||
|
|
|
@ -641,11 +641,12 @@
|
|||
<field name="account_paid_id" ref="a_wht_income"/>
|
||||
<field name="type_tax_use">sale</field>
|
||||
</record>
|
||||
</data>
|
||||
|
||||
<!-- INSTALL ACTION -->
|
||||
<data noupdate="1">
|
||||
<!-- INSTALL ACTION -->
|
||||
<record id="account.action_wizard_multi_chart_todo" model="ir.actions.todo">
|
||||
<field name="state">open</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp><!-- vim: set fdm=marker : -->
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<data noupdate="1">
|
||||
<record id="account.action_wizard_multi_chart_todo" model="ir.actions.todo">
|
||||
<field name="state">open</field>
|
||||
</record>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<data noupdate="1">
|
||||
<record id="account.action_wizard_multi_chart_todo" model="ir.actions.todo">
|
||||
<field name="state">open</field>
|
||||
</record>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<openerp>
|
||||
<data>
|
||||
<data noupdate="1">
|
||||
<record id="account.action_wizard_multi_chart_todo" model="ir.actions.todo">
|
||||
<field name="state">open</field>
|
||||
</record>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<data noupdate="1">
|
||||
<record id="account.action_wizard_multi_chart_todo" model="ir.actions.todo">
|
||||
<field name="state">open</field>
|
||||
</record>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<openerp>
|
||||
<data>
|
||||
<data noupdate="1">
|
||||
<record id="account.action_wizard_multi_chart_todo" model="ir.actions.todo">
|
||||
<field name="state">open</field>
|
||||
</record>
|
||||
|
|
|
@ -89,6 +89,7 @@ Main Features
|
|||
'static/lib/jquery.expander/jquery.expander.js',
|
||||
'static/src/js/mail.js',
|
||||
'static/src/js/mail_followers.js',
|
||||
'static/src/js/many2many_tags_email.js',
|
||||
],
|
||||
'qweb': [
|
||||
'static/src/xml/mail.xml',
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
<record model="ir.ui.view" id="view_mail_subscription_form">
|
||||
<field name="name">mail.followers.form</field>
|
||||
<field name="model">mail.followers</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Followers Form" version="7.0">
|
||||
<sheet>
|
||||
|
|
|
@ -15,4 +15,4 @@ access_mail_alias_user,mail.alias,model_mail_alias,base.group_user,1,1,1,0
|
|||
access_mail_alias_system,mail.alias,model_mail_alias,base.group_system,1,1,1,1
|
||||
access_mail_message_subtype_all,mail.message.subtype.all,model_mail_message_subtype,,1,0,0,0
|
||||
access_mail_vote_all,mail.vote.all,model_mail_vote,,1,1,1,1
|
||||
access_mail_favorite_all,mail.favorite.all,model_mail_favorite,,1,1,1,1
|
||||
access_mail_favorite_all,mail.favorite.all,model_mail_favorite,,1,1,1,1
|
||||
|
|
|
|
@ -5,6 +5,7 @@ openerp.mail = function (session) {
|
|||
var mail = session.mail = {};
|
||||
|
||||
openerp_mail_followers(session, mail); // import mail_followers.js
|
||||
openerp_FieldMany2ManyTagsEmail(session); // import manyy2many_tags_email.js
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------
|
||||
|
@ -1385,7 +1386,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 +1515,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 +1526,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 +1554,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 +1614,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 +1623,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'));
|
||||
|
@ -1628,7 +1631,22 @@ openerp.mail = function (session) {
|
|||
|
||||
bind_events: function () {
|
||||
var self=this;
|
||||
this.$(".oe_write_full").click(function(){ self.root.thread.compose_message.on_compose_fullmail(); });
|
||||
this.$(".oe_write_full").click(function (event) {
|
||||
event.stopPropagation();
|
||||
var action = {
|
||||
type: 'ir.actions.act_window',
|
||||
res_model: 'mail.compose.message',
|
||||
view_mode: 'form',
|
||||
view_type: 'form',
|
||||
action_from: 'mail.ThreadComposeMessage',
|
||||
views: [[false, 'form']],
|
||||
target: 'new',
|
||||
context: {
|
||||
'default_content_subtype': 'html',
|
||||
},
|
||||
};
|
||||
session.client.action_manager.do_action(action);
|
||||
});
|
||||
this.$(".oe_write_onwall").click(function(){ self.root.thread.on_compose_message(); });
|
||||
}
|
||||
});
|
||||
|
@ -1644,17 +1662,6 @@ openerp.mail = function (session) {
|
|||
session.web.ComposeMessageTopButton = session.web.Widget.extend({
|
||||
template:'mail.compose_message.button_top_bar',
|
||||
|
||||
init: function (parent, options) {
|
||||
this._super.apply(this, options);
|
||||
this.options = this.options || {};
|
||||
this.options.domain = this.options.domain || [];
|
||||
this.options.context = {
|
||||
'default_model': false,
|
||||
'default_res_id': 0,
|
||||
'default_content_subtype': 'html',
|
||||
};
|
||||
},
|
||||
|
||||
start: function (parent, params) {
|
||||
var self = this;
|
||||
this.$el.on('click', 'button', self.on_compose_message );
|
||||
|
@ -1671,11 +1678,11 @@ openerp.mail = function (session) {
|
|||
action_from: 'mail.ThreadComposeMessage',
|
||||
views: [[false, 'form']],
|
||||
target: 'new',
|
||||
context: _.extend(this.options.context, {
|
||||
'default_model': this.context.default_model,
|
||||
'default_res_id': this.context.default_res_id,
|
||||
context: {
|
||||
'default_model': '',
|
||||
'default_res_id': false,
|
||||
'default_content_subtype': 'html',
|
||||
}),
|
||||
},
|
||||
};
|
||||
session.client.action_manager.do_action(action);
|
||||
},
|
||||
|
|
|
@ -0,0 +1,88 @@
|
|||
openerp_FieldMany2ManyTagsEmail = function(instance) {
|
||||
var _t = instance.web._t;
|
||||
|
||||
/**
|
||||
* Extend of FieldMany2ManyTags widget method.
|
||||
* When the user add a partner and the partner don't have an email, open a popup to purpose to add an email.
|
||||
* The user can choose to add an email or cancel and close the popup.
|
||||
*/
|
||||
instance.web.form.FieldMany2ManyTagsEmail = instance.web.form.FieldMany2ManyTags.extend({
|
||||
|
||||
start: function() {
|
||||
this.values = [];
|
||||
this.values_checking = [];
|
||||
|
||||
this.on("change:value", this, this.on_change_value_check);
|
||||
this.trigger("change:value");
|
||||
|
||||
this._super.apply(this, arguments);
|
||||
},
|
||||
|
||||
on_change_value_check : function () {
|
||||
this.values = _.uniq(this.values);
|
||||
|
||||
// filter for removed values
|
||||
var values_removed = _.difference(this.values, this.get('value'));
|
||||
if (values_removed.length) {
|
||||
this.values = _.difference(this.values, values_removed);
|
||||
this.set({'value': this.values});
|
||||
return false;
|
||||
}
|
||||
|
||||
// find not checked values that are not currently on checking
|
||||
var not_checked = _.difference(this.get('value'), this.values, this.values_checking);
|
||||
if (not_checked.length) {
|
||||
// remember values on checking for cheked only one time
|
||||
this.values_checking = this.values_checking.concat(not_checked);
|
||||
// check values
|
||||
this._check_email_popup(not_checked);
|
||||
}
|
||||
},
|
||||
|
||||
_check_email_popup: function (ids) {
|
||||
var self = this;
|
||||
new instance.web.Model('res.partner').call("search", [[
|
||||
["id", "in", ids],
|
||||
["email", "=", false],
|
||||
["notification_email_send", "in", ['all', 'comment']] ]],
|
||||
{context: this.build_context()})
|
||||
.pipe(function (record_ids) {
|
||||
// valid partner
|
||||
var valid_partner = _.difference(ids, record_ids);
|
||||
self.values = self.values.concat(valid_partner);
|
||||
self.values_checking = _.difference(self.values_checking, valid_partner);
|
||||
|
||||
// unvalid partner
|
||||
_.each(record_ids, function (id) {
|
||||
var pop = new instance.web.form.FormOpenPopup(self);
|
||||
pop.show_element(
|
||||
'res.partner',
|
||||
id,
|
||||
self.build_context(),
|
||||
{
|
||||
title: _t("Please complete partner's informations and Email"),
|
||||
}
|
||||
);
|
||||
pop.on('write_completed', self, function () {
|
||||
this.values.push(id);
|
||||
this.values_checking = _.without(this.values_checking, id);
|
||||
this.set({'value': this.values});
|
||||
});
|
||||
pop.on('closed', self, function () {
|
||||
this.values_checking = _.without(this.values_checking, id);
|
||||
this.set({'value': this.values});
|
||||
});
|
||||
});
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* Registry of form fields
|
||||
*/
|
||||
instance.web.form.widgets = instance.web.form.widgets.extend({
|
||||
'many2many_tags_email' : 'instance.web.form.FieldMany2ManyTagsEmail',
|
||||
});
|
||||
|
||||
};
|
|
@ -547,7 +547,7 @@ class test_mail(TestMailMockups):
|
|||
|
||||
# 1. mass_mail on pigs and bird
|
||||
compose_id = mail_compose.create(cr, uid,
|
||||
{'subject': _subject, 'body': '${object.description}', 'content_subtype': 'html'},
|
||||
{'subject': _subject, 'body': '${object.description}'},
|
||||
{'default_composition_mode': 'mass_mail', 'default_model': 'mail.group', 'default_res_id': False,
|
||||
'active_ids': [self.group_pigs_id, group_bird_id]})
|
||||
compose = mail_compose.browse(cr, uid, compose_id)
|
||||
|
|
|
@ -186,17 +186,6 @@ class mail_compose_message(osv.TransientModel):
|
|||
"""
|
||||
return {'value': {'content_subtype': value}}
|
||||
|
||||
def onchange_partner_ids(self, cr, uid, ids, value, context=None):
|
||||
""" The basic purpose of this method is to check that destination partners
|
||||
effectively have email addresses. Otherwise a warning is thrown.
|
||||
:param value: value format: [[6, 0, [3, 4]]]
|
||||
"""
|
||||
res = {'value': {}}
|
||||
if not value or not value[0] or not value[0][0] == 6:
|
||||
return
|
||||
res.update(self.check_partners_email(cr, uid, value[0][2], context=context))
|
||||
return res
|
||||
|
||||
def dummy(self, cr, uid, ids, context=None):
|
||||
""" TDE: defined to have buttons that do basically nothing. It is
|
||||
currently impossible to have buttons that do nothing special
|
||||
|
|
|
@ -14,9 +14,8 @@
|
|||
<field name="parent_id" invisible="1"/>
|
||||
<field name="content_subtype" invisible="1"/>
|
||||
<!-- visible wizard -->
|
||||
<field name="partner_ids" widget="many2many_tags" placeholder="Add contacts to notify..."
|
||||
context="{'force_email':True}"
|
||||
on_change="onchange_partner_ids(partner_ids)" required="1"/>
|
||||
<field name="partner_ids" widget="many2many_tags_email" placeholder="Add contacts to notify..."
|
||||
context="{'force_email':True}" required="1"/>
|
||||
<field name="subject" placeholder="Subject..."
|
||||
attrs="{'invisible':[('content_subtype', '=', 'plain')]}"/>
|
||||
</group>
|
||||
|
|
|
@ -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}: |
|
||||
|
|
|
@ -59,18 +59,18 @@
|
|||
|
||||
<div t-attf-class="oe_kanban_color_#{kanban_getcolor(record.color.raw_value)} oe_kanban_global_click_edit oe_semantic_html_override oe_kanban_card #{record.group_fancy==1 ? 'oe_kanban_card_fancy' : ''}">
|
||||
<div class="oe_dropdown_kanban">
|
||||
<span>
|
||||
<a name="onclick_note_is_done" type="object" t-if="record.open.raw_value" class="oe_e">W</a>
|
||||
<a name="onclick_note_not_done" type="object" t-if="!record.open.raw_value" class="oe_e">W</a>
|
||||
</span>
|
||||
|
||||
<!-- dropdown menu -->
|
||||
<div class="oe_dropdown_toggle">
|
||||
<span class="oe_dropdown_toggle">
|
||||
<span class="oe_e">í</span>
|
||||
<ul class="oe_dropdown_menu">
|
||||
<li><a type="delete">Delete</a></li>
|
||||
<li><ul class="oe_kanban_colorpicker" data-field="color"/></li>
|
||||
</ul>
|
||||
</span>
|
||||
<div style="display: inline">
|
||||
<a name="onclick_note_is_done" type="object" t-if="record.open.raw_value" class="oe_e">W</a>
|
||||
<a name="onclick_note_not_done" type="object" t-if="!record.open.raw_value" class="oe_e">W</a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- kanban note -->
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
.openerp .oe_kanban_record .oe_kanban_card_fancy {
|
||||
text-shadow: none;
|
||||
border-radius: 2px;
|
||||
padding: 12px;
|
||||
padding: 8px;
|
||||
margin-left: 3px;
|
||||
margin-right: 3px;
|
||||
padding-bottom: 16px;
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
.oe_kanban_card_fancy
|
||||
text-shadow: none
|
||||
border-radius: 2px
|
||||
padding: 12px
|
||||
padding: 8px
|
||||
margin-left: 3px
|
||||
margin-right: 3px
|
||||
padding-bottom: 16px
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -197,6 +197,12 @@ class procurement_order(osv.osv):
|
|||
'location_id': orderpoint.location_id.id,
|
||||
'procure_method': 'make_to_order',
|
||||
'origin': orderpoint.name}
|
||||
|
||||
def _product_virtual_get(self, cr, uid, order_point):
|
||||
location_obj = self.pool.get('stock.location')
|
||||
return location_obj._product_virtual_get(cr, uid,
|
||||
order_point.location_id.id, [order_point.product_id.id],
|
||||
{'uom': order_point.product_uom.id})[order_point.product_id.id]
|
||||
|
||||
def _procure_orderpoint_confirm(self, cr, uid, automatic=False,\
|
||||
use_new_cursor=False, context=None, user_id=False):
|
||||
|
@ -217,7 +223,7 @@ class procurement_order(osv.osv):
|
|||
if use_new_cursor:
|
||||
cr = pooler.get_db(use_new_cursor).cursor()
|
||||
orderpoint_obj = self.pool.get('stock.warehouse.orderpoint')
|
||||
location_obj = self.pool.get('stock.location')
|
||||
|
||||
procurement_obj = self.pool.get('procurement.order')
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
offset = 0
|
||||
|
@ -227,14 +233,9 @@ class procurement_order(osv.osv):
|
|||
while ids:
|
||||
ids = orderpoint_obj.search(cr, uid, [], offset=offset, limit=100)
|
||||
for op in orderpoint_obj.browse(cr, uid, ids, context=context):
|
||||
if op.procurement_id.state != 'exception':
|
||||
if op.procurement_id and hasattr(op.procurement_id, 'purchase_id'):
|
||||
if op.procurement_id.purchase_id.state in ('draft', 'confirmed'):
|
||||
continue
|
||||
prods = location_obj._product_virtual_get(cr, uid,
|
||||
op.location_id.id, [op.product_id.id],
|
||||
{'uom': op.product_uom.id})[op.product_id.id]
|
||||
|
||||
prods = self._product_virtual_get(cr, uid, op)
|
||||
if prods is None:
|
||||
continue
|
||||
if prods < op.product_min_qty:
|
||||
qty = max(op.product_min_qty, op.product_max_qty)-prods
|
||||
|
||||
|
|
|
@ -96,7 +96,6 @@
|
|||
<field name="type">consu</field>
|
||||
<field name="uom_id" ref="product_uom_unit"/>
|
||||
<field name="uom_po_id" ref="product_uom_unit"/>
|
||||
<field name="sale_delay">4.0</field>
|
||||
<field name="description_sale">17" LCD Monitor
|
||||
Processor AMD 8-Core
|
||||
512MB RAM
|
||||
|
@ -113,7 +112,6 @@ HDD SH-1</field>
|
|||
|
||||
<field name="uom_id" ref="product_uom_unit"/>
|
||||
<field name="uom_po_id" ref="product_uom_unit"/>
|
||||
<field name="sale_delay">4.0</field>
|
||||
<field name="description_sale">19" LCD Monitor
|
||||
Processor Core i5 2.70 Ghz
|
||||
2GB RAM
|
||||
|
@ -129,7 +127,6 @@ HDD SH-1</field>
|
|||
<field name="type">consu</field>
|
||||
<field name="uom_id" ref="product_uom_unit"/>
|
||||
<field name="uom_po_id" ref="product_uom_unit"/>
|
||||
<field name="sale_delay">7.0</field>
|
||||
<field name="description">Custom computer assembled on order based on customer's requirement.</field>
|
||||
</record>
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1105,6 +1105,12 @@ class procurement_order(osv.osv):
|
|||
self.write(cr, uid, [procurement.id], {'state': 'running', 'purchase_id': res[procurement.id]})
|
||||
self.purchase_order_create_note(cr, uid, ids, context=context)
|
||||
return res
|
||||
|
||||
def _product_virtual_get(self, cr, uid, order_point):
|
||||
procurement = order_point.procurement_id
|
||||
if procurement and procurement.state != 'exception' and procurement.purchase_id and procurement.purchase_id.state in ('draft', 'confirmed'):
|
||||
return None
|
||||
return super(procurement_order, self)._product_virtual_get(cr, uid, order_point)
|
||||
|
||||
def purchase_order_create_note(self, cr, uid, ids, context=None):
|
||||
for procurement in self.browse(cr, uid, ids, context=context):
|
||||
|
|
|
@ -4,5 +4,4 @@
|
|||
I duplicate order.
|
||||
-
|
||||
!python {model: purchase.order}: |
|
||||
context.update({'active_id':ref('purchase_order_1')})
|
||||
self.copy(cr, uid, ref('purchase_order_1'), context)
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
<field name="name">sale.report.tree.sale.stock</field>
|
||||
<field name="model">sale.report</field>
|
||||
<field name="inherit_id" ref="sale.view_order_product_tree"/>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<field name="product_uom_qty" position="after">
|
||||
<field name="shipped_qty_1" sum="Shipped"/>
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
<record id="view_sales_config_sale_stock" model="ir.ui.view">
|
||||
<field name="name">sale settings</field>
|
||||
<field name="model">sale.config.settings</field>
|
||||
<field name="type">form</field>
|
||||
<field name="inherit_id" ref="sale.view_sales_config"/>
|
||||
<field name="arch" type="xml">
|
||||
<data>
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
<field name="name">sale.shop.sale.stock</field>
|
||||
<field name="model">sale.shop</field>
|
||||
<field name="inherit_id" ref="sale.view_shop_tree"/>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<field name="name" position="after">
|
||||
<field name="warehouse_id"/>
|
||||
|
@ -32,7 +31,6 @@
|
|||
<field name="name">sale.order.form.sale.stock</field>
|
||||
<field name="model">sale.order</field>
|
||||
<field name="inherit_id" ref="sale.view_order_form"/>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<data>
|
||||
<xpath expr="//button[@name='invoice_corrected']" position="after">
|
||||
|
|
|
@ -2130,7 +2130,7 @@ class stock_move(osv.osv):
|
|||
new_id = move_obj.copy(cr, uid, move.id, {
|
||||
'location_id': move.location_dest_id.id,
|
||||
'location_dest_id': loc.id,
|
||||
'date_moved': time.strftime('%Y-%m-%d'),
|
||||
'date': time.strftime('%Y-%m-%d'),
|
||||
'picking_id': pickid,
|
||||
'state': 'waiting',
|
||||
'company_id': company_id or res_obj._company_default_get(cr, uid, 'stock.company', context=context) ,
|
||||
|
|
Loading…
Reference in New Issue