[PATCH] Upstream patch - 23122022

This commit is contained in:
Parthiv Patel
2022-12-23 08:36:08 +00:00
parent 66895c0658
commit ddae1a976e
5 changed files with 26 additions and 0 deletions

View File

@@ -14,6 +14,7 @@ flectra.define('pos_restaurant.PrintBillButton', function(require) {
async onClick() {
const order = this.env.pos.get_order();
if (order.get_orderlines().length > 0) {
order.initialize_validation_date();
await this.showTempScreen('BillScreen');
} else {
await this.showPopup('ErrorPopup', {

View File

@@ -1832,6 +1832,17 @@ var SnippetsMenu = Widget.extend({
var selector = $style.data('selector');
var exclude = $style.data('exclude') || '';
const excludeParent = $style.attr('id') === "so_content_addition" ? snippetAdditionDropIn : '';
// TODO to remove in master: the Carousel snippet has a `content`
// class in its `.row` elements which makes dropzones appear when
// dragging inner content, allowing them to be dropped in the row,
// where it should not be the case.
if ($style[0].getAttribute('id') === 'so_content_addition') {
let dropInPatch = $style[0].dataset.dropIn.split(', ');
dropInPatch = dropInPatch.map(selector => selector === '.content' ? '.content:not(.row)' : selector);
$style[0].dataset.dropIn = dropInPatch.join(', ');
}
var target = $style.data('target');
var noCheck = $style.data('no-check');
var optionID = $style.data('js') || $style.data('option-name'); // used in tour js as selector

View File

@@ -11,6 +11,9 @@
<li data-target="#myCarousel" data-slide-to="2"/>
</ol>
<!-- Content -->
<!-- TODO in master: remove the `content` classes in the div with
the class `row`, to avoid having unwanted dropzones when
dragging inner content. -->
<div class="carousel-inner">
<!-- #01 -->
<div class="carousel-item active oe_img_bg pt152 pb152" style="background-image: url('/web/image/website.s_carousel_default_image_1');" data-name="Slide">

View File

@@ -506,6 +506,8 @@
t-att-data-selector="so_content_addition_selector"
t-attf-data-drop-near="p, h1, h2, h3, .row > div > img, #{so_content_addition_selector}"
data-drop-in=".content, nav"/>
<!-- TODO in master: remove the `.content` above, as it will not refer to
anything when the `content` classes in carousel will be removed. -->
<div data-js="SnippetSave"
t-attf-data-selector="#{so_snippet_addition_selector}, #{so_content_addition_selector}"

View File

@@ -7,6 +7,7 @@ import json
from flectra import models, api, fields, _
from flectra.exceptions import UserError
from flectra.http import request
from flectra.tools.sql import column_exists, create_column
class WebsiteVisitor(models.Model):
@@ -18,6 +19,14 @@ class WebsiteVisitor(models.Model):
string="Visitor's livechat channels", readonly=True)
session_count = fields.Integer('# Sessions', compute="_compute_session_count")
def _auto_init(self):
# Skip the computation of the field `livechat_operator_id` at the module installation
# We can assume no livechat operator attributed to visitor if it was not installed
if not column_exists(self.env.cr, "website_visitor", "livechat_operator_id"):
create_column(self.env.cr, "website_visitor", "livechat_operator_id", "int4")
return super()._auto_init()
@api.depends('mail_channel_ids.livechat_active', 'mail_channel_ids.livechat_operator_id')
def _compute_livechat_operator_id(self):
results = self.env['mail.channel'].search_read(