[MERGE] from trunk
bzr revid: chm@openerp.com-20121106191838-7zzmofieztf07vx8
This commit is contained in:
commit
fff47322d4
|
@ -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
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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
|
@ -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
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------
|
||||
|
@ -1630,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(); });
|
||||
}
|
||||
});
|
||||
|
@ -1646,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 );
|
||||
|
@ -1673,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,8 +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..."
|
||||
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>
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
|
|
@ -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