mirror of
https://gitlab.com/flectra-hq/flectra.git
synced 2026-10-25 07:27:39 -05:00
[PATCH] Upstream patch - 22012024
This commit is contained in:
1 parent
a62daa817a
commit
d186efbec5
3 files changed
+46
-13
No files matched your search
@@ -4,6 +4,18 @@ from flectra.addons.account.models.chart_template import update_taxes_from_templ
|
||||
|
||||
|
||||
def migrate(cr, version):
|
||||
env = api.Environment(cr, SUPERUSER_ID, {})
|
||||
# We had corrupted data, handle the correction so the tax update can proceed.
|
||||
# See https://github.com/flectra/flectra/commit/7b07df873535446f97abc1de9176b9332de5cb07
|
||||
taxes_to_check = ('vat_purchase_81_return', 'vat_77_purchase_return')
|
||||
tax_ids = env['ir.model.data'].search([('name', 'in', taxes_to_check)]).mapped('res_id')
|
||||
for tax in env['account.tax'].browse(tax_ids):
|
||||
for child in tax.children_tax_ids:
|
||||
if child.type_tax_use not in ('none', tax.type_tax_use):
|
||||
# set the child to it's parent's value
|
||||
child.type_tax_use = tax.type_tax_use
|
||||
|
||||
# Update taxes
|
||||
new_template_to_tax = update_taxes_from_templates(cr, 'l10n_ch.l10nch_chart_template')
|
||||
if new_template_to_tax:
|
||||
_, new_tax_ids = zip(*new_template_to_tax)
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<field name="cash_account_code_prefix">111</field>
|
||||
<field name="transfer_account_code_prefix">113</field>
|
||||
<field name="spoken_languages" eval="'vi_VN'"/>
|
||||
<field name="use_anglo_saxon" eval="True"/>
|
||||
<field name="use_anglo_saxon" eval="False"/>
|
||||
</record>
|
||||
</data>
|
||||
</flectra>
|
||||
Vendored
+33
-12
@@ -1,7 +1,7 @@
|
||||
/*!
|
||||
* Chart.js v2.9.3
|
||||
* Chart.js v2.9.4
|
||||
* https://www.chartjs.org
|
||||
* (c) 2019 Chart.js Contributors
|
||||
* (c) 2020 Chart.js Contributors
|
||||
* Released under the MIT License
|
||||
*/
|
||||
(function (global, factory) {
|
||||
@@ -2103,6 +2103,10 @@ if (typeof window !== 'undefined') {
|
||||
|
||||
var chartjsColor = Color;
|
||||
|
||||
function isValidKey(key) {
|
||||
return ['__proto__', 'prototype', 'constructor'].indexOf(key) === -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* @namespace Chart.helpers
|
||||
*/
|
||||
@@ -2278,7 +2282,7 @@ var helpers = {
|
||||
}
|
||||
|
||||
if (helpers.isObject(source)) {
|
||||
var target = {};
|
||||
var target = Object.create(source);
|
||||
var keys = Object.keys(source);
|
||||
var klen = keys.length;
|
||||
var k = 0;
|
||||
@@ -2299,6 +2303,12 @@ var helpers = {
|
||||
* @private
|
||||
*/
|
||||
_merger: function(key, target, source, options) {
|
||||
if (!isValidKey(key)) {
|
||||
// We want to ensure we do not copy prototypes over
|
||||
// as this can pollute global namespaces
|
||||
return;
|
||||
}
|
||||
|
||||
var tval = target[key];
|
||||
var sval = source[key];
|
||||
|
||||
@@ -2314,6 +2324,12 @@ var helpers = {
|
||||
* @private
|
||||
*/
|
||||
_mergerIf: function(key, target, source) {
|
||||
if (!isValidKey(key)) {
|
||||
// We want to ensure we do not copy prototypes over
|
||||
// as this can pollute global namespaces
|
||||
return;
|
||||
}
|
||||
|
||||
var tval = target[key];
|
||||
var sval = source[key];
|
||||
|
||||
@@ -3812,7 +3828,7 @@ helpers$1.extend(DatasetController.prototype, {
|
||||
*/
|
||||
_configure: function() {
|
||||
var me = this;
|
||||
me._config = helpers$1.merge({}, [
|
||||
me._config = helpers$1.merge(Object.create(null), [
|
||||
me.chart.options.datasets[me._type],
|
||||
me.getDataset(),
|
||||
], {
|
||||
@@ -7082,7 +7098,8 @@ function updateDims(chartArea, params, layout) {
|
||||
chartArea.h = newHeight;
|
||||
|
||||
// return true if chart area changed in layout's direction
|
||||
return layout.horizontal ? newWidth !== chartArea.w : newHeight !== chartArea.h;
|
||||
var sizes = layout.horizontal ? [newWidth, chartArea.w] : [newHeight, chartArea.h];
|
||||
return sizes[0] !== sizes[1] && (!isNaN(sizes[0]) || !isNaN(sizes[1]));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8094,7 +8111,7 @@ var core_scaleService = {
|
||||
},
|
||||
getScaleDefaults: function(type) {
|
||||
// Return the scale defaults merged with the global settings so that we always use the latest ones
|
||||
return this.defaults.hasOwnProperty(type) ? helpers$1.merge({}, [core_defaults.scale, this.defaults[type]]) : {};
|
||||
return this.defaults.hasOwnProperty(type) ? helpers$1.merge(Object.create(null), [core_defaults.scale, this.defaults[type]]) : {};
|
||||
},
|
||||
updateScaleDefaults: function(type, additions) {
|
||||
var me = this;
|
||||
@@ -9169,7 +9186,7 @@ core_defaults._set('global', {
|
||||
* returns a deep copy of the result, thus doesn't alter inputs.
|
||||
*/
|
||||
function mergeScaleConfig(/* config objects ... */) {
|
||||
return helpers$1.merge({}, [].slice.call(arguments), {
|
||||
return helpers$1.merge(Object.create(null), [].slice.call(arguments), {
|
||||
merger: function(key, target, source, options) {
|
||||
if (key === 'xAxes' || key === 'yAxes') {
|
||||
var slen = source[key].length;
|
||||
@@ -9209,9 +9226,9 @@ function mergeScaleConfig(/* config objects ... */) {
|
||||
* a deep copy of the result, thus doesn't alter inputs.
|
||||
*/
|
||||
function mergeConfig(/* config objects ... */) {
|
||||
return helpers$1.merge({}, [].slice.call(arguments), {
|
||||
return helpers$1.merge(Object.create(null), [].slice.call(arguments), {
|
||||
merger: function(key, target, source, options) {
|
||||
var tval = target[key] || {};
|
||||
var tval = target[key] || Object.create(null);
|
||||
var sval = source[key];
|
||||
|
||||
if (key === 'scales') {
|
||||
@@ -9228,7 +9245,7 @@ function mergeConfig(/* config objects ... */) {
|
||||
}
|
||||
|
||||
function initConfig(config) {
|
||||
config = config || {};
|
||||
config = config || Object.create(null);
|
||||
|
||||
// Do NOT use mergeConfig for the data object because this method merges arrays
|
||||
// and so would change references to labels and datasets, preventing data updates.
|
||||
@@ -11209,6 +11226,8 @@ function computeLabelSizes(ctx, tickFonts, ticks, caches) {
|
||||
var widths = [];
|
||||
var heights = [];
|
||||
var offsets = [];
|
||||
var widestLabelSize = 0;
|
||||
var highestLabelSize = 0;
|
||||
var i, j, jlen, label, tickFont, fontString, cache, lineHeight, width, height, nestedLabel, widest, highest;
|
||||
|
||||
for (i = 0; i < length; ++i) {
|
||||
@@ -11236,11 +11255,13 @@ function computeLabelSizes(ctx, tickFonts, ticks, caches) {
|
||||
widths.push(width);
|
||||
heights.push(height);
|
||||
offsets.push(lineHeight / 2);
|
||||
widestLabelSize = Math.max(width, widestLabelSize);
|
||||
highestLabelSize = Math.max(height, highestLabelSize);
|
||||
}
|
||||
garbageCollect(caches, length);
|
||||
|
||||
widest = widths.indexOf(Math.max.apply(null, widths));
|
||||
highest = heights.indexOf(Math.max.apply(null, heights));
|
||||
widest = widths.indexOf(widestLabelSize);
|
||||
highest = heights.indexOf(highestLabelSize);
|
||||
|
||||
function valueAt(idx) {
|
||||
return {
|
||||
|
||||
Reference in new issue
Block a user