[MERGE] forward port branch saas-15 up to e44c35f407
This commit is contained in:
@@ -53,7 +53,7 @@ class MrpProduction(models.Model):
|
|||||||
domain=[('type', 'in', ['product', 'consu'])],
|
domain=[('type', 'in', ['product', 'consu'])],
|
||||||
readonly=True, required=True,
|
readonly=True, required=True,
|
||||||
states={'confirmed': [('readonly', False)]})
|
states={'confirmed': [('readonly', False)]})
|
||||||
product_tmpl_id = fields.Many2one('product.template', 'Product Template', related='product_id.product_tmpl_id')
|
product_tmpl_id = fields.Many2one('product.template', 'Product Template', related='product_id.product_tmpl_id', readonly=True)
|
||||||
product_qty = fields.Float(
|
product_qty = fields.Float(
|
||||||
'Quantity To Produce',
|
'Quantity To Produce',
|
||||||
default=1.0, digits=dp.get_precision('Product Unit of Measure'),
|
default=1.0, digits=dp.get_precision('Product Unit of Measure'),
|
||||||
|
|||||||
@@ -365,7 +365,7 @@ define([
|
|||||||
(keycode > 185 && keycode < 193) || // ;=,-./` (in order)
|
(keycode > 185 && keycode < 193) || // ;=,-./` (in order)
|
||||||
(keycode > 218 && keycode < 223))) { // [\]' (in order))
|
(keycode > 218 && keycode < 223))) { // [\]' (in order))
|
||||||
eventName = 'visible';
|
eventName = 'visible';
|
||||||
} else if (!keycode) {
|
} else if (!keycode && event.key !== 'Dead') {
|
||||||
self.invoke('restoreRange', $editable);
|
self.invoke('restoreRange', $editable);
|
||||||
}
|
}
|
||||||
// ODOO: end_modification)
|
// ODOO: end_modification)
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ def _get_wkhtmltopdf_bin():
|
|||||||
|
|
||||||
# Check the presence of Wkhtmltopdf and return its version at Odoo start-up
|
# Check the presence of Wkhtmltopdf and return its version at Odoo start-up
|
||||||
wkhtmltopdf_state = 'install'
|
wkhtmltopdf_state = 'install'
|
||||||
|
wkhtmltopdf_dpi_zoom_ratio = False
|
||||||
try:
|
try:
|
||||||
process = subprocess.Popen(
|
process = subprocess.Popen(
|
||||||
[_get_wkhtmltopdf_bin(), '--version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE
|
[_get_wkhtmltopdf_bin(), '--version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE
|
||||||
@@ -61,6 +62,8 @@ else:
|
|||||||
wkhtmltopdf_state = 'upgrade'
|
wkhtmltopdf_state = 'upgrade'
|
||||||
else:
|
else:
|
||||||
wkhtmltopdf_state = 'ok'
|
wkhtmltopdf_state = 'ok'
|
||||||
|
if LooseVersion(version) >= LooseVersion('0.12.2'):
|
||||||
|
wkhtmltopdf_dpi_zoom_ratio = True
|
||||||
|
|
||||||
if config['workers'] == 1:
|
if config['workers'] == 1:
|
||||||
_logger.info('You need to start Odoo with at least two workers to print a pdf version of the reports.')
|
_logger.info('You need to start Odoo with at least two workers to print a pdf version of the reports.')
|
||||||
@@ -234,14 +237,19 @@ class IrActionsReport(models.Model):
|
|||||||
else:
|
else:
|
||||||
command_args.extend(['--margin-top', str(paperformat_id.margin_top)])
|
command_args.extend(['--margin-top', str(paperformat_id.margin_top)])
|
||||||
|
|
||||||
|
dpi = None
|
||||||
if specific_paperformat_args and specific_paperformat_args.get('data-report-dpi'):
|
if specific_paperformat_args and specific_paperformat_args.get('data-report-dpi'):
|
||||||
command_args.extend(['--dpi', str(specific_paperformat_args['data-report-dpi'])])
|
dpi = int(specific_paperformat_args['data-report-dpi'])
|
||||||
elif paperformat_id.dpi:
|
elif paperformat_id.dpi:
|
||||||
if os.name == 'nt' and int(paperformat_id.dpi) <= 95:
|
if os.name == 'nt' and int(paperformat_id.dpi) <= 95:
|
||||||
_logger.info("Generating PDF on Windows platform require DPI >= 96. Using 96 instead.")
|
_logger.info("Generating PDF on Windows platform require DPI >= 96. Using 96 instead.")
|
||||||
command_args.extend(['--dpi', '96'])
|
dpi = 96
|
||||||
else:
|
else:
|
||||||
command_args.extend(['--dpi', str(paperformat_id.dpi)])
|
dpi = paperformat_id.dpi
|
||||||
|
if dpi:
|
||||||
|
command_args.extend(['--dpi', str(dpi)])
|
||||||
|
if wkhtmltopdf_dpi_zoom_ratio:
|
||||||
|
command_args.extend(['--zoom', str(96.0 / dpi)])
|
||||||
|
|
||||||
if specific_paperformat_args and specific_paperformat_args.get('data-report-header-spacing'):
|
if specific_paperformat_args and specific_paperformat_args.get('data-report-header-spacing'):
|
||||||
command_args.extend(['--header-spacing', str(specific_paperformat_args['data-report-header-spacing'])])
|
command_args.extend(['--header-spacing', str(specific_paperformat_args['data-report-header-spacing'])])
|
||||||
|
|||||||
Reference in New Issue
Block a user