diff --git a/addons/mail/__openerp__.py b/addons/mail/__openerp__.py index 1b9111d3040..59d2e5f81ee 100644 --- a/addons/mail/__openerp__.py +++ b/addons/mail/__openerp__.py @@ -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', ], } diff --git a/addons/mail/static/src/css/announcement.css b/addons/mail/static/src/css/announcement.css new file mode 100644 index 00000000000..5d2a0ecba44 --- /dev/null +++ b/addons/mail/static/src/css/announcement.css @@ -0,0 +1,3 @@ +.openerp .annoucement_bar { + display: none; +} diff --git a/addons/mail/static/src/js/announcement.js b/addons/mail/static/src/js/announcement.js new file mode 100644 index 00000000000..0dd438d13af --- /dev/null +++ b/addons/mail/static/src/js/announcement.js @@ -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 = $('').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); + }); + } + }); +}; diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index 91091b25057..748d3d19f2d 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -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); /** * ------------------------------------------------------------ diff --git a/addons/mail/static/src/xml/announcement.xml b/addons/mail/static/src/xml/announcement.xml new file mode 100644 index 00000000000..84dfa426796 --- /dev/null +++ b/addons/mail/static/src/xml/announcement.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/addons/mrp/report/price.py b/addons/mrp/report/price.py index 5afd6b3ee49..ff3d5ff5c56 100644 --- a/addons/mrp/report/price.py +++ b/addons/mrp/report/price.py @@ -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 += '- '+ to_xml(seller_id.name.name) +'\r\n' pricelist = seller_id.name.property_product_pricelist_purchase price = pricelist_pool.price_get(cr,uid,[pricelist.id], diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index 144f672469e..fec66d0d602 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -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) diff --git a/addons/purchase/stock.py b/addons/purchase/stock.py index be4169c4624..7671c4b3d86 100644 --- a/addons/purchase/stock.py +++ b/addons/purchase/stock.py @@ -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: