diff options
| author | Christophe Simonis <chs@odoo.com> | 2019-03-28 18:17:20 +0100 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2019-03-28 18:17:20 +0100 |
| commit | ec29b4d364860313fb8eb866b566d8ce56882438 (patch) | |
| tree | 3f085743d6186450577761f381f8c11c22a09377 /addons | |
| parent | 5838e47ab504340abc00ade9b8a18289aba1c03a (diff) | |
| parent | 4231103cc99966cc61325454766c662a75fcf7ef (diff) | |
[MERGE] forward port branch 11.0 up to 4231103cc99
Diffstat (limited to 'addons')
8 files changed, 81 insertions, 20 deletions
diff --git a/addons/account_payment/views/account_portal_templates.xml b/addons/account_payment/views/account_portal_templates.xml index e92831620b6..7383a5cf303 100644 --- a/addons/account_payment/views/account_portal_templates.xml +++ b/addons/account_payment/views/account_portal_templates.xml @@ -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"> diff --git a/addons/hw_escpos/escpos/constants.py b/addons/hw_escpos/escpos/constants.py index 238e8bdbf0f..0000109a964 100644 --- a/addons/hw_escpos/escpos/constants.py +++ b/addons/hw_escpos/escpos/constants.py @@ -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 diff --git a/addons/l10n_fr/data/account_tax_data.xml b/addons/l10n_fr/data/account_tax_data.xml index 5fb51c92067..13af392b4bc 100644 --- a/addons/l10n_fr/data/account_tax_data.xml +++ b/addons/l10n_fr/data/account_tax_data.xml @@ -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> diff --git a/addons/mass_mailing/models/mass_mailing.py b/addons/mass_mailing/models/mass_mailing.py index d40c1842db0..752b26986ee 100644 --- a/addons/mass_mailing/models/mass_mailing.py +++ b/addons/mass_mailing/models/mass_mailing.py @@ -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') diff --git a/addons/product/views/product_template_views.xml b/addons/product/views/product_template_views.xml index cc4206a73be..fadcfd8de6c 100644 --- a/addons/product/views/product_template_views.xml +++ b/addons/product/views/product_template_views.xml @@ -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"> diff --git a/addons/web/static/src/js/views/calendar/calendar_model.js b/addons/web/static/src/js/views/calendar/calendar_model.js index 71076194731..4ca1b56973e 100644 --- a/addons/web/static/src/js/views/calendar/calendar_model.js +++ b/addons/web/static/src/js/views/calendar/calendar_model.js @@ -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'); diff --git a/addons/web/static/tests/views/calendar_tests.js b/addons/web/static/tests/views/calendar_tests.js index cf717027ebe..4414d48d47a 100644 --- a/addons/web/static/tests/views/calendar_tests.js +++ b/addons/web/static/tests/views/calendar_tests.js @@ -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); diff --git a/addons/website_sale_options/views/website_sale_options_templates.xml b/addons/website_sale_options/views/website_sale_options_templates.xml index 36e54779fcc..3b2c3915c7a 100644 --- a/addons/website_sale_options/views/website_sale_options_templates.xml +++ b/addons/website_sale_options/views/website_sale_options_templates.xml @@ -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) < 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) < 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" |
