diff options
| author | Christophe Simonis <chs@odoo.com> | 2019-02-11 12:47:52 +0100 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2019-02-11 12:47:52 +0100 |
| commit | 75eec26da39614b4749ae84e588af0a0b29ddaa0 (patch) | |
| tree | 075cfe4562bf5e0afd14001aa31287e73f49dfba /addons | |
| parent | b6d62f8ce38774fcffd94ee8450ae570def8e900 (diff) | |
| parent | 728bb2a28ec84514e3fd63a3732822ed34c028a8 (diff) | |
[MERGE] forward port branch saas-11.3 up to 728bb2a28ec
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/account/models/account_analytic_line.py | 2 | ||||
| -rw-r--r-- | addons/fleet/models/fleet_vehicle.py | 2 | ||||
| -rw-r--r-- | addons/l10n_fr_fec/wizard/account_fr_fec.py | 2 | ||||
| -rw-r--r-- | addons/mrp/models/mrp_production.py | 2 | ||||
| -rw-r--r-- | addons/payment_authorize/controllers/main.py | 13 | ||||
| -rw-r--r-- | addons/purchase/i18n/purchase.pot | 5 | ||||
| -rw-r--r-- | addons/purchase/models/purchase.py | 10 | ||||
| -rw-r--r-- | addons/sale_mrp/models/sale_mrp.py | 2 | ||||
| -rw-r--r-- | addons/web/static/tests/views/calendar_tests.js | 1 | ||||
| -rw-r--r-- | addons/web_editor/static/src/js/editor/snippets.editor.js | 24 | ||||
| -rw-r--r-- | addons/web_editor/static/src/scss/web_editor.ui.scss | 4 |
11 files changed, 50 insertions, 17 deletions
diff --git a/addons/account/models/account_analytic_line.py b/addons/account/models/account_analytic_line.py index 85156bcaf48..92e3dc6c973 100644 --- a/addons/account/models/account_analytic_line.py +++ b/addons/account/models/account_analytic_line.py @@ -33,7 +33,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 040b92200a7..4b9d16d819b 100644 --- a/addons/fleet/models/fleet_vehicle.py +++ b/addons/fleet/models/fleet_vehicle.py @@ -15,7 +15,7 @@ class FleetVehicle(models.Model): def _get_default_state(self): state = self.env.ref('fleet.fleet_vehicle_state_registered', 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/l10n_fr_fec/wizard/account_fr_fec.py b/addons/l10n_fr_fec/wizard/account_fr_fec.py index be79824967a..c606ce0972c 100644 --- a/addons/l10n_fr_fec/wizard/account_fr_fec.py +++ b/addons/l10n_fr_fec/wizard/account_fr_fec.py @@ -264,7 +264,7 @@ class AccountFrFec(models.TransientModel): for row in self._cr.fetchall(): listrow = list(row) account_id = listrow.pop() - w.writerow([s.encode("utf-8") for s in listrow]) + w.writerow(listrow) # LINES sql_query = ''' diff --git a/addons/mrp/models/mrp_production.py b/addons/mrp/models/mrp_production.py index f9e7f2ccce4..7f8dba13c88 100644 --- a/addons/mrp/models/mrp_production.py +++ b/addons/mrp/models/mrp_production.py @@ -502,7 +502,7 @@ class MrpProduction(models.Model): move[0].with_context(do_not_unreserve=True).write({'product_uom_qty': quantity}) move[0]._recompute_state() move[0]._action_assign() - move.unit_factor = quantity / move.raw_material_production_id.product_qty + move[0].unit_factor = quantity / move[0].raw_material_production_id.product_qty elif quantity < 0: # Do not remove 0 lines if move[0].quantity_done > 0: raise UserError(_('Lines need to be deleted, but can not as you still have some quantities to consume in them. ')) diff --git a/addons/payment_authorize/controllers/main.py b/addons/payment_authorize/controllers/main.py index dd8d96f6e90..70d641564a6 100644 --- a/addons/payment_authorize/controllers/main.py +++ b/addons/payment_authorize/controllers/main.py @@ -84,13 +84,14 @@ class AuthorizeController(http.Controller): 'id': token.id, 'short_name': token.short_name, '3d_secure': False, - 'verified': False, + 'verified': True, #Authorize.net does a transaction type of Authorization Only + #As Authorize.net already verify this card, we do not verify this card again. } - - if verify_validity != False: - token.validate() - res['verified'] = token.verified - + #token.validate() don't work with Authorize.net. + #Payments made via Authorize.net are settled and allowed to be refunded only on the next day. + #https://account.authorize.net/help/Miscellaneous/FAQ/Frequently_Asked_Questions.htm#Refund + #<quote>The original transaction that you wish to refund must have a status of Settled Successfully. + #You cannot issue refunds against unsettled, voided, declined or errored transactions.</quote> return res @http.route(['/payment/authorize/s2s/create'], type='http', auth='public') diff --git a/addons/purchase/i18n/purchase.pot b/addons/purchase/i18n/purchase.pot index 6b748f91560..47a43e42f05 100644 --- a/addons/purchase/i18n/purchase.pot +++ b/addons/purchase/i18n/purchase.pot @@ -85,6 +85,11 @@ msgid "<div style=\"margin: 0px; padding: 0px;\">\n" " Best regards,\n" " </p>\n" "</div>" +"<p style=\"color:#888888;\">\n" +"% if object.sudo().create_uid and object.sudo().create_uid.signature:\n" +" ${object.sudo().create_uid.signature | safe}\n" +"% endif\n" +"</p>\n" msgstr "" #. module: purchase diff --git a/addons/purchase/models/purchase.py b/addons/purchase/models/purchase.py index f44e04fd70b..388abaf0b0d 100644 --- a/addons/purchase/models/purchase.py +++ b/addons/purchase/models/purchase.py @@ -369,6 +369,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/sale_mrp/models/sale_mrp.py b/addons/sale_mrp/models/sale_mrp.py index 06a43667f9a..d7738367ef7 100644 --- a/addons/sale_mrp/models/sale_mrp.py +++ b/addons/sale_mrp/models/sale_mrp.py @@ -16,7 +16,7 @@ class SaleOrderLine(models.Model): if line.qty_delivered_method == 'stock_move': # In the case of a kit, we need to check if all components are shipped. Since the BOM might # have changed, we don't compute the quantities but verify the move state. - bom = self.env['mrp.bom']._bom_find(product=line.product_id) + bom = self.env['mrp.bom']._bom_find(product=line.product_id, company_id=line.company_id.id) if bom and bom.type == 'phantom': moves = line.move_ids.filtered(lambda m: m.picking_id and m.picking_id.state != 'cancel') bom_delivered = all([move.state == 'done' for move in moves]) diff --git a/addons/web/static/tests/views/calendar_tests.js b/addons/web/static/tests/views/calendar_tests.js index a8008b97207..e11244d482c 100644 --- a/addons/web/static/tests/views/calendar_tests.js +++ b/addons/web/static/tests/views/calendar_tests.js @@ -7,6 +7,7 @@ var Dialog = require('web.Dialog'); var fieldUtils = require('web.field_utils'); var mixins = require('web.mixins'); var testUtils = require('web.test_utils'); +var time = require('web.time'); var session = require('web.session'); var createActionManager = testUtils.createActionManager; 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 7ca077907a8..4a9e6cb91d6 100644 --- a/addons/web_editor/static/src/js/editor/snippets.editor.js +++ b/addons/web_editor/static/src/js/editor/snippets.editor.js @@ -665,6 +665,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); @@ -685,7 +689,10 @@ var SnippetsMenu = Widget.extend({ display: 'inline-block', }); } else if (float === 'left' || float === 'right' || (parentDisplay === 'flex' && parentFlex === 'row')) { - $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(); @@ -700,7 +707,10 @@ var SnippetsMenu = Widget.extend({ display: 'inline-block' }); } else if (float === 'left' || float === 'right' || (parentDisplay === 'flex' && parentFlex === 'row')) { - $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'}); @@ -724,14 +734,20 @@ var SnippetsMenu = Widget.extend({ if ($zone.prev('.oe_drop_zone:visible').length === 0) { $drop = zone_template.clone(); if (float === 'left' || float === 'right' || (parentDisplay === 'flex' && parentFlex === 'row')) { - $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' || (parentDisplay === 'flex' && parentFlex === 'row')) { - $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/scss/web_editor.ui.scss b/addons/web_editor/static/src/scss/web_editor.ui.scss index e08771a18a8..38f4a92112d 100644 --- a/addons/web_editor/static/src/scss/web_editor.ui.scss +++ b/addons/web_editor/static/src/scss/web_editor.ui.scss @@ -276,12 +276,12 @@ html[lang] > body.editor_enable [data-oe-translation-state] { } &.oe_vertical { - border: 2px dashed $o-brand-odoo; + border: $o-we-dropzone-border; border-left: none; border-right: none; width: $o-we-dropzone-size; - float: left; + height: 100%; margin: 0 (-$o-we-dropzone-size/2); &:after { |
