diff --git a/addons/account/models/account_analytic_line.py b/addons/account/models/account_analytic_line.py index 1d212d31bf8..c6337718333 100644 --- a/addons/account/models/account_analytic_line.py +++ b/addons/account/models/account_analytic_line.py @@ -44,7 +44,7 @@ class AccountAnalyticLine(models.Model): # Compute based on pricetype amount_unit = self.product_id.price_compute('standard_price', uom=unit)[self.product_id.id] amount = amount_unit * self.unit_amount or 0.0 - result = self.currency_id.round(amount) * -1 + result = (self.currency_id.round(amount) if self.currency_id else round(amount, 2)) * -1 self.amount = result self.general_account_id = account self.product_uom_id = unit diff --git a/addons/fleet/models/fleet_vehicle.py b/addons/fleet/models/fleet_vehicle.py index 82e30ff829a..66bb600afc5 100644 --- a/addons/fleet/models/fleet_vehicle.py +++ b/addons/fleet/models/fleet_vehicle.py @@ -14,7 +14,7 @@ class FleetVehicle(models.Model): def _get_default_state(self): state = self.env.ref('fleet.vehicle_state_active', raise_if_not_found=False) - return state and state.id or False + return state if state and state.id else False name = fields.Char(compute="_compute_vehicle_name", store=True) active = fields.Boolean('Active', default=True, track_visibility="onchange") diff --git a/addons/purchase/models/purchase.py b/addons/purchase/models/purchase.py index 8962513fd02..7f746436258 100644 --- a/addons/purchase/models/purchase.py +++ b/addons/purchase/models/purchase.py @@ -460,6 +460,16 @@ class PurchaseOrder(models.Model): 'currency_id': currency.id, 'delay': 0, } + # In case the order partner is a contact address, a new supplierinfo is created on + # the parent company. In this case, we keep the product name and code. + seller = line.product_id._select_seller( + partner_id=line.partner_id, + quantity=line.product_qty, + date=line.order_id.date_order and line.order_id.date_order[:10], + uom_id=line.product_uom) + if seller: + supplierinfo['product_name'] = seller.product_name + supplierinfo['product_code'] = seller.product_code vals = { 'seller_ids': [(0, 0, supplierinfo)], } diff --git a/addons/stock/models/stock_picking.py b/addons/stock/models/stock_picking.py index 47e0fcceaec..23222bedbf3 100644 --- a/addons/stock/models/stock_picking.py +++ b/addons/stock/models/stock_picking.py @@ -245,7 +245,8 @@ class Picking(models.Model): picking_type_id = fields.Many2one( 'stock.picking.type', 'Operation Type', required=True, - states={'done': [('readonly', True)], 'cancel': [('readonly', True)]}) + readonly=True, + states={'draft': [('readonly', False)]}) picking_type_code = fields.Selection([ ('incoming', 'Vendors'), ('outgoing', 'Customers'), diff --git a/addons/web_editor/static/src/js/editor/snippets.editor.js b/addons/web_editor/static/src/js/editor/snippets.editor.js index bc3438f6bb7..fd6d74b6166 100644 --- a/addons/web_editor/static/src/js/editor/snippets.editor.js +++ b/addons/web_editor/static/src/js/editor/snippets.editor.js @@ -652,6 +652,10 @@ var SnippetsMenu = Widget.extend({ class: 'oe_drop_zone oe_insert', }); + function isFullWidth($elem) { + return $elem.parent().width() === $elem.outerWidth(true); + } + if ($selectorChildren) { $selectorChildren.each(function () { var $zone = $(this); @@ -669,7 +673,10 @@ var SnippetsMenu = Widget.extend({ display: 'inline-block', }); } else if (float === 'left' || float === 'right') { - $drop.addClass('oe_vertical').css('height', Math.max(Math.min($zone.outerHeight(), $zone.children().last().outerHeight()), 30)); + $drop.css('float', float); + if (!isFullWidth($zone)) { + $drop.addClass('oe_vertical').css('height', Math.max(Math.min($zone.outerHeight(), $zone.children().last().outerHeight()), 30)); + } } $drop = $drop.clone(); @@ -684,7 +691,10 @@ var SnippetsMenu = Widget.extend({ display: 'inline-block' }); } else if (float === 'left' || float === 'right') { - $drop.addClass('oe_vertical').css('height', Math.max(Math.min($zone.outerHeight(), $zone.children().first().outerHeight()), 30)); + $drop.css('float', float); + if (!isFullWidth($zone)) { + $drop.addClass('oe_vertical').css('height', Math.max(Math.min($zone.outerHeight(), $zone.children().first().outerHeight()), 30)); + } } if (test) { $drop.css({'float': 'none', 'display': 'inline-block'}); @@ -705,14 +715,20 @@ var SnippetsMenu = Widget.extend({ if ($zone.prev('.oe_drop_zone:visible').length === 0) { $drop = zone_template.clone(); if (float === 'left' || float === 'right') { - $drop.addClass('oe_vertical').css('height', Math.max(Math.min($zone.outerHeight(), $zone.prev().outerHeight() || Infinity), 30)); + $drop.css('float', float); + if (!isFullWidth($zone)) { + $drop.addClass('oe_vertical').css('height', Math.max(Math.min($zone.outerHeight(), $zone.prev().outerHeight() || Infinity), 30)); + } } $zone.before($drop); } if ($zone.next('.oe_drop_zone:visible').length === 0) { $drop = zone_template.clone(); if (float === 'left' || float === 'right') { - $drop.addClass('oe_vertical').css('height', Math.max(Math.min($zone.outerHeight(), $zone.next().outerHeight() || Infinity), 30)); + $drop.css('float', float); + if (!isFullWidth($zone)) { + $drop.addClass('oe_vertical').css('height', Math.max(Math.min($zone.outerHeight(), $zone.next().outerHeight() || Infinity), 30)); + } } $zone.after($drop); } diff --git a/addons/web_editor/static/src/less/web_editor.ui.less b/addons/web_editor/static/src/less/web_editor.ui.less index d4ced130b9f..94de4ef4702 100644 --- a/addons/web_editor/static/src/less/web_editor.ui.less +++ b/addons/web_editor/static/src/less/web_editor.ui.less @@ -279,12 +279,12 @@ html[lang] > body.editor_enable [data-oe-translation-state] { } &.oe_vertical { - border: 2px dashed @odoo-brand-primary; + border: @odoo-dropzone-border; border-left: none; border-right: none; width: @odoo-dropzone-size; - float: left; + height: 100%; margin: 0 -@odoo-dropzone-size/2; &:after {