[MERGE] forward port branch 11.0 up to 4231103cc9

This commit is contained in:
Christophe Simonis
2019-03-28 18:17:20 +01:00
8 changed files with 81 additions and 20 deletions
@@ -45,7 +45,7 @@
<template id="portal_invoice_page_inherit_payment" name="Payment on My Invoices" inherit_id="account.portal_invoice_page">
<xpath expr="//div[@id='o_portal_account_actions']/a" position="before">
<t t-set="tx_ids" t-value="invoice.payment_tx_ids.filtered(lambda tx: tx.state in ('pending', 'authorized', 'done'))"/>
<a t-if="not tx_ids and invoice.state == 'open' and invoice.amount_total"
<a t-if="not tx_ids and invoice.state == 'open' and invoice.amount_total and invoice.type == 'out_invoice'"
class="btn btn-primary pull-right ml8" href="#portal_pay">
<i class="fa fa-arrow-circle-right"/> Pay Now
</a>
@@ -66,7 +66,7 @@
</div>
</xpath>
<xpath expr="//div[hasclass('panel-body')]" position="after">
<div class="panel-body" t-if="not tx_ids and invoice.state == 'open' and invoice.amount_total" id="portal_pay">
<div class="panel-body" t-if="not tx_ids and invoice.state == 'open' and invoice.amount_total and invoice.type == 'out_invoice'" id="portal_pay">
<div t-if="pms or s2s_acquirers or form_acquirers" id="payment_method" class="col-md-offset-3 col-md-6">
<h4 class="mb24">Pay with</h4>
<t t-call="payment.payment_tokens_list">
+7 -3
View File
@@ -2,6 +2,9 @@
""" ESC/POS Commands (Constants) """
# Control characters
ESC = '\x1b'
# Feed control sequences
CTL_LF = '\x0a' # Print and line feed
CTL_FF = '\x0c' # Form feed
@@ -19,9 +22,10 @@ DLE_EOT_PAPER = '\x10\x04\x04'
HW_INIT = '\x1b\x40' # Clear data in buffer and reset modes
HW_SELECT = '\x1b\x3d\x01' # Printer select
HW_RESET = '\x1b\x3f\x0a\x00' # Reset printer hardware
# Cash Drawer
CD_KICK_2 = '\x1b\x70\x00' # Sends a pulse to pin 2 []
CD_KICK_5 = '\x1b\x70\x01' # Sends a pulse to pin 5 []
# Cash Drawer (ESC p <pin> <on time: 2*ms> <off time: 2*ms>)
_CASH_DRAWER = lambda m, t1='', t2='': ESC + 'p' + m + chr(t1) + chr(t2)
CD_KICK_2 = _CASH_DRAWER('\x00', 50, 50) # Sends a pulse to pin 2 []
CD_KICK_5 = _CASH_DRAWER('\x01', 50, 50) # Sends a pulse to pin 5 []
# Paper
PAPER_FULL_CUT = '\x1d\x56\x00' # Full cut paper
PAPER_PART_CUT = '\x1d\x56\x01' # Partial cut paper
+3 -3
View File
@@ -763,7 +763,7 @@
<field name="amount" eval="8.5"/>
<field name="amount_type">percent</field>
<field name="refund_account_id" ref="pcg_44566"/>
<field name="account_id" ref="pcg_44566"/>
<field name="account_id" ref="pcg_44566"/>
<field name="sequence" eval="10"/>
<field name="type_tax_use">purchase</field>
<field name="tag_ids" eval="[(6,0,[ref('l10n_fr.tag_fr_23'),ref('l10n_fr.tag_fr_32')])]"/>
@@ -837,7 +837,7 @@
<field name="amount" eval="8.5"/>
<field name="amount_type">percent</field>
<field name="refund_account_id" ref="pcg_44566"/>
<field name="account_id" ref="pcg_44566"/>
<field name="account_id" ref="pcg_44566"/>
<field name="sequence" eval="10"/>
<field name="type_tax_use">purchase</field>
<field name="tag_ids" eval="[(6,0,[ref('l10n_fr.tag_fr_23'),ref('l10n_fr.tag_fr_32')])]"/>
@@ -1030,7 +1030,7 @@
<field name="account_id" ref="pcg_445203"/>
<field name="sequence" eval="10"/>
<field name="type_tax_use">purchase</field>
<field name="tag_ids" eval="[(6,0,[ref('l10n_fr.tag_fr_73'),ref('l10n_fr.tag_fr_82')])]"/>
<field name="tag_ids" eval="[(6,0,[ref('l10n_fr.tag_fr_73'),ref('l10n_fr.tag_fr_64')])]"/>
<field name="tax_group_id" ref="tax_group_intra_21"/>
</record>
+2 -2
View File
@@ -226,9 +226,9 @@ class MassMailingCampaign(models.Model):
campaign_id = fields.Many2one('utm.campaign', 'campaign_id',
required=True, ondelete='cascade', help="This name helps you tracking your different campaign efforts, e.g. Fall_Drive, Christmas_Special")
source_id = fields.Many2one('utm.source', string='Source',
help="This is the link source, e.g. Search Engine, another domain,or name of email list", default=lambda self: self.env.ref('utm.utm_source_newsletter'))
help="This is the link source, e.g. Search Engine, another domain,or name of email list", default=lambda self: self.env.ref('utm.utm_source_newsletter', False))
medium_id = fields.Many2one('utm.medium', string='Medium',
help="This is the delivery method, e.g. Postcard, Email, or Banner Ad", default=lambda self: self.env.ref('utm.utm_medium_email'))
help="This is the delivery method, e.g. Postcard, Email, or Banner Ad", default=lambda self: self.env.ref('utm.utm_medium_email', False))
tag_ids = fields.Many2many(
'mail.mass_mailing.tag', 'mail_mass_mailing_tag_rel',
'tag_id', 'campaign_id', string='Tags')
@@ -69,7 +69,6 @@
<field name="image_small"/>
<field name="lst_price"/>
<field name="product_variant_count"/>
<field name="product_variant_ids"/>
<field name="currency_id"/>
<templates>
<t t-name="kanban-box">
@@ -75,9 +75,11 @@ return AbstractModel.extend({
.utc();
} else {
// default hours in the user's timezone
start.hours(7).add(-this.getSession().getTZOffset(start), 'minutes');
end.hours(19).add(-this.getSession().getTZOffset(end), 'minutes');
start.hours(7);
end.hours(19);
}
start.add(-this.getSession().getTZOffset(start), 'minutes');
end.add(-this.getSession().getTZOffset(end), 'minutes');
}
} else {
start.add(-this.getSession().getTZOffset(start), 'minutes');
@@ -2182,6 +2182,60 @@ QUnit.module('Views', {
calendar.destroy();
});
QUnit.test('timezone does not affect drag and drop', function (assert) {
assert.expect(6);
var calendar = createView({
View: CalendarView,
model: 'event',
data: this.data,
arch:
'<calendar date_start="start" mode="month">'+
'<field name="name"/>'+
'<field name="start"/>'+
'</calendar>',
archs: archs,
viewOptions: {
initialDate: initialDate,
},
mockRPC: function (route, args) {
if (args.method === "write") {
assert.deepEqual(args.args[0], [6], "event 6 is moved")
assert.deepEqual(args.args[1].start, "2016-11-29 08:00:00",
"event moved to 27th nov 16h00 +40 hours timezone")
}
return this._super(route, args);
},
session: {
getTZOffset: function () {
return -2400; // 40 hours timezone
},
},
});
var events = calendar.$('.fc-event').map(function () {
return $(this).text().trim().replace(/\s+/g, '|');
});
assert.strictEqual(events[0], "event|1|12/09/2016|08:00:00");
assert.strictEqual(events[5], "event|6|12/16/2016|16:00:00");
// Move event 6 as on first day of month view (27th november 2016)
testUtils.dragAndDrop(
calendar.$('.fc-event').eq(5),
calendar.$('.fc-day-top').first()
);
var events = calendar.$('.fc-event').map(function () {
return $(this).text().trim().replace(/\s+/g, '|');
});
assert.strictEqual(events[0], "event|6|11/27/2016|16:00:00");
assert.strictEqual(events[1], "event|1|12/09/2016|08:00:00");
calendar.destroy();
});
QUnit.test('form_view_id attribute works (for creating events)', function (assert) {
assert.expect(1);
@@ -69,13 +69,15 @@
<td class="text-center td-price" name="price">
<ul class="hidden js_add_cart_variants" t-att-data-attribute_value_ids="json.dumps(main_product_attr_ids)"></ul>
<div class="hidden oe_unchanged_value_ids" t-att-data-unchanged_value_ids="main_product_attr_ids[0][1]" ></div>
<span t-attf-class="text-danger oe_default_price oe_striked_price {{ (compute_currency(product.lst_price) - product.website_price) &lt; 0.01 and 'hidden' }}"
t-field="product.lst_price"
t-options='{
"widget": "monetary",
"from_currency": product.currency_id,
"display_currency": website.currency_id
}'/>
<t t-if="website.get_current_pricelist().discount_policy=='without_discount'">
<span t-attf-class="text-danger oe_default_price oe_striked_price {{ (compute_currency(product.lst_price) - product.website_price) &lt; 0.01 and 'hidden' }}"
t-field="product.lst_price"
t-options='{
"widget": "monetary",
"from_currency": product.currency_id,
"display_currency": website.currency_id
}'/>
</t>
<span class="oe_price product_id" style="white-space: nowrap;"
t-att-data-product-id="product.id"
t-esc="product.website_price / quantity"