[MERGE] Forward-port of latest 7.0 bugfixes, up to rev. 9691 rev-id: dle@openerp.com-20131211134120-fco4rlqjh258ba36
bzr revid: dle@openerp.com-20131210184409-cd9wy856v5bg0f17 bzr revid: dle@openerp.com-20131211134317-f0ev1vbinhrkgjf4
This commit is contained in:
commit
7f00274384
|
@ -81,16 +81,19 @@ Main Features
|
|||
'css': [
|
||||
'static/src/css/mail.css',
|
||||
'static/src/css/mail_group.css',
|
||||
'static/src/css/announcement.css',
|
||||
],
|
||||
'js': [
|
||||
'static/src/js/mail.js',
|
||||
'static/src/js/mail_followers.js',
|
||||
'static/src/js/many2many_tags_email.js',
|
||||
'static/src/js/announcement.js',
|
||||
'static/src/js/suggestions.js',
|
||||
],
|
||||
'qweb': [
|
||||
'static/src/xml/mail.xml',
|
||||
'static/src/xml/mail_followers.xml',
|
||||
'static/src/xml/announcement.xml',
|
||||
'static/src/xml/suggestions.xml',
|
||||
],
|
||||
}
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
.openerp .annoucement_bar {
|
||||
display: none;
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
openerp_announcement = function(instance) {
|
||||
instance.web.WebClient.include({
|
||||
show_application: function() {
|
||||
return $.when(this._super.apply(this, arguments)).then(this.proxy('show_annoucement_bar'));
|
||||
},
|
||||
_ab_location: function(dbuuid) {
|
||||
return _.str.sprintf('https://services.openerp.com/openerp-enterprise/ab/css/%s.css', dbuuid);
|
||||
},
|
||||
show_annoucement_bar: function() {
|
||||
if (this.session.get_cookie('ab') === 'c') {
|
||||
return;
|
||||
}
|
||||
var self = this;
|
||||
var config_parameter = new instance.web.Model('ir.config_parameter');
|
||||
var $bar = this.$el.find('.announcement_bar');
|
||||
return config_parameter.call('get_param', ['database.uuid', false]).then(function(dbuuid) {
|
||||
if (!dbuuid) {
|
||||
return;
|
||||
}
|
||||
var $link = $bar.find('.url a');
|
||||
$link.attr('href', _.str.sprintf('%s/%s', $link.attr('href'), dbuuid));
|
||||
var $css = $('<link />').attr({
|
||||
rel : 'stylesheet',
|
||||
type: 'text/css',
|
||||
media: 'screen',
|
||||
href: self._ab_location(dbuuid)
|
||||
});
|
||||
$css.on('load', function() {
|
||||
var close = function() {
|
||||
var ttl = 7*24*60*60;
|
||||
self.session.set_cookie('ab', 'c', ttl);
|
||||
$bar.slideUp('slow');
|
||||
};
|
||||
$bar.find('.close').on('click', close);
|
||||
self.trigger('ab_loaded', $bar);
|
||||
});
|
||||
|
||||
$('head').append($css);
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
|
@ -6,6 +6,7 @@ openerp.mail = function (session) {
|
|||
|
||||
openerp_mail_followers(session, mail); // import mail_followers.js
|
||||
openerp_FieldMany2ManyTagsEmail(session); // import manyy2many_tags_email.js
|
||||
openerp_announcement(session);
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<templates id="template" xml:space="preserve">
|
||||
<t t-extend="WebClient">
|
||||
<t t-jquery="table.oe_webclient" t-operation="prepend">
|
||||
<td colspan="2" class="announcement_bar">
|
||||
<span class="message"></span>
|
||||
<span class="url"><a href="https://services.openerp.com/openerp-enterprise/ab/register" target="_blank"></a></span>
|
||||
<span class="close"></span>
|
||||
</td>
|
||||
</t>
|
||||
</t>
|
||||
</templates>
|
|
@ -70,6 +70,8 @@ class report_custom(report_rml):
|
|||
main_strd_price = str(std_price) + '\r\n'
|
||||
sum_strd = prod_qtty*std_price
|
||||
for seller_id in prod.seller_ids:
|
||||
if seller_id.name.id == prod.seller_id.id:
|
||||
continue
|
||||
sellers += '- <i>'+ to_xml(seller_id.name.name) +'</i>\r\n'
|
||||
pricelist = seller_id.name.property_product_pricelist_purchase
|
||||
price = pricelist_pool.price_get(cr,uid,[pricelist.id],
|
||||
|
|
|
@ -714,13 +714,14 @@ class pos_order(osv.osv):
|
|||
}, context=context)
|
||||
self.write(cr, uid, [order.id], {'picking_id': picking_id}, context=context)
|
||||
location_id = order.warehouse_id.lot_stock_id.id
|
||||
output_id = order.warehouse_id.lot_output_id.id
|
||||
if order.partner_id:
|
||||
destination_id = order.partner_id.property_stock_customer.id
|
||||
else:
|
||||
destination_id = partner_obj.default_get(cr, uid, ['property_stock_customer'], context=context)['property_stock_customer']
|
||||
|
||||
for line in order.lines:
|
||||
if line.product_id and line.product_id.type == 'service':
|
||||
continue
|
||||
if line.qty < 0:
|
||||
location_id, output_id = output_id, location_id
|
||||
|
||||
move_obj.create(cr, uid, {
|
||||
'name': line.name,
|
||||
|
@ -732,11 +733,9 @@ class pos_order(osv.osv):
|
|||
'product_qty': abs(line.qty),
|
||||
'tracking_id': False,
|
||||
'state': 'draft',
|
||||
'location_id': location_id,
|
||||
'location_dest_id': output_id,
|
||||
'location_id': location_id if line.qty >= 0 else destination_id,
|
||||
'location_dest_id': destination_id if line.qty >= 0 else location_id,
|
||||
}, context=context)
|
||||
if line.qty < 0:
|
||||
location_id, output_id = output_id, location_id
|
||||
|
||||
picking_obj.signal_button_confirm(cr, uid, [picking_id])
|
||||
picking_obj.force_assign(cr, uid, [picking_id], context)
|
||||
|
|
|
@ -140,6 +140,6 @@ class stock_picking_in(osv.osv):
|
|||
_columns = {
|
||||
'purchase_id': fields.many2one('purchase.order', 'Purchase Order',
|
||||
ondelete='set null', select=True),
|
||||
'warehouse_id': fields.related('purchase_id', 'warehouse_id', type='many2one', relation='stock.warehouse', string='Destination Warehouse'),
|
||||
'warehouse_id': fields.related('purchase_id', 'warehouse_id', type='many2one', relation='stock.warehouse', string='Destination Warehouse', readonly=True),
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
Loading…
Reference in New Issue