Merge branch '13.0' into 13.0-mig-report_py3o

pull/347/head
Laurent Mignon (ACSONE) 2020-05-12 15:43:31 +02:00 committed by GitHub
commit 992e5675cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
236 changed files with 17543 additions and 361 deletions

20
.editorconfig 100644
View File

@ -0,0 +1,20 @@
# Configuration for known file extensions
[*.{css,js,json,less,md,py,rst,sass,scss,xml,yaml,yml}]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
[*.{json,yml,yaml,rst,md}]
indent_size = 2
# Do not configure editor for libs and autogenerated content
[{*/static/{lib,src/lib}/**,*/static/description/index.html,*/readme/../README.rst}]
charset = unset
end_of_line = unset
indent_size = unset
indent_style = unset
insert_final_newline = false
trim_trailing_whitespace = false

291
.eslintrc
View File

@ -1,291 +0,0 @@
{
"globals": {
"$": false,
"_": false,
"fuzzy": false,
"jQuery": false,
"moment": false,
"odoo": false,
"openerp": false,
"self": false
},
"env": {
"browser": true
},
"rules": {
"no-alert": "warn",
"no-array-constructor": "warn",
"no-bitwise": "off",
"no-caller": "warn",
"no-case-declarations": "warn",
"no-catch-shadow": "warn",
"no-class-assign": "warn",
"no-cond-assign": "warn",
"no-confusing-arrow": "warn",
"no-console": "off",
"no-const-assign": "warn",
"no-constant-condition": "warn",
"no-continue": "off",
"no-control-regex": "warn",
"no-debugger": "warn",
"no-delete-var": "warn",
"no-div-regex": "warn",
"no-dupe-args": "warn",
"no-dupe-class-members": "warn",
"no-dupe-keys": "warn",
"no-duplicate-case": "warn",
"no-duplicate-imports": "warn",
"no-else-return": "warn",
"no-empty": "warn",
"no-empty-character-class": "warn",
"no-empty-function": "warn",
"no-empty-pattern": "warn",
"no-eq-null": "warn",
"no-eval": "warn",
"no-ex-assign": "warn",
"no-extend-native": "warn",
"no-extra-bind": "warn",
"no-extra-boolean-cast": "warn",
"no-extra-label": "warn",
"no-extra-parens": "warn",
"no-extra-semi": "warn",
"no-fallthrough": "warn",
"no-floating-decimal": "warn",
"no-func-assign": "warn",
"no-implicit-coercion": ["warn", {
"allow": ["~"]
}],
"no-implicit-globals": "warn",
"no-implied-eval": "warn",
"no-inline-comments": "warn",
"no-inner-declarations": "warn",
"no-invalid-regexp": "warn",
"no-invalid-this": "off",
"no-irregular-whitespace": "warn",
"no-iterator": "warn",
"no-label-var": "warn",
"no-labels": "warn",
"no-lone-blocks": "warn",
"no-lonely-if": "warn",
"no-loop-func": "off",
"no-magic-numbers": "off",
"no-mixed-operators": "warn",
"no-mixed-requires": "warn",
"no-mixed-spaces-and-tabs": "warn",
"no-multi-spaces": "warn",
"no-multi-str": "warn",
"no-multiple-empty-lines": "warn",
"no-native-reassign": "warn",
"no-negated-condition": "warn",
"no-negated-in-lhs": "warn",
"no-nested-ternary": "off",
"no-new": "warn",
"no-new-func": "warn",
"no-new-object": "warn",
"no-new-require": "warn",
"no-new-symbol": "warn",
"no-new-wrappers": "warn",
"no-obj-calls": "warn",
"no-octal": "warn",
"no-octal-escape": "warn",
"no-param-reassign": "warn",
"no-path-concat": "warn",
"no-plusplus": "off",
"no-process-env": "warn",
"no-process-exit": "warn",
"no-proto": "warn",
"no-prototype-builtins": "warn",
"no-redeclare": "warn",
"no-regex-spaces": "warn",
"no-restricted-globals": "warn",
"no-restricted-imports": "warn",
"no-restricted-modules": "warn",
"no-restricted-syntax": "warn",
"no-return-assign": "warn",
"no-script-url": "warn",
"no-self-assign": "warn",
"no-self-compare": "warn",
"no-sequences": "warn",
"no-shadow": "warn",
"no-shadow-restricted-names": "warn",
"no-whitespace-before-property": "warn",
"no-spaced-func": "warn",
"no-sparse-arrays": "warn",
"no-sync": "warn",
"no-tabs": "warn",
"no-ternary": "off",
"no-trailing-spaces": "warn",
"no-this-before-super": "warn",
"no-throw-literal": "warn",
"no-undef": "warn",
"no-undef-init": "warn",
"no-undefined": "off",
"no-unexpected-multiline": "warn",
"no-underscore-dangle": "off",
"no-unmodified-loop-condition": "warn",
"no-unneeded-ternary": "warn",
"no-unreachable": "warn",
"no-unsafe-finally": "warn",
"no-unused-expressions": "warn",
"no-unused-labels": "warn",
"no-unused-vars": "warn",
"no-use-before-define": "warn",
"no-useless-call": "warn",
"no-useless-computed-key": "warn",
"no-useless-concat": "warn",
"no-useless-constructor": "warn",
"no-useless-escape": "warn",
"no-useless-rename": "warn",
"no-void": "warn",
"no-var": "off",
"no-warning-comments": "off",
"no-with": "warn",
"array-bracket-spacing": "off",
"array-callback-return": "warn",
"arrow-body-style": "warn",
"arrow-parens": "warn",
"arrow-spacing": "off",
"accessor-pairs": "warn",
"block-scoped-var": "off",
"block-spacing": ["warn", "always"],
"brace-style": "warn",
"callback-return": "warn",
"camelcase": "off",
"capitalized-comments": ["warn", "always", {
"ignoreConsecutiveComments": true,
"ignoreInlineComments": true
}],
"comma-dangle": ["warn", "always-multiline"],
"comma-spacing": ["warn", {
"before": false,
"after": true
}],
"comma-style": "warn",
"complexity": [
"warn",
15
],
"computed-property-spacing": "off",
"consistent-return": "off",
"consistent-this": "off",
"constructor-super": "warn",
"curly": "warn",
"default-case": "off",
"dot-location": ["warn", "property"],
"dot-notation": "warn",
"eol-last": "warn",
"eqeqeq": "warn",
"func-names": "off",
"func-style": "off",
"generator-star-spacing": "off",
"global-require": "warn",
"guard-for-in": "off",
"handle-callback-err": "warn",
"id-blacklist": "warn",
"id-length": "off",
"id-match": "warn",
"indent": "warn",
"init-declarations": "warn",
"jsx-quotes": "warn",
"key-spacing": "off",
"keyword-spacing": "warn",
"linebreak-style": [
"warn",
"unix"
],
"lines-around-comment": "warn",
"max-depth": "warn",
"max-len": ["warn", {
"code": 88,
"ignorePattern": "odoo\\.define\\(",
"tabWidth": 4
}],
"max-lines": "off",
"max-nested-callbacks": "warn",
"max-params": "off",
"max-statements": "off",
"max-statements-per-line": "warn",
"multiline-ternary": "off",
"new-cap": "off",
"new-parens": "warn",
"newline-after-var": "off",
"newline-before-return": "off",
"newline-per-chained-call": "off",
"object-curly-newline": ["warn", { "consistent": true }],
"object-curly-spacing": ["warn", "never"],
"object-property-newline": ["warn", {
"allowAllPropertiesOnSameLine": true
}],
"object-shorthand": "off",
"one-var": "off",
"one-var-declaration-per-line": "off",
"operator-assignment": "warn",
"operator-linebreak": "warn",
"padded-blocks": "off",
"prefer-arrow-callback": "off",
"prefer-const": "warn",
"prefer-reflect": "off",
"prefer-rest-params": "off",
"prefer-spread": "off",
"prefer-template": "off",
"quote-props": "off",
"quotes": "off",
"radix": "warn",
"require-yield": "warn",
"rest-spread-spacing": "off",
"semi": [
"warn",
"always"
],
"semi-spacing": "warn",
"sort-imports": "warn",
"sort-vars": "off",
"space-before-blocks": "warn",
"space-before-function-paren": "warn",
"space-in-parens": "off",
"space-infix-ops": "off",
"space-unary-ops": "off",
"spaced-comment": ["warn", "always"],
"strict": ["warn", "function"],
"template-curly-spacing": "off",
"unicode-bom": "warn",
"use-isnan": "warn",
"valid-jsdoc": ["warn", {
"prefer": {
"arg": "param",
"argument": "param",
"augments": "extends",
"constructor": "class",
"exception": "throws",
"func": "function",
"method": "function",
"prop": "property",
"return": "returns",
"virtual": "abstract",
"yield": "yields"
},
"preferType": {
"array": "Array",
"bool": "Boolean",
"boolean": "Boolean",
"number": "Number",
"object": "Object",
"str": "String",
"string": "String"
},
"requireParamDescription": false,
"requireReturn": false,
"requireReturnDescription": false,
"requireReturnType": false
}],
"valid-typeof": "warn",
"vars-on-top": "off",
"wrap-iife": "warn",
"wrap-regex": "warn",
"yield-star-spacing": "off",
"yoda": "warn"
},
"parserOptions": {
"ecmaVersion": 2017
}
}

180
.eslintrc.yml 100644
View File

@ -0,0 +1,180 @@
env:
browser: true
# See https://github.com/OCA/odoo-community.org/issues/37#issuecomment-470686449
parserOptions:
ecmaVersion: 2017
# Globals available in Odoo that shouldn't produce errorings
globals:
_: readonly
$: readonly
fuzzy: readonly
jQuery: readonly
moment: readonly
odoo: readonly
openerp: readonly
Promise: readonly
# Styling is handled by Prettier, so we only need to enable AST rules;
# see https://github.com/OCA/maintainer-quality-tools/pull/618#issuecomment-558576890
rules:
accessor-pairs: warn
array-callback-return: warn
callback-return: warn
capitalized-comments:
- warn
- always
- ignoreConsecutiveComments: true
ignoreInlineComments: true
complexity:
- warn
- 15
constructor-super: warn
dot-notation: warn
eqeqeq: warn
global-require: warn
handle-callback-err: warn
id-blacklist: warn
id-match: warn
init-declarations: error
max-depth: warn
max-nested-callbacks: warn
max-statements-per-line: warn
no-alert: warn
no-array-constructor: warn
no-caller: warn
no-case-declarations: warn
no-class-assign: warn
no-cond-assign: error
no-const-assign: error
no-constant-condition: warn
no-control-regex: warn
no-debugger: error
no-delete-var: warn
no-div-regex: warn
no-dupe-args: error
no-dupe-class-members: error
no-dupe-keys: error
no-duplicate-case: error
no-duplicate-imports: error
no-else-return: warn
no-empty-character-class: warn
no-empty-function: error
no-empty-pattern: error
no-empty: warn
no-eq-null: error
no-eval: error
no-ex-assign: error
no-extend-native: warn
no-extra-bind: warn
no-extra-boolean-cast: warn
no-extra-label: warn
no-fallthrough: warn
no-func-assign: error
no-global-assign: error
no-implicit-coercion:
- warn
- allow: ["~"]
no-implicit-globals: warn
no-implied-eval: warn
no-inline-comments: warn
no-inner-declarations: warn
no-invalid-regexp: warn
no-irregular-whitespace: warn
no-iterator: warn
no-label-var: warn
no-labels: warn
no-lone-blocks: warn
no-lonely-if: error
no-mixed-requires: error
no-multi-str: warn
no-native-reassign: error
no-negated-condition: warn
no-negated-in-lhs: error
no-new-func: warn
no-new-object: warn
no-new-require: warn
no-new-symbol: warn
no-new-wrappers: warn
no-new: warn
no-obj-calls: warn
no-octal-escape: warn
no-octal: warn
no-param-reassign: warn
no-path-concat: warn
no-process-env: warn
no-process-exit: warn
no-proto: warn
no-prototype-builtins: warn
no-redeclare: warn
no-regex-spaces: warn
no-restricted-globals: warn
no-restricted-imports: warn
no-restricted-modules: warn
no-restricted-syntax: warn
no-return-assign: error
no-script-url: warn
no-self-assign: warn
no-self-compare: warn
no-sequences: warn
no-shadow-restricted-names: warn
no-shadow: warn
no-sparse-arrays: warn
no-sync: warn
no-this-before-super: warn
no-throw-literal: warn
no-undef-init: warn
no-undef: error
no-unmodified-loop-condition: warn
no-unneeded-ternary: error
no-unreachable: error
no-unsafe-finally: error
no-unused-expressions: error
no-unused-labels: error
no-unused-vars: error
no-use-before-define: error
no-useless-call: warn
no-useless-computed-key: warn
no-useless-concat: warn
no-useless-constructor: warn
no-useless-escape: warn
no-useless-rename: warn
no-void: warn
no-with: warn
operator-assignment: [error, always]
prefer-const: warn
radix: warn
require-yield: warn
sort-imports: warn
spaced-comment: [error, always]
strict: [error, function]
use-isnan: error
valid-jsdoc:
- warn
- prefer:
arg: param
argument: param
augments: extends
constructor: class
exception: throws
func: function
method: function
prop: property
return: returns
virtual: abstract
yield: yields
preferType:
array: Array
bool: Boolean
boolean: Boolean
number: Number
object: Object
str: String
string: String
requireParamDescription: false
requireReturn: false
requireReturnDescription: false
requireReturnType: false
valid-typeof: warn
yoda: warn

View File

@ -10,3 +10,4 @@ known_odoo=odoo
known_odoo_addons=odoo.addons
sections=FUTURE,STDLIB,THIRDPARTY,ODOO,ODOO_ADDONS,FIRSTPARTY,LOCALFOLDER
known_third_party=PyPDF2,mock,pkg_resources,requests,setuptools,werkzeug
default_section=THIRDPARTY

View File

@ -1,13 +1,47 @@
exclude: "^setup/|/static/lib/|/static/src/lib/"
exclude: |
(?x)
# Files and folders generated by bots, to avoid loops
^setup/|/static/description/index\.html$|
# Maybe reactivate this when all README files include prettier ignore tags?
^README\.md$|
# Library files can have extraneous formatting (even minimized)
/static/(src/)?lib/|
# Repos using Sphinx to generate docs don't need prettying
^docs/_templates/.*\.html$|
# You don't usually want a bot to modify your legal texts
(LICENSE.*|COPYING.*)
default_language_version:
python: python3
repos:
- repo: https://github.com/psf/black
rev: 19.3b0
rev: 19.10b0
hooks:
- id: black
- repo: https://github.com/prettier/prettier
rev: "1.19.1"
hooks:
- id: prettier
# TODO Avoid awebdeveloper/pre-commit-prettier if possible
# HACK https://github.com/prettier/prettier/issues/7407
- repo: https://github.com/awebdeveloper/pre-commit-prettier
rev: v0.0.1
hooks:
- id: prettier
name: prettier xml plugin
additional_dependencies:
- "prettier@1.19.1"
- "@prettier/plugin-xml@0.7.2"
files: \.xml$
- repo: https://github.com/pre-commit/mirrors-eslint
rev: v6.8.0
hooks:
- id: eslint
verbose: true
args:
- --color
- --fix
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
rev: v2.4.0
hooks:
- id: trailing-whitespace
# exclude autogenerated files
@ -31,6 +65,8 @@ repos:
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-merge-conflict
# exclude files where underlines are not distinguishable from merge conflicts
exclude: /README\.rst$|^docs/.*\.rst$
- id: check-symlinks
- id: check-xml
- id: mixed-line-ending
@ -42,27 +78,22 @@ repos:
name: pylint with optional checks
args: ["--rcfile=.pylintrc", "--exit-zero"]
verbose: true
additional_dependencies: ["pylint-odoo==3.0.3"]
additional_dependencies: ["pylint-odoo==3.1.0"]
- id: pylint
name: pylint with mandatory checks
args: ["--rcfile=.pylintrc-mandatory"]
additional_dependencies: ["pylint-odoo==3.0.3"]
additional_dependencies: ["pylint-odoo==3.1.0"]
- repo: https://github.com/asottile/pyupgrade
rev: v1.24.0
rev: v1.26.2
hooks:
- id: pyupgrade
- repo: https://github.com/asottile/seed-isort-config
rev: v1.9.3
hooks:
- id: seed-isort-config
- repo: https://github.com/pre-commit/mirrors-isort
rev: v4.3.21
hooks:
- id: isort
name: isort except __init__.py
exclude: /__init__\.py$
- repo: https://github.com/pre-commit/mirrors-eslint
rev: v6.5.1
- repo: https://github.com/acsone/setuptools-odoo
rev: 2.5.2
hooks:
- id: eslint
verbose: true
- id: setuptools-odoo-make-default

8
.prettierrc.yml 100644
View File

@ -0,0 +1,8 @@
# Defaults for all prettier-supported languages.
# Prettier will complete this with settings from .editorconfig file.
bracketSpacing: false
printWidth: 88
proseWrap: always
semi: true
trailingComma: "es5"
xmlWhitespaceSensitivity: "ignore"

View File

@ -24,7 +24,7 @@ jobs:
name: "pre-commit"
before_install:
install: pip install pre-commit
script: pre-commit run --all --show-diff-on-failure
script: pre-commit run --all --show-diff-on-failure --verbose --color always
after_success:
- stage: test
env:
@ -38,7 +38,8 @@ env:
- VERSION="13.0" TESTS="0" LINT_CHECK="0" MAKEPOT="0"
install:
- git clone --depth=1 https://github.com/OCA/maintainer-quality-tools.git ${HOME}/maintainer-quality-tools
- git clone --depth=1 https://github.com/OCA/maintainer-quality-tools.git
${HOME}/maintainer-quality-tools
- export PATH=${HOME}/maintainer-quality-tools/travis:${PATH}
- travis_install_nightly

View File

@ -0,0 +1,132 @@
=====================
Batch Report Printing
=====================
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Freporting--engine-lightgray.png?logo=github
:target: https://github.com/OCA/reporting-engine/tree/13.0/report_batch
:alt: OCA/reporting-engine
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/reporting-engine-13-0/reporting-engine-13-0-report_batch
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/143/13.0
:alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5|
This module will allow to to print multiple QWeb reports in a single batch.
For example, picking, packing, reports needs to be printed together
in a single batch.
**Table of contents**
.. contents::
:local:
Configuration
=============
We can configure this module in following two ways:
1st Way
=======
* Create a Report or edit existing report from Settings > Users & Companies >
Batch Reports
* Add sequence number and select parent report or design your own batch report.
* Select subreport to add reports and save it.
2st Way
=======
* Active developer mode. Go to Settings > Technical > Actions > Reports.
* Create or edit report and select related model.
* Jump on "Batch report" tab and add subreport one by one.
* Drag up and down and arrange a sequence of report. Save it.
Usage
=====
If we configure it like following values:
* Name = Picking Batch Report
* Model = Transfer
* Template Name = my.picking_batch_report
* Add subreport = Delivery Slip and Picking Operations
* Save it.
To get results:
* Go to Inventory > Operations > Transfers
* Open one record or select multi records.
* Click on "Print" option near by "Action".
* Print "Picking Batch Report"
* We will get delivery slip and picking operations report together.
Bug Tracker
===========
Bugs are tracked on `GitHub Issues <https://github.com/OCA/reporting-engine/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/reporting-engine/issues/new?body=module:%20report_batch%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues.
Credits
=======
Authors
~~~~~~~
* Open Source Integrators
Contributors
~~~~~~~~~~~~
* Bhavesh Odedra <bodedra@opensourceintegrators.com>
* Balaji Kannan <bkannan@opensourceintegrators.com>
* Daniel Reis <dreis@opensourceintegrators.com>
Other credits
~~~~~~~~~~~~~
The development of this module has been financially supported by:
* Open Source Integrators
Maintainers
~~~~~~~~~~~
This module is maintained by the OCA.
.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org
OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
.. |maintainer-bodedra| image:: https://github.com/bodedra.png?size=40px
:target: https://github.com/bodedra
:alt: bodedra
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
|maintainer-bodedra|
This module is part of the `OCA/reporting-engine <https://github.com/OCA/reporting-engine/tree/13.0/report_batch>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View File

@ -0,0 +1,5 @@
# Copyright (C) 2019 IBM Corp.
# Copyright (C) 2019 Open Source Integrators
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import models

View File

@ -0,0 +1,17 @@
# Copyright (C) 2019 IBM Corp.
# Copyright (C) 2019 Open Source Integrators
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Batch Report Printing",
"summary": "Ability to print multiple QWeb reports in a single batch.",
"version": "13.0.1.0.1",
"license": "AGPL-3",
"author": "Open Source Integrators, Odoo Community Association (OCA)",
"category": "Reporting",
"website": "https://github.com/OCA/reporting-engine",
"depends": ["stock"],
"data": ["security/ir.model.access.csv", "views/ir_action_report_view.xml"],
"installable": True,
"maintainers": ["bodedra"],
}

View File

@ -0,0 +1,98 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * report_batch
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: report_batch
#: model_terms:ir.actions.act_window,help:report_batch.action_ir_actions_subreport
msgid "Allows to add multi QWeb reports in a single batch"
msgstr ""
#. module: report_batch
#: model_terms:ir.ui.view,arch_db:report_batch.act_batch_report_xml_view
msgid "Batch Report"
msgstr ""
#. module: report_batch
#: model:ir.actions.act_window,name:report_batch.action_ir_actions_subreport
#: model:ir.ui.menu,name:report_batch.menu_action_ir_actions_subreport
#: model_terms:ir.ui.view,arch_db:report_batch.act_batch_report_xml_view
#: model_terms:ir.ui.view,arch_db:report_batch.view_ir_actions_subreport_tree
msgid "Batch Reports"
msgstr ""
#. module: report_batch
#: model:ir.model.fields,field_description:report_batch.field_ir_actions_report_subreport__create_uid
msgid "Created by"
msgstr ""
#. module: report_batch
#: model:ir.model.fields,field_description:report_batch.field_ir_actions_report_subreport__create_date
msgid "Created on"
msgstr ""
#. module: report_batch
#: model:ir.model.fields,field_description:report_batch.field_ir_actions_report_subreport__display_name
msgid "Display Name"
msgstr ""
#. module: report_batch
#: model:ir.model.fields,field_description:report_batch.field_ir_actions_report_subreport__id
msgid "ID"
msgstr ""
#. module: report_batch
#: model:ir.model.fields,field_description:report_batch.field_ir_actions_report_subreport____last_update
msgid "Last Modified on"
msgstr ""
#. module: report_batch
#: model:ir.model.fields,field_description:report_batch.field_ir_actions_report_subreport__write_uid
msgid "Last Updated by"
msgstr ""
#. module: report_batch
#: model:ir.model.fields,field_description:report_batch.field_ir_actions_report_subreport__write_date
msgid "Last Updated on"
msgstr ""
#. module: report_batch
#: model:ir.model.fields,field_description:report_batch.field_ir_actions_report_subreport__model
msgid "Model Name"
msgstr ""
#. module: report_batch
#: model:ir.model.fields,field_description:report_batch.field_ir_actions_report_subreport__parent_report_id
msgid "Parent Report"
msgstr ""
#. module: report_batch
#: model:ir.model,name:report_batch.model_ir_actions_report
msgid "Report Action"
msgstr ""
#. module: report_batch
#: model:ir.model,name:report_batch.model_ir_actions_report_subreport
msgid "Report Subreport"
msgstr ""
#. module: report_batch
#: model:ir.model.fields,field_description:report_batch.field_ir_actions_report_subreport__sequence
msgid "Sequence"
msgstr ""
#. module: report_batch
#: model:ir.model.fields,field_description:report_batch.field_ir_actions_report__subreport_ids
#: model:ir.model.fields,field_description:report_batch.field_ir_actions_report_subreport__subreport_id
msgid "Subreport"
msgstr ""

View File

@ -0,0 +1,5 @@
# Copyright (C) 2019 IBM Corp.
# Copyright (C) 2019 Open Source Integrators
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import ir_action_report

View File

@ -0,0 +1,108 @@
# Copyright (C) 2019 IBM Corp.
# Copyright (C) 2019 Open Source Integrators
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import random
from odoo import api, fields, models
class IrActionsReportSubreport(models.Model):
_name = "ir.actions.report.subreport"
_description = "Report Subreport"
_order = "sequence"
parent_report_id = fields.Many2one("ir.actions.report", ondelete="cascade")
sequence = fields.Integer(default=10)
model = fields.Char(related="parent_report_id.model")
subreport_id = fields.Many2one(
"ir.actions.report", string="Subreport", required=True
)
class IrActionsReport(models.Model):
_inherit = "ir.actions.report"
subreport_ids = fields.One2many("ir.actions.report.subreport", "parent_report_id")
def generate_top_part(self):
return (
"""<?xml version="1.0"?>\n\t<t t-name="%s">\n\t
"""
% self.report_name
)
def generate_bottom_part(self):
return """\n
\t\t</t>\n\t\t"""
def generate_custom_content(self, report_name):
return (
"""\n
\t<t t-call="%s"/>"""
% report_name
)
def _generate_batch_qweb_report(self, update_batch_qweb=False):
report_name = self.report_name
if "." in report_name:
module = self.report_name.split(".")[0]
report_name = self.report_name.split(".")[1]
else:
# Generate random number to avoid IntegrityError
module = random.randint(1, 1000000)
self.report_name = "{}.{}".format(module, report_name)
if self.subreport_ids:
if update_batch_qweb:
report_name = self.report_name.split(".")[1]
# Delete old Qweb batch report
model_data = self.env["ir.model.data"].search(
[("res_id", "=", self.id)]
)
model_data.unlink()
ui_view = self.env["ir.ui.view"].search([("name", "=", report_name)])
ui_view.unlink()
template_header = self.generate_top_part()
template_footer = self.generate_bottom_part()
template_content = ""
for subreport in self.subreport_ids:
template_content += self.generate_custom_content(
subreport.subreport_id.report_name
)
data = "{}{}{}".format(template_header, template_content, template_footer)
ui_view = self.env["ir.ui.view"].create(
{
"name": report_name,
"type": "qweb",
"model": self.model,
"mode": "primary",
"arch_base": data,
}
)
self.env["ir.model.data"].create(
{
"module": module,
"name": report_name,
"res_id": ui_view.id,
"model": "ir.ui.view",
}
)
# Register batch report option
if not self.binding_model_id:
self.create_action()
return True
@api.model
def create(self, vals):
res = super(IrActionsReport, self).create(vals)
for report in res:
report._generate_batch_qweb_report()
return res
def write(self, vals):
res = super(IrActionsReport, self).write(vals)
if "subreport_ids" in vals or "model" in vals:
for report in self:
report._generate_batch_qweb_report(update_batch_qweb=True)
return res

View File

@ -0,0 +1,17 @@
We can configure this module in following two ways:
1st Way
=======
* Create a Report or edit existing report from Settings > Users & Companies >
Batch Reports
* Add sequence number and select parent report or design your own batch report.
* Select subreport to add reports and save it.
2st Way
=======
* Active developer mode. Go to Settings > Technical > Actions > Reports.
* Create or edit report and select related model.
* Jump on "Batch report" tab and add subreport one by one.
* Drag up and down and arrange a sequence of report. Save it.

View File

@ -0,0 +1,3 @@
* Bhavesh Odedra <bodedra@opensourceintegrators.com>
* Balaji Kannan <bkannan@opensourceintegrators.com>
* Daniel Reis <dreis@opensourceintegrators.com>

View File

@ -0,0 +1,3 @@
The development of this module has been financially supported by:
* Open Source Integrators

View File

@ -0,0 +1,3 @@
This module will allow to to print multiple QWeb reports in a single batch.
For example, picking, packing, reports needs to be printed together
in a single batch.

View File

@ -0,0 +1,15 @@
If we configure it like following values:
* Name = Picking Batch Report
* Model = Transfer
* Template Name = my.picking_batch_report
* Add subreport = Delivery Slip and Picking Operations
* Save it.
To get results:
* Go to Inventory > Operations > Transfers
* Open one record or select multi records.
* Click on "Print" option near by "Action".
* Print "Picking Batch Report"
* We will get delivery slip and picking operations report together.

View File

@ -0,0 +1,3 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_ir_actions_subreport_all,ir_actions_report_subreport,model_ir_actions_report_subreport,,1,0,0,0
access_ir_actions_subreport_group_system,ir_actions_report_subreport_group_system,model_ir_actions_report_subreport,base.group_system,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_ir_actions_subreport_all ir_actions_report_subreport model_ir_actions_report_subreport 1 0 0 0
3 access_ir_actions_subreport_group_system ir_actions_report_subreport_group_system model_ir_actions_report_subreport base.group_system 1 1 1 1

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

View File

@ -0,0 +1,478 @@
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
<title>Batch Report Printing</title>
<style type="text/css">
/*
:Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 7952 2016-07-26 18:15:59Z milde $
:Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
customize this style sheet.
*/
/* used to remove borders from tables and images */
.borderless, table.borderless td, table.borderless th {
border: 0 }
table.borderless td, table.borderless th {
/* Override padding for "table.docutils td" with "! important".
The right padding separates the table cells. */
padding: 0 0.5em 0 0 ! important }
.first {
/* Override more specific margin styles with "! important". */
margin-top: 0 ! important }
.last, .with-subtitle {
margin-bottom: 0 ! important }
.hidden {
display: none }
.subscript {
vertical-align: sub;
font-size: smaller }
.superscript {
vertical-align: super;
font-size: smaller }
a.toc-backref {
text-decoration: none ;
color: black }
blockquote.epigraph {
margin: 2em 5em ; }
dl.docutils dd {
margin-bottom: 0.5em }
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
overflow: hidden;
}
/* Uncomment (and remove this text!) to get bold-faced definition list terms
dl.docutils dt {
font-weight: bold }
*/
div.abstract {
margin: 2em 5em }
div.abstract p.topic-title {
font-weight: bold ;
text-align: center }
div.admonition, div.attention, div.caution, div.danger, div.error,
div.hint, div.important, div.note, div.tip, div.warning {
margin: 2em ;
border: medium outset ;
padding: 1em }
div.admonition p.admonition-title, div.hint p.admonition-title,
div.important p.admonition-title, div.note p.admonition-title,
div.tip p.admonition-title {
font-weight: bold ;
font-family: sans-serif }
div.attention p.admonition-title, div.caution p.admonition-title,
div.danger p.admonition-title, div.error p.admonition-title,
div.warning p.admonition-title, .code .error {
color: red ;
font-weight: bold ;
font-family: sans-serif }
/* Uncomment (and remove this text!) to get reduced vertical space in
compound paragraphs.
div.compound .compound-first, div.compound .compound-middle {
margin-bottom: 0.5em }
div.compound .compound-last, div.compound .compound-middle {
margin-top: 0.5em }
*/
div.dedication {
margin: 2em 5em ;
text-align: center ;
font-style: italic }
div.dedication p.topic-title {
font-weight: bold ;
font-style: normal }
div.figure {
margin-left: 2em ;
margin-right: 2em }
div.footer, div.header {
clear: both;
font-size: smaller }
div.line-block {
display: block ;
margin-top: 1em ;
margin-bottom: 1em }
div.line-block div.line-block {
margin-top: 0 ;
margin-bottom: 0 ;
margin-left: 1.5em }
div.sidebar {
margin: 0 0 0.5em 1em ;
border: medium outset ;
padding: 1em ;
background-color: #ffffee ;
width: 40% ;
float: right ;
clear: right }
div.sidebar p.rubric {
font-family: sans-serif ;
font-size: medium }
div.system-messages {
margin: 5em }
div.system-messages h1 {
color: red }
div.system-message {
border: medium outset ;
padding: 1em }
div.system-message p.system-message-title {
color: red ;
font-weight: bold }
div.topic {
margin: 2em }
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
margin-top: 0.4em }
h1.title {
text-align: center }
h2.subtitle {
text-align: center }
hr.docutils {
width: 75% }
img.align-left, .figure.align-left, object.align-left, table.align-left {
clear: left ;
float: left ;
margin-right: 1em }
img.align-right, .figure.align-right, object.align-right, table.align-right {
clear: right ;
float: right ;
margin-left: 1em }
img.align-center, .figure.align-center, object.align-center {
display: block;
margin-left: auto;
margin-right: auto;
}
table.align-center {
margin-left: auto;
margin-right: auto;
}
.align-left {
text-align: left }
.align-center {
clear: both ;
text-align: center }
.align-right {
text-align: right }
/* reset inner alignment in figures */
div.align-right {
text-align: inherit }
/* div.align-center * { */
/* text-align: left } */
.align-top {
vertical-align: top }
.align-middle {
vertical-align: middle }
.align-bottom {
vertical-align: bottom }
ol.simple, ul.simple {
margin-bottom: 1em }
ol.arabic {
list-style: decimal }
ol.loweralpha {
list-style: lower-alpha }
ol.upperalpha {
list-style: upper-alpha }
ol.lowerroman {
list-style: lower-roman }
ol.upperroman {
list-style: upper-roman }
p.attribution {
text-align: right ;
margin-left: 50% }
p.caption {
font-style: italic }
p.credits {
font-style: italic ;
font-size: smaller }
p.label {
white-space: nowrap }
p.rubric {
font-weight: bold ;
font-size: larger ;
color: maroon ;
text-align: center }
p.sidebar-title {
font-family: sans-serif ;
font-weight: bold ;
font-size: larger }
p.sidebar-subtitle {
font-family: sans-serif ;
font-weight: bold }
p.topic-title {
font-weight: bold }
pre.address {
margin-bottom: 0 ;
margin-top: 0 ;
font: inherit }
pre.literal-block, pre.doctest-block, pre.math, pre.code {
margin-left: 2em ;
margin-right: 2em }
pre.code .ln { color: grey; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
pre.code .literal.string, code .literal.string { color: #0C5404 }
pre.code .name.builtin, code .name.builtin { color: #352B84 }
pre.code .deleted, code .deleted { background-color: #DEB0A1}
pre.code .inserted, code .inserted { background-color: #A3D289}
span.classifier {
font-family: sans-serif ;
font-style: oblique }
span.classifier-delimiter {
font-family: sans-serif ;
font-weight: bold }
span.interpreted {
font-family: sans-serif }
span.option {
white-space: nowrap }
span.pre {
white-space: pre }
span.problematic {
color: red }
span.section-subtitle {
/* font-size relative to parent (h1..h6 element) */
font-size: 80% }
table.citation {
border-left: solid 1px gray;
margin-left: 1px }
table.docinfo {
margin: 2em 4em }
table.docutils {
margin-top: 0.5em ;
margin-bottom: 0.5em }
table.footnote {
border-left: solid 1px black;
margin-left: 1px }
table.docutils td, table.docutils th,
table.docinfo td, table.docinfo th {
padding-left: 0.5em ;
padding-right: 0.5em ;
vertical-align: top }
table.docutils th.field-name, table.docinfo th.docinfo-name {
font-weight: bold ;
text-align: left ;
white-space: nowrap ;
padding-left: 0 }
/* "booktabs" style (no vertical lines) */
table.docutils.booktabs {
border: 0px;
border-top: 2px solid;
border-bottom: 2px solid;
border-collapse: collapse;
}
table.docutils.booktabs * {
border: 0px;
}
table.docutils.booktabs th {
border-bottom: thin solid;
text-align: left;
}
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
font-size: 100% }
ul.auto-toc {
list-style-type: none }
</style>
</head>
<body>
<div class="document" id="batch-report-printing">
<h1 class="title">Batch Report Printing</h1>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/reporting-engine/tree/13.0/report_batch"><img alt="OCA/reporting-engine" src="https://img.shields.io/badge/github-OCA%2Freporting--engine-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/reporting-engine-13-0/reporting-engine-13-0-report_batch"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/143/13.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>This module will allow to to print multiple QWeb reports in a single batch.
For example, picking, packing, reports needs to be printed together
in a single batch.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#configuration" id="id2">Configuration</a></li>
<li><a class="reference internal" href="#st-way" id="id3">1st Way</a></li>
<li><a class="reference internal" href="#id1" id="id4">2st Way</a></li>
<li><a class="reference internal" href="#usage" id="id5">Usage</a></li>
<li><a class="reference internal" href="#bug-tracker" id="id6">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="id7">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="id8">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="id9">Contributors</a></li>
<li><a class="reference internal" href="#other-credits" id="id10">Other credits</a></li>
<li><a class="reference internal" href="#maintainers" id="id11">Maintainers</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="configuration">
<h1><a class="toc-backref" href="#id2">Configuration</a></h1>
<p>We can configure this module in following two ways:</p>
</div>
<div class="section" id="st-way">
<h1><a class="toc-backref" href="#id3">1st Way</a></h1>
<ul class="simple">
<li>Create a Report or edit existing report from Settings &gt; Users &amp; Companies &gt;
Batch Reports</li>
<li>Add sequence number and select parent report or design your own batch report.</li>
<li>Select subreport to add reports and save it.</li>
</ul>
</div>
<div class="section" id="id1">
<h1><a class="toc-backref" href="#id4">2st Way</a></h1>
<ul class="simple">
<li>Active developer mode. Go to Settings &gt; Technical &gt; Actions &gt; Reports.</li>
<li>Create or edit report and select related model.</li>
<li>Jump on “Batch report” tab and add subreport one by one.</li>
<li>Drag up and down and arrange a sequence of report. Save it.</li>
</ul>
</div>
<div class="section" id="usage">
<h1><a class="toc-backref" href="#id5">Usage</a></h1>
<p>If we configure it like following values:</p>
<ul class="simple">
<li>Name = Picking Batch Report</li>
<li>Model = Transfer</li>
<li>Template Name = my.picking_batch_report</li>
<li>Add subreport = Delivery Slip and Picking Operations</li>
<li>Save it.</li>
</ul>
<p>To get results:</p>
<ul class="simple">
<li>Go to Inventory &gt; Operations &gt; Transfers</li>
<li>Open one record or select multi records.</li>
<li>Click on “Print” option near by “Action”.</li>
<li>Print “Picking Batch Report”</li>
<li>We will get delivery slip and picking operations report together.</li>
</ul>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#id6">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/reporting-engine/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/reporting-engine/issues/new?body=module:%20report_batch%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
<h1><a class="toc-backref" href="#id7">Credits</a></h1>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#id8">Authors</a></h2>
<ul class="simple">
<li>Open Source Integrators</li>
</ul>
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#id9">Contributors</a></h2>
<ul class="simple">
<li>Bhavesh Odedra &lt;<a class="reference external" href="mailto:bodedra&#64;opensourceintegrators.com">bodedra&#64;opensourceintegrators.com</a>&gt;</li>
<li>Balaji Kannan &lt;<a class="reference external" href="mailto:bkannan&#64;opensourceintegrators.com">bkannan&#64;opensourceintegrators.com</a>&gt;</li>
<li>Daniel Reis &lt;<a class="reference external" href="mailto:dreis&#64;opensourceintegrators.com">dreis&#64;opensourceintegrators.com</a>&gt;</li>
</ul>
</div>
<div class="section" id="other-credits">
<h2><a class="toc-backref" href="#id10">Other credits</a></h2>
<p>The development of this module has been financially supported by:</p>
<ul class="simple">
<li>Open Source Integrators</li>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#id11">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.</p>
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
<p><a class="reference external" href="https://github.com/bodedra"><img alt="bodedra" src="https://github.com/bodedra.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/reporting-engine/tree/13.0/report_batch">OCA/reporting-engine</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,5 @@
# Copyright (C) 2020 IBM Corp.
# Copyright (C) 2020 Open Source Integrators
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import test_report_batch

View File

@ -0,0 +1,36 @@
# Copyright (C) 2019 IBM Corp.
# Copyright (C) 2019 Open Source Integrators
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import odoo.tests.common as test_common
class TestReportBatch(test_common.SingleTransactionCase):
def setUp(self):
super(TestReportBatch, self).setUp()
self.report_picking_operations = self.env.ref("stock.action_report_picking")
self.report_deliveryslip = self.env.ref("stock.report_deliveryslip")
def test_report_batch(self):
report_batch = self.env["ir.actions.report"].create(
{
"name": "Batch Report",
"report_type": "qweb-pdf",
"model": "stock.picking",
"report_name": "my_custom_batch_report",
}
)
report_batch.write(
{
"subreport_ids": [
(
6,
0,
[
self.report_picking_operations.id,
self.report_deliveryslip.id,
],
)
]
}
)

View File

@ -0,0 +1,50 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="act_batch_report_xml_view" model="ir.ui.view">
<field name="name">ir.actions.batch.report.form</field>
<field name="model">ir.actions.report</field>
<field name="inherit_id" ref="base.act_report_xml_view" />
<field name="arch" type="xml">
<field name="report_type" position="after">
<field name="model_id" />
</field>
<page name="advanced" position="after">
<page name="batch_report" string="Batch Report">
<field name="subreport_ids">
<tree string="Batch Reports" editable="bottom">
<field name="sequence" widget="handle" />
<field
name="subreport_id"
domain="[('model', '=', parent.model)]"
/>
</tree>
</field>
</page>
</page>
</field>
</record>
<record id="view_ir_actions_subreport_tree" model="ir.ui.view">
<field name="name">ir.actions.report.subreport.tree</field>
<field name="model">ir.actions.report.subreport</field>
<field name="arch" type="xml">
<tree string="Batch Reports" editable="bottom">
<field name="sequence" />
<field name="parent_report_id" />
<field name="model" invisible="1" />
<field name="subreport_id" domain="[('model', '=', model)]" />
</tree>
</field>
</record>
<record id="action_ir_actions_subreport" model="ir.actions.act_window">
<field name="name">Batch Reports</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">ir.actions.report.subreport</field>
<field name="help">Allows to add multi QWeb reports in a single batch</field>
</record>
<menuitem
action="action_ir_actions_subreport"
id="menu_action_ir_actions_subreport"
parent="base.menu_users"
sequence="10"
/>
</odoo>

View File

@ -0,0 +1,117 @@
===============
Base report csv
===============
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Freporting--engine-lightgray.png?logo=github
:target: https://github.com/OCA/reporting-engine/tree/13.0/report_csv
:alt: OCA/reporting-engine
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/reporting-engine-13-0/reporting-engine-13-0-report_csv
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/143/13.0
:alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5|
This module provides a basic report class to generate csv report.
**Table of contents**
.. contents::
:local:
Usage
=====
An example of CSV report for partners on a module called `module_name`:
A python class ::
from odoo import models
class PartnerCSV(models.AbstractModel):
_name = 'report.report_csv.partner_csv'
_inherit = 'report.report_csv.abstract'
def generate_csv_report(self, writer, data, partners):
writer.writeheader()
for obj in partners:
writer.writerow({
'name': obj.name,
'email': obj.email,
})
def csv_report_options(self):
res = super().csv_report_options()
res['fieldnames'].append('name')
res['fieldnames'].append('email')
res['delimiter'] = ';'
res['quoting'] = csv.QUOTE_ALL
return res
A report XML record ::
<report
id="partner_csv"
model="res.partner"
string="Print to CSV"
report_type="csv"
name="module_name.report_name"
file="res_partner"
attachment_use="False"
/>
Bug Tracker
===========
Bugs are tracked on `GitHub Issues <https://github.com/OCA/reporting-engine/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/reporting-engine/issues/new?body=module:%20report_csv%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues.
Credits
=======
Authors
~~~~~~~
* Creu Blanca
Contributors
~~~~~~~~~~~~
* Enric Tobella <etobella@creublanca.es>
* Jaime Arroyo <jaime.arroyo@creublanca.es>
* Rattapong Chokmasermkul <rattapongc@ecosoft.co.th>
Maintainers
~~~~~~~~~~~
This module is maintained by the OCA.
.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org
OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
This module is part of the `OCA/reporting-engine <https://github.com/OCA/reporting-engine/tree/13.0/report_csv>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View File

@ -0,0 +1,3 @@
from . import controllers
from . import models
from . import report

View File

@ -0,0 +1,16 @@
# Copyright 2019 Creu Blanca
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Base report csv",
"summary": "Base module to create csv report",
"author": "Creu Blanca, Odoo Community Association (OCA)",
"website": "https://github.com/oca/reporting-engine",
"category": "Reporting",
"version": "13.0.1.0.1",
"license": "AGPL-3",
"external_dependencies": {"python": ["csv"]},
"depends": ["base", "web"],
"data": ["views/webclient_templates.xml"],
"demo": ["demo/report.xml"],
"installable": True,
}

View File

@ -0,0 +1 @@
from . import main

View File

@ -0,0 +1,57 @@
# Copyright (C) 2019 Creu Blanca
# License AGPL-3.0 or later (https://www.gnuorg/licenses/agpl.html).
import json
import time
from odoo.http import content_disposition, request, route
from odoo.tools.safe_eval import safe_eval
from odoo.addons.web.controllers import main as report
class ReportController(report.ReportController):
@route()
def report_routes(self, reportname, docids=None, converter=None, **data):
if converter == "csv":
report = request.env["ir.actions.report"]._get_report_from_name(reportname)
context = dict(request.env.context)
if docids:
docids = [int(i) for i in docids.split(",")]
if data.get("options"):
data.update(json.loads(data.pop("options")))
if data.get("context"):
# Ignore 'lang' here, because the context in data is the one
# from the webclient *but* if the user explicitely wants to
# change the lang, this mechanism overwrites it.
data["context"] = json.loads(data["context"])
if data["context"].get("lang"):
del data["context"]["lang"]
context.update(data["context"])
csv = report.with_context(context).render_csv(docids, data=data)[0]
filename = "{}.{}".format(report.name, "csv")
if docids:
obj = request.env[report.model].browse(docids)
if report.print_report_name and not len(obj) > 1:
report_name = safe_eval(
report.print_report_name,
{"object": obj, "time": time, "multi": False},
)
filename = "{}.{}".format(report_name, "csv")
# When we print multiple records we still allow a custom
# filename.
elif report.print_report_name and len(obj) > 1:
report_name = safe_eval(
report.print_report_name,
{"objects": obj, "time": time, "multi": True},
)
filename = "{}.{}".format(report_name, "csv")
csvhttpheaders = [
("Content-Type", "text/csv"),
("Content-Length", len(csv)),
("Content-Disposition", content_disposition(filename)),
]
return request.make_response(csv, headers=csvhttpheaders)
return super(ReportController, self).report_routes(
reportname, docids, converter, **data
)

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<!--
Copyright 2019 Creu Blanca
License AGPL-3.0 or later (https://www.gnuorg/licenses/agpl.html).
-->
<report
id="partner_csv"
model="res.partner"
string="Print to CSV"
report_type="csv"
name="report_csv.partner_csv"
file="res_partner"
attachment_use="False"
/>
</odoo>

View File

@ -0,0 +1,93 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * report_csv
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: report_csv
#: code:addons/report_csv/models/ir_report.py:0
#, python-format
msgid "%s model was not found"
msgstr ""
#. module: report_csv
#. openerp-web
#: code:addons/report_csv/static/src/js/report/qwebactionmanager.js:0
#, python-format
msgid ""
"A popup window with your report was blocked. You may need to change your "
"browser settings to allow popup windows for this page."
msgstr ""
#. module: report_csv
#: model:ir.model,name:report_csv.model_report_report_csv_abstract
msgid "Abstract Model for CSV reports"
msgstr ""
#. module: report_csv
#: model:ir.model.fields,field_description:report_csv.field_report_report_csv_abstract__display_name
#: model:ir.model.fields,field_description:report_csv.field_report_report_csv_partner_csv__display_name
msgid "Display Name"
msgstr ""
#. module: report_csv
#: model:ir.model.fields,field_description:report_csv.field_report_report_csv_abstract__id
#: model:ir.model.fields,field_description:report_csv.field_report_report_csv_partner_csv__id
msgid "ID"
msgstr ""
#. module: report_csv
#: model:ir.model.fields,field_description:report_csv.field_report_report_csv_abstract____last_update
#: model:ir.model.fields,field_description:report_csv.field_report_report_csv_partner_csv____last_update
msgid "Last Modified on"
msgstr ""
#. module: report_csv
#: model:ir.actions.report,name:report_csv.partner_csv
msgid "Print to CSV"
msgstr ""
#. module: report_csv
#: model:ir.model,name:report_csv.model_ir_actions_report
msgid "Report Action"
msgstr ""
#. module: report_csv
#: model:ir.model,name:report_csv.model_report_report_csv_partner_csv
msgid "Report Partner to CSV"
msgstr ""
#. module: report_csv
#: model:ir.model.fields,field_description:report_csv.field_ir_actions_report__report_type
msgid "Report Type"
msgstr ""
#. module: report_csv
#: model:ir.model.fields,help:report_csv.field_ir_actions_report__report_type
msgid ""
"The type of the report that will be rendered, each one having its own "
"rendering method. HTML means the report will be opened directly in your "
"browser PDF means the report will be rendered using Wkhtmltopdf and "
"downloaded by the user."
msgstr ""
#. module: report_csv
#. openerp-web
#: code:addons/report_csv/static/src/js/report/qwebactionmanager.js:0
#, python-format
msgid "Warning"
msgstr ""
#. module: report_csv
#: model:ir.model.fields.selection,name:report_csv.selection__ir_actions_report__report_type__csv
msgid "csv"
msgstr ""

View File

@ -0,0 +1 @@
from . import ir_report

View File

@ -0,0 +1,35 @@
# Copyright 2019 Creu Blanca
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import _, api, fields, models
from odoo.exceptions import UserError
class ReportAction(models.Model):
_inherit = "ir.actions.report"
report_type = fields.Selection(selection_add=[("csv", "csv")])
@api.model
def render_csv(self, docids, data):
report_model_name = "report.%s" % self.report_name
report_model = self.env.get(report_model_name)
if report_model is None:
raise UserError(_("%s model was not found" % report_model_name))
return report_model.with_context(
{"active_model": self.model}
).create_csv_report(docids, data)
@api.model
def _get_report_from_name(self, report_name):
res = super(ReportAction, self)._get_report_from_name(report_name)
if res:
return res
report_obj = self.env["ir.actions.report"]
qwebtypes = ["csv"]
conditions = [
("report_type", "in", qwebtypes),
("report_name", "=", report_name),
]
context = self.env["res.users"].context_get()
return report_obj.with_context(context).search(conditions, limit=1)

View File

@ -0,0 +1,3 @@
* Enric Tobella <etobella@creublanca.es>
* Jaime Arroyo <jaime.arroyo@creublanca.es>
* Rattapong Chokmasermkul <rattapongc@ecosoft.co.th>

View File

@ -0,0 +1 @@
This module provides a basic report class to generate csv report.

View File

@ -0,0 +1,38 @@
An example of CSV report for partners on a module called `module_name`:
A python class ::
from odoo import models
class PartnerCSV(models.AbstractModel):
_name = 'report.report_csv.partner_csv'
_inherit = 'report.report_csv.abstract'
def generate_csv_report(self, writer, data, partners):
writer.writeheader()
for obj in partners:
writer.writerow({
'name': obj.name,
'email': obj.email,
})
def csv_report_options(self):
res = super().csv_report_options()
res['fieldnames'].append('name')
res['fieldnames'].append('email')
res['delimiter'] = ';'
res['quoting'] = csv.QUOTE_ALL
return res
A report XML record ::
<report
id="partner_csv"
model="res.partner"
string="Print to CSV"
report_type="csv"
name="module_name.report_name"
file="res_partner"
attachment_use="False"
/>

View File

@ -0,0 +1,2 @@
from . import report_csv
from . import report_partner_csv

View File

@ -0,0 +1,61 @@
# Copyright 2019 Creu Blanca
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
import logging
from io import StringIO
from odoo import models
_logger = logging.getLogger(__name__)
try:
import csv
except ImportError:
_logger.debug("Can not import csvwriter`.")
class ReportCSVAbstract(models.AbstractModel):
_name = "report.report_csv.abstract"
_description = "Abstract Model for CSV reports"
def _get_objs_for_report(self, docids, data):
"""
Returns objects for csv report. From WebUI these
are either as docids taken from context.active_ids or
in the case of wizard are in data. Manual calls may rely
on regular context, setting docids, or setting data.
:param docids: list of integers, typically provided by
qwebactionmanager for regular Models.
:param data: dictionary of data, if present typically provided
by qwebactionmanager for TransientModels.
:param ids: list of integers, provided by overrides.
:return: recordset of active model for ids.
"""
if docids:
ids = docids
elif data and "context" in data:
ids = data["context"].get("active_ids", [])
else:
ids = self.env.context.get("active_ids", [])
return self.env[self.env.context.get("active_model")].browse(ids)
def create_csv_report(self, docids, data):
objs = self._get_objs_for_report(docids, data)
file_data = StringIO()
file = csv.DictWriter(file_data, **self.csv_report_options())
self.generate_csv_report(file, data, objs)
file_data.seek(0)
return file_data.read(), "csv"
def csv_report_options(self):
"""
:return: dictionary of parameters. At least return 'fieldnames', but
you can optionally return parameters that define the export format.
Valid parameters include 'delimiter', 'quotechar', 'escapechar',
'doublequote', 'skipinitialspace', 'lineterminator', 'quoting'.
"""
return {"fieldnames": []}
def generate_csv_report(self, file, data, objs):
raise NotImplementedError()

View File

@ -0,0 +1,24 @@
# Copyright 2019 Creu Blanca
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
import csv
from odoo import models
class PartnerCSV(models.AbstractModel):
_name = "report.report_csv.partner_csv"
_inherit = "report.report_csv.abstract"
_description = "Report Partner to CSV"
def generate_csv_report(self, writer, data, partners):
writer.writeheader()
for obj in partners:
writer.writerow({"name": obj.name, "email": obj.email})
def csv_report_options(self):
res = super().csv_report_options()
res["fieldnames"].append("name")
res["fieldnames"].append("email")
res["delimiter"] = ";"
res["quoting"] = csv.QUOTE_ALL
return res

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

View File

@ -0,0 +1,462 @@
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
<title>Base report csv</title>
<style type="text/css">
/*
:Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 7952 2016-07-26 18:15:59Z milde $
:Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
customize this style sheet.
*/
/* used to remove borders from tables and images */
.borderless, table.borderless td, table.borderless th {
border: 0 }
table.borderless td, table.borderless th {
/* Override padding for "table.docutils td" with "! important".
The right padding separates the table cells. */
padding: 0 0.5em 0 0 ! important }
.first {
/* Override more specific margin styles with "! important". */
margin-top: 0 ! important }
.last, .with-subtitle {
margin-bottom: 0 ! important }
.hidden {
display: none }
.subscript {
vertical-align: sub;
font-size: smaller }
.superscript {
vertical-align: super;
font-size: smaller }
a.toc-backref {
text-decoration: none ;
color: black }
blockquote.epigraph {
margin: 2em 5em ; }
dl.docutils dd {
margin-bottom: 0.5em }
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
overflow: hidden;
}
/* Uncomment (and remove this text!) to get bold-faced definition list terms
dl.docutils dt {
font-weight: bold }
*/
div.abstract {
margin: 2em 5em }
div.abstract p.topic-title {
font-weight: bold ;
text-align: center }
div.admonition, div.attention, div.caution, div.danger, div.error,
div.hint, div.important, div.note, div.tip, div.warning {
margin: 2em ;
border: medium outset ;
padding: 1em }
div.admonition p.admonition-title, div.hint p.admonition-title,
div.important p.admonition-title, div.note p.admonition-title,
div.tip p.admonition-title {
font-weight: bold ;
font-family: sans-serif }
div.attention p.admonition-title, div.caution p.admonition-title,
div.danger p.admonition-title, div.error p.admonition-title,
div.warning p.admonition-title, .code .error {
color: red ;
font-weight: bold ;
font-family: sans-serif }
/* Uncomment (and remove this text!) to get reduced vertical space in
compound paragraphs.
div.compound .compound-first, div.compound .compound-middle {
margin-bottom: 0.5em }
div.compound .compound-last, div.compound .compound-middle {
margin-top: 0.5em }
*/
div.dedication {
margin: 2em 5em ;
text-align: center ;
font-style: italic }
div.dedication p.topic-title {
font-weight: bold ;
font-style: normal }
div.figure {
margin-left: 2em ;
margin-right: 2em }
div.footer, div.header {
clear: both;
font-size: smaller }
div.line-block {
display: block ;
margin-top: 1em ;
margin-bottom: 1em }
div.line-block div.line-block {
margin-top: 0 ;
margin-bottom: 0 ;
margin-left: 1.5em }
div.sidebar {
margin: 0 0 0.5em 1em ;
border: medium outset ;
padding: 1em ;
background-color: #ffffee ;
width: 40% ;
float: right ;
clear: right }
div.sidebar p.rubric {
font-family: sans-serif ;
font-size: medium }
div.system-messages {
margin: 5em }
div.system-messages h1 {
color: red }
div.system-message {
border: medium outset ;
padding: 1em }
div.system-message p.system-message-title {
color: red ;
font-weight: bold }
div.topic {
margin: 2em }
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
margin-top: 0.4em }
h1.title {
text-align: center }
h2.subtitle {
text-align: center }
hr.docutils {
width: 75% }
img.align-left, .figure.align-left, object.align-left, table.align-left {
clear: left ;
float: left ;
margin-right: 1em }
img.align-right, .figure.align-right, object.align-right, table.align-right {
clear: right ;
float: right ;
margin-left: 1em }
img.align-center, .figure.align-center, object.align-center {
display: block;
margin-left: auto;
margin-right: auto;
}
table.align-center {
margin-left: auto;
margin-right: auto;
}
.align-left {
text-align: left }
.align-center {
clear: both ;
text-align: center }
.align-right {
text-align: right }
/* reset inner alignment in figures */
div.align-right {
text-align: inherit }
/* div.align-center * { */
/* text-align: left } */
.align-top {
vertical-align: top }
.align-middle {
vertical-align: middle }
.align-bottom {
vertical-align: bottom }
ol.simple, ul.simple {
margin-bottom: 1em }
ol.arabic {
list-style: decimal }
ol.loweralpha {
list-style: lower-alpha }
ol.upperalpha {
list-style: upper-alpha }
ol.lowerroman {
list-style: lower-roman }
ol.upperroman {
list-style: upper-roman }
p.attribution {
text-align: right ;
margin-left: 50% }
p.caption {
font-style: italic }
p.credits {
font-style: italic ;
font-size: smaller }
p.label {
white-space: nowrap }
p.rubric {
font-weight: bold ;
font-size: larger ;
color: maroon ;
text-align: center }
p.sidebar-title {
font-family: sans-serif ;
font-weight: bold ;
font-size: larger }
p.sidebar-subtitle {
font-family: sans-serif ;
font-weight: bold }
p.topic-title {
font-weight: bold }
pre.address {
margin-bottom: 0 ;
margin-top: 0 ;
font: inherit }
pre.literal-block, pre.doctest-block, pre.math, pre.code {
margin-left: 2em ;
margin-right: 2em }
pre.code .ln { color: grey; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
pre.code .literal.string, code .literal.string { color: #0C5404 }
pre.code .name.builtin, code .name.builtin { color: #352B84 }
pre.code .deleted, code .deleted { background-color: #DEB0A1}
pre.code .inserted, code .inserted { background-color: #A3D289}
span.classifier {
font-family: sans-serif ;
font-style: oblique }
span.classifier-delimiter {
font-family: sans-serif ;
font-weight: bold }
span.interpreted {
font-family: sans-serif }
span.option {
white-space: nowrap }
span.pre {
white-space: pre }
span.problematic {
color: red }
span.section-subtitle {
/* font-size relative to parent (h1..h6 element) */
font-size: 80% }
table.citation {
border-left: solid 1px gray;
margin-left: 1px }
table.docinfo {
margin: 2em 4em }
table.docutils {
margin-top: 0.5em ;
margin-bottom: 0.5em }
table.footnote {
border-left: solid 1px black;
margin-left: 1px }
table.docutils td, table.docutils th,
table.docinfo td, table.docinfo th {
padding-left: 0.5em ;
padding-right: 0.5em ;
vertical-align: top }
table.docutils th.field-name, table.docinfo th.docinfo-name {
font-weight: bold ;
text-align: left ;
white-space: nowrap ;
padding-left: 0 }
/* "booktabs" style (no vertical lines) */
table.docutils.booktabs {
border: 0px;
border-top: 2px solid;
border-bottom: 2px solid;
border-collapse: collapse;
}
table.docutils.booktabs * {
border: 0px;
}
table.docutils.booktabs th {
border-bottom: thin solid;
text-align: left;
}
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
font-size: 100% }
ul.auto-toc {
list-style-type: none }
</style>
</head>
<body>
<div class="document" id="base-report-csv">
<h1 class="title">Base report csv</h1>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/reporting-engine/tree/13.0/report_csv"><img alt="OCA/reporting-engine" src="https://img.shields.io/badge/github-OCA%2Freporting--engine-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/reporting-engine-13-0/reporting-engine-13-0-report_csv"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/143/13.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>This module provides a basic report class to generate csv report.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#usage" id="id1">Usage</a></li>
<li><a class="reference internal" href="#bug-tracker" id="id2">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="id3">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="id4">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="id5">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="id6">Maintainers</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="usage">
<h1><a class="toc-backref" href="#id1">Usage</a></h1>
<p>An example of CSV report for partners on a module called <cite>module_name</cite>:</p>
<p>A python class</p>
<pre class="literal-block">
from odoo import models
class PartnerCSV(models.AbstractModel):
_name = 'report.report_csv.partner_csv'
_inherit = 'report.report_csv.abstract'
def generate_csv_report(self, writer, data, partners):
writer.writeheader()
for obj in partners:
writer.writerow({
'name': obj.name,
'email': obj.email,
})
def csv_report_options(self):
res = super().csv_report_options()
res['fieldnames'].append('name')
res['fieldnames'].append('email')
res['delimiter'] = ';'
res['quoting'] = csv.QUOTE_ALL
return res
</pre>
<p>A report XML record</p>
<pre class="literal-block">
&lt;report
id=&quot;partner_csv&quot;
model=&quot;res.partner&quot;
string=&quot;Print to CSV&quot;
report_type=&quot;csv&quot;
name=&quot;module_name.report_name&quot;
file=&quot;res_partner&quot;
attachment_use=&quot;False&quot;
/&gt;
</pre>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#id2">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/reporting-engine/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/reporting-engine/issues/new?body=module:%20report_csv%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
<h1><a class="toc-backref" href="#id3">Credits</a></h1>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#id4">Authors</a></h2>
<ul class="simple">
<li>Creu Blanca</li>
</ul>
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#id5">Contributors</a></h2>
<ul class="simple">
<li>Enric Tobella &lt;<a class="reference external" href="mailto:etobella&#64;creublanca.es">etobella&#64;creublanca.es</a>&gt;</li>
<li>Jaime Arroyo &lt;<a class="reference external" href="mailto:jaime.arroyo&#64;creublanca.es">jaime.arroyo&#64;creublanca.es</a>&gt;</li>
<li>Rattapong Chokmasermkul &lt;<a class="reference external" href="mailto:rattapongc&#64;ecosoft.co.th">rattapongc&#64;ecosoft.co.th</a>&gt;</li>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#id6">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/reporting-engine/tree/13.0/report_csv">OCA/reporting-engine</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,97 @@
// © 2019 Creu Blanca
// License AGPL-3.0 or later (https://www.gnuorg/licenses/agpl.html).
odoo.define("report_csv.report", function(require) {
"use strict";
var core = require("web.core");
var ActionManager = require("web.ActionManager");
var framework = require("web.framework");
var session = require("web.session");
var _t = core._t;
ActionManager.include({
_downloadReportCSV: function(url, actions) {
var self = this;
framework.blockUI();
var type = "csv";
var cloned_action = _.clone(actions);
if (
_.isUndefined(cloned_action.data) ||
_.isNull(cloned_action.data) ||
(_.isObject(cloned_action.data) && _.isEmpty(cloned_action.data))
) {
if (cloned_action.context.active_ids) {
url += "/" + cloned_action.context.active_ids.join(",");
}
} else {
url +=
"?options=" +
encodeURIComponent(JSON.stringify(cloned_action.data));
url +=
"&context=" +
encodeURIComponent(JSON.stringify(cloned_action.context));
}
return new Promise(function(resolve, reject) {
var blocked = !session.get_file({
url: url,
data: {
data: JSON.stringify([url, type]),
},
success: resolve,
error: error => {
self.call("crash_manager", "rpc_error", error);
reject();
},
complete: framework.unblockUI,
});
if (blocked) {
// AAB: this check should be done in get_file service directly,
// should not be the concern of the caller (and that way, get_file
// could return a deferred)
var message = _t(
"A popup window with your report was blocked. You " +
"may need to change your browser settings to allow " +
"popup windows for this page."
);
this.do_warn(_t("Warning"), message, true);
}
});
},
_triggerDownload: function(action, options, type) {
var self = this;
var reportUrls = this._makeReportUrls(action);
if (type === "csv") {
return this._downloadReportCSV(reportUrls[type], action).then(
function() {
if (action.close_on_report_download) {
var closeAction = {type: "ir.actions.act_window_close"};
return self.doAction(
closeAction,
_.pick(options, "on_close")
);
}
return options.on_close();
}
);
}
return this._super.apply(this, arguments);
},
_makeReportUrls: function(action) {
var reportUrls = this._super.apply(this, arguments);
reportUrls.csv = "/report/csv/" + action.report_name;
return reportUrls;
},
_executeReportAction: function(action, options) {
var self = this;
if (action.report_type === "csv") {
return self._triggerDownload(action, options, "csv");
}
return this._super.apply(this, arguments);
},
});
});

View File

@ -0,0 +1 @@
from . import test_report

View File

@ -0,0 +1,58 @@
# Copyright 2019 Creu Blanca
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
import logging
from io import StringIO
from odoo.tests import common
_logger = logging.getLogger(__name__)
try:
import csv
except ImportError:
_logger.debug("Can not import csv.")
class TestReport(common.TransactionCase):
def setUp(self):
super().setUp()
report_object = self.env["ir.actions.report"]
self.csv_report = self.env["report.report_csv.abstract"].with_context(
active_model="res.partner"
)
self.report_name = "report_csv.partner_csv"
self.report = report_object._get_report_from_name(self.report_name)
self.docs = self.env["res.company"].search([], limit=1).partner_id
def test_report(self):
# Test if not res:
self.env["ir.actions.report"]._get_report_from_name("TEST")
report = self.report
self.assertEqual(report.report_type, "csv")
rep = report.render(self.docs.ids, {})
str_io = StringIO(rep[0])
dict_report = list(csv.DictReader(str_io, delimiter=";", quoting=csv.QUOTE_ALL))
self.assertEqual(self.docs.name, dict(dict_report[0])["name"])
def test_id_retrieval(self):
# Typical call from WebUI with wizard
objs = self.csv_report._get_objs_for_report(
False, {"context": {"active_ids": self.docs.ids}}
)
self.assertEquals(objs, self.docs)
# Typical call from within code not to report_action
objs = self.csv_report.with_context(
active_ids=self.docs.ids
)._get_objs_for_report(False, False)
self.assertEquals(objs, self.docs)
# Typical call from WebUI
objs = self.csv_report._get_objs_for_report(
self.docs.ids, {"data": [self.report_name, self.report.report_type]}
)
self.assertEquals(objs, self.docs)
# Typical call from render
objs = self.csv_report._get_objs_for_report(self.docs.ids, {})
self.assertEquals(objs, self.docs)

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<!--
© 2019 Creu Blanca
License AGPL-3.0 or later (https://www.gnuorg/licenses/agpl.html).
-->
<template id="assets_backend" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<script
type="text/javascript"
src="/report_csv/static/src/js/report/qwebactionmanager.js"
/>
</xpath>
</template>
</odoo>

View File

@ -0,0 +1,111 @@
==============
Web QR Manager
==============
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Freporting--engine-lightgray.png?logo=github
:target: https://github.com/OCA/reporting-engine/tree/13.0/report_qr
:alt: OCA/reporting-engine
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/reporting-engine-13-0/reporting-engine-13-0-report_qr
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/143/13.0
:alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5|
This module allows to print QR in better structure than the standard odoo.
The original image looks like the following
.. figure:: https://raw.githubusercontent.com/OCA/reporting-engine/13.0/report_qr/static/description/old_qr.png
:alt: Original QR
:width: 100 px
With the new generator, it looks like:
.. figure:: https://raw.githubusercontent.com/OCA/reporting-engine/13.0/report_qr/static/description/new_qr.png
:alt: New QR
:width: 100 px
**Table of contents**
.. contents::
:local:
Usage
=====
When creating new reports, you should use a path like the following::
<img t-att-src="'/report/qr/?value=%s&amp;error_correction=%s' % ('HELLO WORLD!', 3)" style="width:100;height:100"/>
The **error_correction** parameter controls the error correction used for the QR Code. The following four constants are made available:
* **error_correction** = 1: About 7% or less errors can be corrected.
* **error_correction** = 0: About 15% or less errors can be corrected.
* **error_correction** = 3: About 25% or less errors can be corrected.
* **error_correction** = 2: About 30% or less errors can be corrected.
The **box_size** parameter controls how many pixels each "box" of the QR code is. The default is 3.
The **border** parameter controls how many boxes thick the border should be (the default is 4, which is the minimum according to the specs).
The **version** parameter is an integer from 1 to 40 that controls the size of the QR Code (the smallest, version 1, is a 21x21 matrix). Set to None and use the fit parameter when making the code to determine this automatically.
**fill_color** and **back_color** can change the background and the painting color of the QR, when using the default image factory.
Bug Tracker
===========
Bugs are tracked on `GitHub Issues <https://github.com/OCA/reporting-engine/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/reporting-engine/issues/new?body=module:%20report_qr%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues.
Credits
=======
Authors
~~~~~~~
* Creu Blanca
Contributors
~~~~~~~~~~~~
* Enric Tobella <etobella@creublanca.es>
* `Tecnativa <https://www.tecnativa.com>`_:
* David Vidal
Maintainers
~~~~~~~~~~~
This module is maintained by the OCA.
.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org
OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
This module is part of the `OCA/reporting-engine <https://github.com/OCA/reporting-engine/tree/13.0/report_qr>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View File

@ -0,0 +1,2 @@
from . import controllers
from . import models

View File

@ -0,0 +1,14 @@
# Copyright 2019 Creu Blanca
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Web QR Manager",
"version": "13.0.1.0.0",
"author": "Creu Blanca, " "Odoo Community Association (OCA)",
"category": "Reporting",
"website": "https://github.com/OCA/reporting-engine",
"license": "AGPL-3",
"depends": ["web"],
"data": [],
"installable": True,
}

View File

@ -0,0 +1 @@
from . import qr

View File

@ -0,0 +1,22 @@
import werkzeug
from odoo import http
from odoo.http import request
class Home(http.Controller):
@http.route("/report/qr", type="http", auth="public")
def report_qr(self, value, box_size=3, border=3, factory="png", **kwargs):
try:
barcode = request.env["ir.actions.report"].qr_generate(
value, box_size=box_size, border=border, factory=factory, **kwargs
)
except (ValueError, AttributeError):
raise werkzeug.exceptions.HTTPException(
description="Cannot convert into barcode."
)
if factory != "png":
return request.make_response(
barcode, headers=[("Content-Type", "image/svg+xml")]
)
return request.make_response(barcode, headers=[("Content-Type", "image/png")])

View File

@ -0,0 +1,19 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * report_qr
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: report_qr
#: model:ir.model,name:report_qr.model_ir_actions_report
msgid "Report Action"
msgstr ""

View File

@ -0,0 +1 @@
from . import ir_actions_report

View File

@ -0,0 +1,36 @@
import io
import qrcode
from qrcode.image import pil, svg
from odoo import api, models
class IrActionsReport(models.Model):
_inherit = "ir.actions.report"
@api.model
def qr_generate(self, value, box_size=3, border=5, factory="png", **kwargs):
factories = {
"png": pil.PilImage,
"svg": svg.SvgImage,
"svg-fragment": svg.SvgFragmentImage,
"svg-path": svg.SvgPathImage,
}
# Color parameters seem to be inverted in the library
back_color = kwargs.pop("back_color", "black")
fill_color = kwargs.pop("fill_color", "white")
try:
# Defaults to png if the argument is unknown
image_factory = factories.get(factory, pil.PilImage)
qr = qrcode.QRCode(
box_size=box_size, border=border, image_factory=image_factory, **kwargs
)
qr.add_data(value)
qr.make()
img = qr.make_image(fill_color=fill_color, back_color=back_color)
arr = io.BytesIO()
img.save(arr)
return arr.getvalue()
except Exception:
raise ValueError("Cannot convert into barcode.")

View File

@ -0,0 +1,5 @@
* Enric Tobella <etobella@creublanca.es>
* `Tecnativa <https://www.tecnativa.com>`_:
* David Vidal

View File

@ -0,0 +1,13 @@
This module allows to print QR in better structure than the standard odoo.
The original image looks like the following
.. figure:: static/description/old_qr.png
:alt: Original QR
:width: 100 px
With the new generator, it looks like:
.. figure:: static/description/new_qr.png
:alt: New QR
:width: 100 px

View File

@ -0,0 +1,18 @@
When creating new reports, you should use a path like the following::
<img t-att-src="'/report/qr/?value=%s&amp;error_correction=%s' % ('HELLO WORLD!', 3)" style="width:100;height:100"/>
The **error_correction** parameter controls the error correction used for the QR Code. The following four constants are made available:
* **error_correction** = 1: About 7% or less errors can be corrected.
* **error_correction** = 0: About 15% or less errors can be corrected.
* **error_correction** = 3: About 25% or less errors can be corrected.
* **error_correction** = 2: About 30% or less errors can be corrected.
The **box_size** parameter controls how many pixels each "box" of the QR code is. The default is 3.
The **border** parameter controls how many boxes thick the border should be (the default is 4, which is the minimum according to the specs).
The **version** parameter is an integer from 1 to 40 that controls the size of the QR Code (the smallest, version 1, is a 21x21 matrix). Set to None and use the fit parameter when making the code to determine this automatically.
**fill_color** and **back_color** can change the background and the painting color of the QR, when using the default image factory.

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

View File

@ -0,0 +1,450 @@
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
<title>Web QR Manager</title>
<style type="text/css">
/*
:Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 7952 2016-07-26 18:15:59Z milde $
:Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
customize this style sheet.
*/
/* used to remove borders from tables and images */
.borderless, table.borderless td, table.borderless th {
border: 0 }
table.borderless td, table.borderless th {
/* Override padding for "table.docutils td" with "! important".
The right padding separates the table cells. */
padding: 0 0.5em 0 0 ! important }
.first {
/* Override more specific margin styles with "! important". */
margin-top: 0 ! important }
.last, .with-subtitle {
margin-bottom: 0 ! important }
.hidden {
display: none }
.subscript {
vertical-align: sub;
font-size: smaller }
.superscript {
vertical-align: super;
font-size: smaller }
a.toc-backref {
text-decoration: none ;
color: black }
blockquote.epigraph {
margin: 2em 5em ; }
dl.docutils dd {
margin-bottom: 0.5em }
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
overflow: hidden;
}
/* Uncomment (and remove this text!) to get bold-faced definition list terms
dl.docutils dt {
font-weight: bold }
*/
div.abstract {
margin: 2em 5em }
div.abstract p.topic-title {
font-weight: bold ;
text-align: center }
div.admonition, div.attention, div.caution, div.danger, div.error,
div.hint, div.important, div.note, div.tip, div.warning {
margin: 2em ;
border: medium outset ;
padding: 1em }
div.admonition p.admonition-title, div.hint p.admonition-title,
div.important p.admonition-title, div.note p.admonition-title,
div.tip p.admonition-title {
font-weight: bold ;
font-family: sans-serif }
div.attention p.admonition-title, div.caution p.admonition-title,
div.danger p.admonition-title, div.error p.admonition-title,
div.warning p.admonition-title, .code .error {
color: red ;
font-weight: bold ;
font-family: sans-serif }
/* Uncomment (and remove this text!) to get reduced vertical space in
compound paragraphs.
div.compound .compound-first, div.compound .compound-middle {
margin-bottom: 0.5em }
div.compound .compound-last, div.compound .compound-middle {
margin-top: 0.5em }
*/
div.dedication {
margin: 2em 5em ;
text-align: center ;
font-style: italic }
div.dedication p.topic-title {
font-weight: bold ;
font-style: normal }
div.figure {
margin-left: 2em ;
margin-right: 2em }
div.footer, div.header {
clear: both;
font-size: smaller }
div.line-block {
display: block ;
margin-top: 1em ;
margin-bottom: 1em }
div.line-block div.line-block {
margin-top: 0 ;
margin-bottom: 0 ;
margin-left: 1.5em }
div.sidebar {
margin: 0 0 0.5em 1em ;
border: medium outset ;
padding: 1em ;
background-color: #ffffee ;
width: 40% ;
float: right ;
clear: right }
div.sidebar p.rubric {
font-family: sans-serif ;
font-size: medium }
div.system-messages {
margin: 5em }
div.system-messages h1 {
color: red }
div.system-message {
border: medium outset ;
padding: 1em }
div.system-message p.system-message-title {
color: red ;
font-weight: bold }
div.topic {
margin: 2em }
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
margin-top: 0.4em }
h1.title {
text-align: center }
h2.subtitle {
text-align: center }
hr.docutils {
width: 75% }
img.align-left, .figure.align-left, object.align-left, table.align-left {
clear: left ;
float: left ;
margin-right: 1em }
img.align-right, .figure.align-right, object.align-right, table.align-right {
clear: right ;
float: right ;
margin-left: 1em }
img.align-center, .figure.align-center, object.align-center {
display: block;
margin-left: auto;
margin-right: auto;
}
table.align-center {
margin-left: auto;
margin-right: auto;
}
.align-left {
text-align: left }
.align-center {
clear: both ;
text-align: center }
.align-right {
text-align: right }
/* reset inner alignment in figures */
div.align-right {
text-align: inherit }
/* div.align-center * { */
/* text-align: left } */
.align-top {
vertical-align: top }
.align-middle {
vertical-align: middle }
.align-bottom {
vertical-align: bottom }
ol.simple, ul.simple {
margin-bottom: 1em }
ol.arabic {
list-style: decimal }
ol.loweralpha {
list-style: lower-alpha }
ol.upperalpha {
list-style: upper-alpha }
ol.lowerroman {
list-style: lower-roman }
ol.upperroman {
list-style: upper-roman }
p.attribution {
text-align: right ;
margin-left: 50% }
p.caption {
font-style: italic }
p.credits {
font-style: italic ;
font-size: smaller }
p.label {
white-space: nowrap }
p.rubric {
font-weight: bold ;
font-size: larger ;
color: maroon ;
text-align: center }
p.sidebar-title {
font-family: sans-serif ;
font-weight: bold ;
font-size: larger }
p.sidebar-subtitle {
font-family: sans-serif ;
font-weight: bold }
p.topic-title {
font-weight: bold }
pre.address {
margin-bottom: 0 ;
margin-top: 0 ;
font: inherit }
pre.literal-block, pre.doctest-block, pre.math, pre.code {
margin-left: 2em ;
margin-right: 2em }
pre.code .ln { color: grey; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
pre.code .literal.string, code .literal.string { color: #0C5404 }
pre.code .name.builtin, code .name.builtin { color: #352B84 }
pre.code .deleted, code .deleted { background-color: #DEB0A1}
pre.code .inserted, code .inserted { background-color: #A3D289}
span.classifier {
font-family: sans-serif ;
font-style: oblique }
span.classifier-delimiter {
font-family: sans-serif ;
font-weight: bold }
span.interpreted {
font-family: sans-serif }
span.option {
white-space: nowrap }
span.pre {
white-space: pre }
span.problematic {
color: red }
span.section-subtitle {
/* font-size relative to parent (h1..h6 element) */
font-size: 80% }
table.citation {
border-left: solid 1px gray;
margin-left: 1px }
table.docinfo {
margin: 2em 4em }
table.docutils {
margin-top: 0.5em ;
margin-bottom: 0.5em }
table.footnote {
border-left: solid 1px black;
margin-left: 1px }
table.docutils td, table.docutils th,
table.docinfo td, table.docinfo th {
padding-left: 0.5em ;
padding-right: 0.5em ;
vertical-align: top }
table.docutils th.field-name, table.docinfo th.docinfo-name {
font-weight: bold ;
text-align: left ;
white-space: nowrap ;
padding-left: 0 }
/* "booktabs" style (no vertical lines) */
table.docutils.booktabs {
border: 0px;
border-top: 2px solid;
border-bottom: 2px solid;
border-collapse: collapse;
}
table.docutils.booktabs * {
border: 0px;
}
table.docutils.booktabs th {
border-bottom: thin solid;
text-align: left;
}
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
font-size: 100% }
ul.auto-toc {
list-style-type: none }
</style>
</head>
<body>
<div class="document" id="web-qr-manager">
<h1 class="title">Web QR Manager</h1>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/reporting-engine/tree/13.0/report_qr"><img alt="OCA/reporting-engine" src="https://img.shields.io/badge/github-OCA%2Freporting--engine-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/reporting-engine-13-0/reporting-engine-13-0-report_qr"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/143/13.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>This module allows to print QR in better structure than the standard odoo.</p>
<p>The original image looks like the following</p>
<div class="figure">
<img alt="Original QR" src="https://raw.githubusercontent.com/OCA/reporting-engine/13.0/report_qr/static/description/old_qr.png" style="width: 100px;" />
</div>
<p>With the new generator, it looks like:</p>
<div class="figure">
<img alt="New QR" src="https://raw.githubusercontent.com/OCA/reporting-engine/13.0/report_qr/static/description/new_qr.png" style="width: 100px;" />
</div>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#usage" id="id1">Usage</a></li>
<li><a class="reference internal" href="#bug-tracker" id="id2">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="id3">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="id4">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="id5">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="id6">Maintainers</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="usage">
<h1><a class="toc-backref" href="#id1">Usage</a></h1>
<p>When creating new reports, you should use a path like the following:</p>
<pre class="literal-block">
&lt;img t-att-src=&quot;'/report/qr/?value=%s&amp;amp;error_correction=%s' % ('HELLO WORLD!', 3)&quot; style=&quot;width:100;height:100&quot;/&gt;
</pre>
<p>The <strong>error_correction</strong> parameter controls the error correction used for the QR Code. The following four constants are made available:</p>
<ul class="simple">
<li><strong>error_correction</strong> = 1: About 7% or less errors can be corrected.</li>
<li><strong>error_correction</strong> = 0: About 15% or less errors can be corrected.</li>
<li><strong>error_correction</strong> = 3: About 25% or less errors can be corrected.</li>
<li><strong>error_correction</strong> = 2: About 30% or less errors can be corrected.</li>
</ul>
<p>The <strong>box_size</strong> parameter controls how many pixels each “box” of the QR code is. The default is 3.
The <strong>border</strong> parameter controls how many boxes thick the border should be (the default is 4, which is the minimum according to the specs).</p>
<p>The <strong>version</strong> parameter is an integer from 1 to 40 that controls the size of the QR Code (the smallest, version 1, is a 21x21 matrix). Set to None and use the fit parameter when making the code to determine this automatically.</p>
<p><strong>fill_color</strong> and <strong>back_color</strong> can change the background and the painting color of the QR, when using the default image factory.</p>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#id2">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/reporting-engine/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/reporting-engine/issues/new?body=module:%20report_qr%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
<h1><a class="toc-backref" href="#id3">Credits</a></h1>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#id4">Authors</a></h2>
<ul class="simple">
<li>Creu Blanca</li>
</ul>
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#id5">Contributors</a></h2>
<ul class="simple">
<li>Enric Tobella &lt;<a class="reference external" href="mailto:etobella&#64;creublanca.es">etobella&#64;creublanca.es</a>&gt;</li>
<li><a class="reference external" href="https://www.tecnativa.com">Tecnativa</a>:<ul>
<li>David Vidal</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#id6">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/reporting-engine/tree/13.0/report_qr">OCA/reporting-engine</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
</div>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 271 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

View File

@ -0,0 +1 @@
from . import test_report_qr

View File

@ -0,0 +1,18 @@
# Copyright 2019 Creu Blanca
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo.tests.common import HttpCase
class TestReportQr(HttpCase):
def test_qr_generation(self):
data = "TEST"
image = self.url_open("/report/qr?value=%s" % data)
self.assertEqual(image.headers["Content-type"], "image/png")
def test_qr_overflow(self):
"""There is a QR limitation for 4296 characters, we will test that an
Exception is raised"""
new_data = "".join(["TEST"] * 1500)
with self.assertRaises(Exception):
self.env["ir.actions.report"].qr_generate(new_data)

View File

@ -0,0 +1,101 @@
============================
Report Qweb PDF Fixed Column
============================
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Freporting--engine-lightgray.png?logo=github
:target: https://github.com/OCA/reporting-engine/tree/13.0/report_qweb_pdf_fixed_column
:alt: OCA/reporting-engine
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/reporting-engine-13-0/reporting-engine-13-0-report_qweb_pdf_fixed_column
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/143/13.0
:alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5|
In the generated reports, the fields relative to the order details are not
correctly displayed: they are both "cut" from the view, or the general
font size is scaled down to make all the element fit which is not the
default behavior. The font size should remain fixed and all the element
should be visible, eventually spanning over multiple lines.
This is due to the broken bootstrap 4 support of QtWebKit, used by
wkhtmltopdf to generate pdf reports.
In particular the new flexbox style introduced in the library is not
supported and every element based on it will be ill-displayed.
This module changes the .col-auto behavior to work similiar as in
older Odoo versions.
**Table of contents**
.. contents::
:local:
Usage
=====
The changes are applied to all reports automatically.
Bug Tracker
===========
Bugs are tracked on `GitHub Issues <https://github.com/OCA/reporting-engine/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/reporting-engine/issues/new?body=module:%20report_qweb_pdf_fixed_column%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues.
Credits
=======
Authors
~~~~~~~
* Tecnativa
Contributors
~~~~~~~~~~~~
* agr-odoo
* `Tecnativa <https://www.tecnativa.com>`_:
* Alexandre Díaz
Maintainers
~~~~~~~~~~~
This module is maintained by the OCA.
.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org
OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
.. |maintainer-Tardo| image:: https://github.com/Tardo.png?size=40px
:target: https://github.com/Tardo
:alt: Tardo
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
|maintainer-Tardo|
This module is part of the `OCA/reporting-engine <https://github.com/OCA/reporting-engine/tree/13.0/report_qweb_pdf_fixed_column>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View File

@ -0,0 +1 @@
# Hi, i'm a python module

View File

@ -0,0 +1,18 @@
# Copyright 2020 Tecnativa - Alexandre Díaz
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Report Qweb PDF Fixed Column",
"summary": """
Fix auto-col to not change report font size caused by a
boundary overflow""",
"version": "13.0.1.0.0",
"license": "AGPL-3",
"category": "Reporting",
"author": "Tecnativa, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/reporting-engine",
"depends": ["web"],
"data": ["views/assets.xml"],
"maintainers": ["Tardo"],
"development_status": "Beta",
}

View File

@ -0,0 +1,13 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

View File

@ -0,0 +1,4 @@
* agr-odoo
* `Tecnativa <https://www.tecnativa.com>`_:
* Alexandre Díaz

View File

@ -0,0 +1,13 @@
In the generated reports, the fields relative to the order details are not
correctly displayed: they are both "cut" from the view, or the general
font size is scaled down to make all the element fit which is not the
default behavior. The font size should remain fixed and all the element
should be visible, eventually spanning over multiple lines.
This is due to the broken bootstrap 4 support of QtWebKit, used by
wkhtmltopdf to generate pdf reports.
In particular the new flexbox style introduced in the library is not
supported and every element based on it will be ill-displayed.
This module changes the .col-auto behavior to work similiar as in
older Odoo versions.

View File

@ -0,0 +1 @@
The changes are applied to all reports automatically.

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

View File

@ -0,0 +1,440 @@
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
<title>Report Qweb PDF Fixed Column</title>
<style type="text/css">
/*
:Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 7952 2016-07-26 18:15:59Z milde $
:Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
customize this style sheet.
*/
/* used to remove borders from tables and images */
.borderless, table.borderless td, table.borderless th {
border: 0 }
table.borderless td, table.borderless th {
/* Override padding for "table.docutils td" with "! important".
The right padding separates the table cells. */
padding: 0 0.5em 0 0 ! important }
.first {
/* Override more specific margin styles with "! important". */
margin-top: 0 ! important }
.last, .with-subtitle {
margin-bottom: 0 ! important }
.hidden {
display: none }
.subscript {
vertical-align: sub;
font-size: smaller }
.superscript {
vertical-align: super;
font-size: smaller }
a.toc-backref {
text-decoration: none ;
color: black }
blockquote.epigraph {
margin: 2em 5em ; }
dl.docutils dd {
margin-bottom: 0.5em }
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
overflow: hidden;
}
/* Uncomment (and remove this text!) to get bold-faced definition list terms
dl.docutils dt {
font-weight: bold }
*/
div.abstract {
margin: 2em 5em }
div.abstract p.topic-title {
font-weight: bold ;
text-align: center }
div.admonition, div.attention, div.caution, div.danger, div.error,
div.hint, div.important, div.note, div.tip, div.warning {
margin: 2em ;
border: medium outset ;
padding: 1em }
div.admonition p.admonition-title, div.hint p.admonition-title,
div.important p.admonition-title, div.note p.admonition-title,
div.tip p.admonition-title {
font-weight: bold ;
font-family: sans-serif }
div.attention p.admonition-title, div.caution p.admonition-title,
div.danger p.admonition-title, div.error p.admonition-title,
div.warning p.admonition-title, .code .error {
color: red ;
font-weight: bold ;
font-family: sans-serif }
/* Uncomment (and remove this text!) to get reduced vertical space in
compound paragraphs.
div.compound .compound-first, div.compound .compound-middle {
margin-bottom: 0.5em }
div.compound .compound-last, div.compound .compound-middle {
margin-top: 0.5em }
*/
div.dedication {
margin: 2em 5em ;
text-align: center ;
font-style: italic }
div.dedication p.topic-title {
font-weight: bold ;
font-style: normal }
div.figure {
margin-left: 2em ;
margin-right: 2em }
div.footer, div.header {
clear: both;
font-size: smaller }
div.line-block {
display: block ;
margin-top: 1em ;
margin-bottom: 1em }
div.line-block div.line-block {
margin-top: 0 ;
margin-bottom: 0 ;
margin-left: 1.5em }
div.sidebar {
margin: 0 0 0.5em 1em ;
border: medium outset ;
padding: 1em ;
background-color: #ffffee ;
width: 40% ;
float: right ;
clear: right }
div.sidebar p.rubric {
font-family: sans-serif ;
font-size: medium }
div.system-messages {
margin: 5em }
div.system-messages h1 {
color: red }
div.system-message {
border: medium outset ;
padding: 1em }
div.system-message p.system-message-title {
color: red ;
font-weight: bold }
div.topic {
margin: 2em }
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
margin-top: 0.4em }
h1.title {
text-align: center }
h2.subtitle {
text-align: center }
hr.docutils {
width: 75% }
img.align-left, .figure.align-left, object.align-left, table.align-left {
clear: left ;
float: left ;
margin-right: 1em }
img.align-right, .figure.align-right, object.align-right, table.align-right {
clear: right ;
float: right ;
margin-left: 1em }
img.align-center, .figure.align-center, object.align-center {
display: block;
margin-left: auto;
margin-right: auto;
}
table.align-center {
margin-left: auto;
margin-right: auto;
}
.align-left {
text-align: left }
.align-center {
clear: both ;
text-align: center }
.align-right {
text-align: right }
/* reset inner alignment in figures */
div.align-right {
text-align: inherit }
/* div.align-center * { */
/* text-align: left } */
.align-top {
vertical-align: top }
.align-middle {
vertical-align: middle }
.align-bottom {
vertical-align: bottom }
ol.simple, ul.simple {
margin-bottom: 1em }
ol.arabic {
list-style: decimal }
ol.loweralpha {
list-style: lower-alpha }
ol.upperalpha {
list-style: upper-alpha }
ol.lowerroman {
list-style: lower-roman }
ol.upperroman {
list-style: upper-roman }
p.attribution {
text-align: right ;
margin-left: 50% }
p.caption {
font-style: italic }
p.credits {
font-style: italic ;
font-size: smaller }
p.label {
white-space: nowrap }
p.rubric {
font-weight: bold ;
font-size: larger ;
color: maroon ;
text-align: center }
p.sidebar-title {
font-family: sans-serif ;
font-weight: bold ;
font-size: larger }
p.sidebar-subtitle {
font-family: sans-serif ;
font-weight: bold }
p.topic-title {
font-weight: bold }
pre.address {
margin-bottom: 0 ;
margin-top: 0 ;
font: inherit }
pre.literal-block, pre.doctest-block, pre.math, pre.code {
margin-left: 2em ;
margin-right: 2em }
pre.code .ln { color: grey; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
pre.code .literal.string, code .literal.string { color: #0C5404 }
pre.code .name.builtin, code .name.builtin { color: #352B84 }
pre.code .deleted, code .deleted { background-color: #DEB0A1}
pre.code .inserted, code .inserted { background-color: #A3D289}
span.classifier {
font-family: sans-serif ;
font-style: oblique }
span.classifier-delimiter {
font-family: sans-serif ;
font-weight: bold }
span.interpreted {
font-family: sans-serif }
span.option {
white-space: nowrap }
span.pre {
white-space: pre }
span.problematic {
color: red }
span.section-subtitle {
/* font-size relative to parent (h1..h6 element) */
font-size: 80% }
table.citation {
border-left: solid 1px gray;
margin-left: 1px }
table.docinfo {
margin: 2em 4em }
table.docutils {
margin-top: 0.5em ;
margin-bottom: 0.5em }
table.footnote {
border-left: solid 1px black;
margin-left: 1px }
table.docutils td, table.docutils th,
table.docinfo td, table.docinfo th {
padding-left: 0.5em ;
padding-right: 0.5em ;
vertical-align: top }
table.docutils th.field-name, table.docinfo th.docinfo-name {
font-weight: bold ;
text-align: left ;
white-space: nowrap ;
padding-left: 0 }
/* "booktabs" style (no vertical lines) */
table.docutils.booktabs {
border: 0px;
border-top: 2px solid;
border-bottom: 2px solid;
border-collapse: collapse;
}
table.docutils.booktabs * {
border: 0px;
}
table.docutils.booktabs th {
border-bottom: thin solid;
text-align: left;
}
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
font-size: 100% }
ul.auto-toc {
list-style-type: none }
</style>
</head>
<body>
<div class="document" id="report-qweb-pdf-fixed-column">
<h1 class="title">Report Qweb PDF Fixed Column</h1>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/reporting-engine/tree/13.0/report_qweb_pdf_fixed_column"><img alt="OCA/reporting-engine" src="https://img.shields.io/badge/github-OCA%2Freporting--engine-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/reporting-engine-13-0/reporting-engine-13-0-report_qweb_pdf_fixed_column"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/143/13.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>In the generated reports, the fields relative to the order details are not
correctly displayed: they are both “cut” from the view, or the general
font size is scaled down to make all the element fit which is not the
default behavior. The font size should remain fixed and all the element
should be visible, eventually spanning over multiple lines.</p>
<p>This is due to the broken bootstrap 4 support of QtWebKit, used by
wkhtmltopdf to generate pdf reports.
In particular the new flexbox style introduced in the library is not
supported and every element based on it will be ill-displayed.</p>
<p>This module changes the .col-auto behavior to work similiar as in
older Odoo versions.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#usage" id="id1">Usage</a></li>
<li><a class="reference internal" href="#bug-tracker" id="id2">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="id3">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="id4">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="id5">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="id6">Maintainers</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="usage">
<h1><a class="toc-backref" href="#id1">Usage</a></h1>
<p>The changes are applied to all reports automatically.</p>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#id2">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/reporting-engine/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/reporting-engine/issues/new?body=module:%20report_qweb_pdf_fixed_column%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
<h1><a class="toc-backref" href="#id3">Credits</a></h1>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#id4">Authors</a></h2>
<ul class="simple">
<li>Tecnativa</li>
</ul>
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#id5">Contributors</a></h2>
<ul class="simple">
<li>agr-odoo</li>
<li><a class="reference external" href="https://www.tecnativa.com">Tecnativa</a>:<ul>
<li>Alexandre Díaz</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#id6">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.</p>
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
<p><a class="reference external" href="https://github.com/Tardo"><img alt="Tardo" src="https://github.com/Tardo.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/reporting-engine/tree/13.0/report_qweb_pdf_fixed_column">OCA/reporting-engine</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,7 @@
/* Original fix by 'agr-odoo': https://github.com/odoo/odoo/pull/35795 */
.col-auto {
// This is only used in QtWebKit
-webkit-box-flex: 1 !important;
box-flex: 1 !important;
width: 100% !important;
}

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2020 Tecnativa - Alexandre Díaz
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<odoo>
<template
id="report_assets_pdf"
name="Report Assets"
inherit_id="web.report_assets_pdf"
>
<xpath expr=".">
<link
rel="stylesheet"
href="/report_qweb_pdf_fixed_column/static/src/css/report_qweb_pdf_fixed_column.scss"
/>
</xpath>
</template>
</odoo>

View File

@ -0,0 +1,127 @@
================
Base report xlsx
================
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Freporting--engine-lightgray.png?logo=github
:target: https://github.com/OCA/reporting-engine/tree/13.0/report_xlsx
:alt: OCA/reporting-engine
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/reporting-engine-13-0/reporting-engine-13-0-report_xlsx
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/143/13.0
:alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5|
This module provides a basic report class to generate xlsx report.
**Table of contents**
.. contents::
:local:
Installation
============
Make sure you have ``xlsxwriter`` Python module installed::
$ pip3 install xlsxwriter
For testing it is also necessary ``xlrd`` Python module installed::
$ pip3 install xlrd
Usage
=====
An example of XLSX report for partners on a module called `module_name`:
A python class ::
from odoo import models
class PartnerXlsx(models.AbstractModel):
_name = 'report.module_name.report_name'
_inherit = 'report.report_xlsx.abstract'
def generate_xlsx_report(self, workbook, data, partners):
for obj in partners:
report_name = obj.name
# One sheet by partner
sheet = workbook.add_worksheet(report_name[:31])
bold = workbook.add_format({'bold': True})
sheet.write(0, 0, obj.name, bold)
To manipulate the ``workbook`` and ``sheet`` objects, refer to the
`documentation <http://xlsxwriter.readthedocs.org/>`_ of ``xlsxwriter``.
A report XML record ::
<report
id="partner_xlsx"
model="res.partner"
string="Print to XLSX"
report_type="xlsx"
name="module_name.report_name"
file="res_partner"
attachment_use="False"
/>
Bug Tracker
===========
Bugs are tracked on `GitHub Issues <https://github.com/OCA/reporting-engine/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/reporting-engine/issues/new?body=module:%20report_xlsx%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues.
Credits
=======
Authors
~~~~~~~
* ACSONE SA/NV
* Creu Blanca
Contributors
~~~~~~~~~~~~
* Adrien Peiffer <adrien.peiffer@acsone.eu>
* Sébastien Alix <sebastien.alix@osiell.com>
* Stéphane Bidoul <stephane.bidoul@acsone.eu>
* Enric Tobella <etobella@creublanca.es>
* Graeme Gellatly <gdgellatly@gmail.com>
* Cristian Salamea <cs@prisehub.com>
* Rod Schouteden <rod.schouteden@dynapps.be>
Maintainers
~~~~~~~~~~~
This module is maintained by the OCA.
.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org
OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
This module is part of the `OCA/reporting-engine <https://github.com/OCA/reporting-engine/tree/13.0/report_xlsx>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View File

@ -0,0 +1,5 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from . import controllers
from . import models
from . import report

View File

@ -0,0 +1,16 @@
# Copyright 2015 ACSONE SA/NV (<http://acsone.eu>)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Base report xlsx",
"summary": "Base module to create xlsx report",
"author": "ACSONE SA/NV," "Creu Blanca," "Odoo Community Association (OCA)",
"website": "https://github.com/oca/reporting-engine",
"category": "Reporting",
"version": "13.0.1.0.1",
"license": "AGPL-3",
"external_dependencies": {"python": ["xlsxwriter", "xlrd"]},
"depends": ["base", "web"],
"data": ["views/webclient_templates.xml"],
"demo": ["demo/report.xml"],
"installable": True,
}

View File

@ -0,0 +1 @@
from . import main

View File

@ -0,0 +1,50 @@
# Copyright (C) 2017 Creu Blanca
# License AGPL-3.0 or later (https://www.gnuorg/licenses/agpl.html).
import json
import time
from odoo.http import content_disposition, request, route
from odoo.tools.safe_eval import safe_eval
from odoo.addons.web.controllers import main as report
class ReportController(report.ReportController):
@route()
def report_routes(self, reportname, docids=None, converter=None, **data):
if converter == "xlsx":
report = request.env["ir.actions.report"]._get_report_from_name(reportname)
context = dict(request.env.context)
if docids:
docids = [int(i) for i in docids.split(",")]
if data.get("options"):
data.update(json.loads(data.pop("options")))
if data.get("context"):
# Ignore 'lang' here, because the context in data is the one
# from the webclient *but* if the user explicitely wants to
# change the lang, this mechanism overwrites it.
data["context"] = json.loads(data["context"])
if data["context"].get("lang"):
del data["context"]["lang"]
context.update(data["context"])
xlsx = report.with_context(context).render_xlsx(docids, data=data)[0]
report_name = report.report_file
if report.print_report_name and not len(docids) > 1:
obj = request.env[report.model].browse(docids[0])
report_name = safe_eval(
report.print_report_name, {"object": obj, "time": time}
)
xlsxhttpheaders = [
(
"Content-Type",
"application/vnd.openxmlformats-"
"officedocument.spreadsheetml.sheet",
),
("Content-Length", len(xlsx)),
("Content-Disposition", content_disposition(report_name + ".xlsx")),
]
return request.make_response(xlsx, headers=xlsxhttpheaders)
return super(ReportController, self).report_routes(
reportname, docids, converter, **data
)

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<!--
© 2017 Creu Blanca
License AGPL-3.0 or later (https://www.gnuorg/licenses/agpl.html).
-->
<report
id="partner_xlsx"
model="res.partner"
string="Print to XLSX"
report_type="xlsx"
name="report_xlsx.partner_xlsx"
file="res_partner"
attachment_use="False"
/>
</odoo>

View File

@ -0,0 +1,125 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * report_xlsx
#
# Translators:
# Ricardo Gross <rwgross@gmail.com>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 11.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-12-23 03:49+0000\n"
"PO-Revision-Date: 2019-07-12 12:43+0000\n"
"Last-Translator: Maria Sparenberg <maria.sparenberg@gmx.net>\n"
"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 3.7.1\n"
#. module: report_xlsx
#: code:addons/report_xlsx/models/ir_report.py:0
#, python-format
msgid "%s model was not found"
msgstr "%s Modell wurde nicht gefunden"
#. module: report_xlsx
#. openerp-web
#: code:addons/report_xlsx/static/src/js/report/action_manager_report.js:0
#, python-format
msgid ""
"A popup window with your report was blocked. You may need to change your "
"browser settings to allow popup windows for this page."
msgstr ""
"Ein Popup-Fenster wurde abgewiesen. Sie werden vermutlich Ihre Browser-"
"Einstellungen ändern müssen, damit die Anzeige dieser Seite möglich wird."
#. module: report_xlsx
#: model:ir.model,name:report_xlsx.model_report_report_xlsx_abstract
msgid "Abstract XLSX Report"
msgstr "Abstrakter XLSX-Bericht"
#. module: report_xlsx
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract__display_name
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx__display_name
msgid "Display Name"
msgstr "Name anzeigen"
#. module: report_xlsx
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract__id
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx__id
msgid "ID"
msgstr "ID"
#. module: report_xlsx
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract____last_update
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx____last_update
msgid "Last Modified on"
msgstr "Zuletzt geändert am"
#. module: report_xlsx
#: model:ir.model,name:report_xlsx.model_report_report_xlsx_partner_xlsx
#, fuzzy
#| msgid "Abstract XLSX Report"
msgid "Partner XLSX Report"
msgstr "Abstrakter XLSX-Bericht"
#. module: report_xlsx
#: model:ir.actions.report,name:report_xlsx.partner_xlsx
msgid "Print to XLSX"
msgstr "Drucke nach XLSX"
#. module: report_xlsx
#: model:ir.model,name:report_xlsx.model_ir_actions_report
msgid "Report Action"
msgstr "Berichtsaktion"
#. module: report_xlsx
#: model:ir.model.fields,field_description:report_xlsx.field_ir_actions_report__report_type
msgid "Report Type"
msgstr "Berichtsart"
#. module: report_xlsx
#: model:ir.model.fields,help:report_xlsx.field_ir_actions_report__report_type
msgid ""
"The type of the report that will be rendered, each one having its own "
"rendering method. HTML means the report will be opened directly in your "
"browser PDF means the report will be rendered using Wkhtmltopdf and "
"downloaded by the user."
msgstr ""
"Die Art des Berichts, der erstellt wird, jeder mit eigener Darstellungsform. "
"HTML bedeutet, dass der Bericht unmittelbar in Ihrem Browser dargestellt "
"wird, PDF bedeutet, dass der Bericht mittels Wkhtmltopdf gewandelt wird und "
"vom Anwender heruntergeladen wird."
#. module: report_xlsx
#. openerp-web
#: code:addons/report_xlsx/static/src/js/report/action_manager_report.js:0
#, python-format
msgid "Warning"
msgstr "Hinweis"
#. module: report_xlsx
#: model:ir.model.fields.selection,name:report_xlsx.selection__ir_actions_report__report_type__xlsx
msgid "XLSX"
msgstr "XLSX"
#~ msgid "HTML"
#~ msgstr "HTML"
#~ msgid "PDF"
#~ msgstr "PDF"
#~ msgid "Py3o"
#~ msgstr "Py3o"
#~ msgid "Text"
#~ msgstr "Text"
#~ msgid "XML"
#~ msgstr "XML"
#~ msgid "report.report_xlsx.partner_xlsx"
#~ msgstr "report.report_xlsx.partner_xlsx"

View File

@ -0,0 +1,102 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * report_xlsx
#
# Translators:
# Pedro M. Baeza <pedro.baeza@gmail.com>, 2016
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-11-01 20:11+0000\n"
"PO-Revision-Date: 2016-11-01 20:11+0000\n"
"Last-Translator: Pedro M. Baeza <pedro.baeza@gmail.com>, 2016\n"
"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#. module: report_xlsx
#: code:addons/report_xlsx/models/ir_report.py:0
#, python-format
msgid "%s model was not found"
msgstr ""
#. module: report_xlsx
#. openerp-web
#: code:addons/report_xlsx/static/src/js/report/action_manager_report.js:0
#, python-format
msgid ""
"A popup window with your report was blocked. You may need to change your "
"browser settings to allow popup windows for this page."
msgstr ""
#. module: report_xlsx
#: model:ir.model,name:report_xlsx.model_report_report_xlsx_abstract
msgid "Abstract XLSX Report"
msgstr ""
#. module: report_xlsx
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract__display_name
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx__display_name
msgid "Display Name"
msgstr ""
#. module: report_xlsx
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract__id
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx__id
msgid "ID"
msgstr ""
#. module: report_xlsx
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract____last_update
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx____last_update
msgid "Last Modified on"
msgstr ""
#. module: report_xlsx
#: model:ir.model,name:report_xlsx.model_report_report_xlsx_partner_xlsx
msgid "Partner XLSX Report"
msgstr ""
#. module: report_xlsx
#: model:ir.actions.report,name:report_xlsx.partner_xlsx
msgid "Print to XLSX"
msgstr ""
#. module: report_xlsx
#: model:ir.model,name:report_xlsx.model_ir_actions_report
msgid "Report Action"
msgstr ""
#. module: report_xlsx
#: model:ir.model.fields,field_description:report_xlsx.field_ir_actions_report__report_type
msgid "Report Type"
msgstr ""
#. module: report_xlsx
#: model:ir.model.fields,help:report_xlsx.field_ir_actions_report__report_type
msgid ""
"The type of the report that will be rendered, each one having its own "
"rendering method. HTML means the report will be opened directly in your "
"browser PDF means the report will be rendered using Wkhtmltopdf and "
"downloaded by the user."
msgstr ""
#. module: report_xlsx
#. openerp-web
#: code:addons/report_xlsx/static/src/js/report/action_manager_report.js:0
#, python-format
msgid "Warning"
msgstr ""
#. module: report_xlsx
#: model:ir.model.fields.selection,name:report_xlsx.selection__ir_actions_report__report_type__xlsx
msgid "XLSX"
msgstr ""
#, fuzzy
#~ msgid "ir.actions.report"
#~ msgstr "ir.actions.report.xml"

View File

@ -0,0 +1,107 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * report_xlsx
#
# Translators:
# Nicolas JEUDY <njeudy@panda-chi.io>, 2018
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 11.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-01-05 17:53+0000\n"
"PO-Revision-Date: 2018-01-05 17:53+0000\n"
"Last-Translator: Nicolas JEUDY <njeudy@panda-chi.io>, 2018\n"
"Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#. module: report_xlsx
#: code:addons/report_xlsx/models/ir_report.py:0
#, python-format
msgid "%s model was not found"
msgstr "model '%s' n'a pas été trouvé"
#. module: report_xlsx
#. openerp-web
#: code:addons/report_xlsx/static/src/js/report/action_manager_report.js:0
#, python-format
msgid ""
"A popup window with your report was blocked. You may need to change your "
"browser settings to allow popup windows for this page."
msgstr ""
#. module: report_xlsx
#: model:ir.model,name:report_xlsx.model_report_report_xlsx_abstract
msgid "Abstract XLSX Report"
msgstr ""
#. module: report_xlsx
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract__display_name
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx__display_name
msgid "Display Name"
msgstr "Nom"
#. module: report_xlsx
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract__id
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx__id
msgid "ID"
msgstr "ID"
#. module: report_xlsx
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract____last_update
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx____last_update
msgid "Last Modified on"
msgstr "Dernière modification le"
#. module: report_xlsx
#: model:ir.model,name:report_xlsx.model_report_report_xlsx_partner_xlsx
msgid "Partner XLSX Report"
msgstr ""
#. module: report_xlsx
#: model:ir.actions.report,name:report_xlsx.partner_xlsx
msgid "Print to XLSX"
msgstr "Imprimer en XLSX"
#. module: report_xlsx
#: model:ir.model,name:report_xlsx.model_ir_actions_report
msgid "Report Action"
msgstr ""
#. module: report_xlsx
#: model:ir.model.fields,field_description:report_xlsx.field_ir_actions_report__report_type
msgid "Report Type"
msgstr ""
#. module: report_xlsx
#: model:ir.model.fields,help:report_xlsx.field_ir_actions_report__report_type
msgid ""
"The type of the report that will be rendered, each one having its own "
"rendering method. HTML means the report will be opened directly in your "
"browser PDF means the report will be rendered using Wkhtmltopdf and "
"downloaded by the user."
msgstr ""
#. module: report_xlsx
#. openerp-web
#: code:addons/report_xlsx/static/src/js/report/action_manager_report.js:0
#, python-format
msgid "Warning"
msgstr ""
#. module: report_xlsx
#: model:ir.model.fields.selection,name:report_xlsx.selection__ir_actions_report__report_type__xlsx
msgid "XLSX"
msgstr ""
#~ msgid "report.report_xlsx.partner_xlsx"
#~ msgstr "report.report_xlsx.partner_xlsx"
#~ msgid "ir.actions.report"
#~ msgstr "ir.actions.report"
#~ msgid "report.report_xlsx.abstract"
#~ msgstr "report.report_xlsx.abstract"

View File

@ -0,0 +1,103 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * report_xlsx
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-05-31 03:52+0000\n"
"PO-Revision-Date: 2017-05-31 03:52+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n"
"Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n"
"Language: hr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
#. module: report_xlsx
#: code:addons/report_xlsx/models/ir_report.py:0
#, python-format
msgid "%s model was not found"
msgstr ""
#. module: report_xlsx
#. openerp-web
#: code:addons/report_xlsx/static/src/js/report/action_manager_report.js:0
#, python-format
msgid ""
"A popup window with your report was blocked. You may need to change your "
"browser settings to allow popup windows for this page."
msgstr ""
#. module: report_xlsx
#: model:ir.model,name:report_xlsx.model_report_report_xlsx_abstract
msgid "Abstract XLSX Report"
msgstr ""
#. module: report_xlsx
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract__display_name
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx__display_name
msgid "Display Name"
msgstr ""
#. module: report_xlsx
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract__id
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx__id
msgid "ID"
msgstr ""
#. module: report_xlsx
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract____last_update
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx____last_update
msgid "Last Modified on"
msgstr ""
#. module: report_xlsx
#: model:ir.model,name:report_xlsx.model_report_report_xlsx_partner_xlsx
msgid "Partner XLSX Report"
msgstr ""
#. module: report_xlsx
#: model:ir.actions.report,name:report_xlsx.partner_xlsx
msgid "Print to XLSX"
msgstr ""
#. module: report_xlsx
#: model:ir.model,name:report_xlsx.model_ir_actions_report
msgid "Report Action"
msgstr ""
#. module: report_xlsx
#: model:ir.model.fields,field_description:report_xlsx.field_ir_actions_report__report_type
msgid "Report Type"
msgstr ""
#. module: report_xlsx
#: model:ir.model.fields,help:report_xlsx.field_ir_actions_report__report_type
msgid ""
"The type of the report that will be rendered, each one having its own "
"rendering method. HTML means the report will be opened directly in your "
"browser PDF means the report will be rendered using Wkhtmltopdf and "
"downloaded by the user."
msgstr ""
#. module: report_xlsx
#. openerp-web
#: code:addons/report_xlsx/static/src/js/report/action_manager_report.js:0
#, python-format
msgid "Warning"
msgstr ""
#. module: report_xlsx
#: model:ir.model.fields.selection,name:report_xlsx.selection__ir_actions_report__report_type__xlsx
msgid "XLSX"
msgstr ""
#, fuzzy
#~ msgid "ir.actions.report"
#~ msgstr "ir.actions.report.xml"

View File

@ -0,0 +1,104 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * report_xlsx
#
# Translators:
# Bole <bole@dajmi5.com>, 2016
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-11-01 20:11+0000\n"
"PO-Revision-Date: 2016-11-01 20:11+0000\n"
"Last-Translator: Bole <bole@dajmi5.com>, 2016\n"
"Language-Team: Croatian (Croatia) (https://www.transifex.com/oca/teams/23907/"
"hr_HR/)\n"
"Language: hr_HR\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
#. module: report_xlsx
#: code:addons/report_xlsx/models/ir_report.py:0
#, python-format
msgid "%s model was not found"
msgstr ""
#. module: report_xlsx
#. openerp-web
#: code:addons/report_xlsx/static/src/js/report/action_manager_report.js:0
#, python-format
msgid ""
"A popup window with your report was blocked. You may need to change your "
"browser settings to allow popup windows for this page."
msgstr ""
#. module: report_xlsx
#: model:ir.model,name:report_xlsx.model_report_report_xlsx_abstract
msgid "Abstract XLSX Report"
msgstr ""
#. module: report_xlsx
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract__display_name
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx__display_name
msgid "Display Name"
msgstr ""
#. module: report_xlsx
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract__id
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx__id
msgid "ID"
msgstr ""
#. module: report_xlsx
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract____last_update
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx____last_update
msgid "Last Modified on"
msgstr ""
#. module: report_xlsx
#: model:ir.model,name:report_xlsx.model_report_report_xlsx_partner_xlsx
msgid "Partner XLSX Report"
msgstr ""
#. module: report_xlsx
#: model:ir.actions.report,name:report_xlsx.partner_xlsx
msgid "Print to XLSX"
msgstr ""
#. module: report_xlsx
#: model:ir.model,name:report_xlsx.model_ir_actions_report
msgid "Report Action"
msgstr ""
#. module: report_xlsx
#: model:ir.model.fields,field_description:report_xlsx.field_ir_actions_report__report_type
msgid "Report Type"
msgstr ""
#. module: report_xlsx
#: model:ir.model.fields,help:report_xlsx.field_ir_actions_report__report_type
msgid ""
"The type of the report that will be rendered, each one having its own "
"rendering method. HTML means the report will be opened directly in your "
"browser PDF means the report will be rendered using Wkhtmltopdf and "
"downloaded by the user."
msgstr ""
#. module: report_xlsx
#. openerp-web
#: code:addons/report_xlsx/static/src/js/report/action_manager_report.js:0
#, python-format
msgid "Warning"
msgstr ""
#. module: report_xlsx
#: model:ir.model.fields.selection,name:report_xlsx.selection__ir_actions_report__report_type__xlsx
msgid "XLSX"
msgstr ""
#, fuzzy
#~ msgid "ir.actions.report"
#~ msgstr "ir.actions.report.xml"

View File

@ -0,0 +1,102 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * report_xlsx
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-05-31 03:52+0000\n"
"PO-Revision-Date: 2017-05-31 03:52+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n"
"Language-Team: Italian (https://www.transifex.com/oca/teams/23907/it/)\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#. module: report_xlsx
#: code:addons/report_xlsx/models/ir_report.py:0
#, python-format
msgid "%s model was not found"
msgstr ""
#. module: report_xlsx
#. openerp-web
#: code:addons/report_xlsx/static/src/js/report/action_manager_report.js:0
#, python-format
msgid ""
"A popup window with your report was blocked. You may need to change your "
"browser settings to allow popup windows for this page."
msgstr ""
#. module: report_xlsx
#: model:ir.model,name:report_xlsx.model_report_report_xlsx_abstract
msgid "Abstract XLSX Report"
msgstr ""
#. module: report_xlsx
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract__display_name
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx__display_name
msgid "Display Name"
msgstr ""
#. module: report_xlsx
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract__id
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx__id
msgid "ID"
msgstr ""
#. module: report_xlsx
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract____last_update
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx____last_update
msgid "Last Modified on"
msgstr ""
#. module: report_xlsx
#: model:ir.model,name:report_xlsx.model_report_report_xlsx_partner_xlsx
msgid "Partner XLSX Report"
msgstr ""
#. module: report_xlsx
#: model:ir.actions.report,name:report_xlsx.partner_xlsx
msgid "Print to XLSX"
msgstr ""
#. module: report_xlsx
#: model:ir.model,name:report_xlsx.model_ir_actions_report
msgid "Report Action"
msgstr ""
#. module: report_xlsx
#: model:ir.model.fields,field_description:report_xlsx.field_ir_actions_report__report_type
msgid "Report Type"
msgstr ""
#. module: report_xlsx
#: model:ir.model.fields,help:report_xlsx.field_ir_actions_report__report_type
msgid ""
"The type of the report that will be rendered, each one having its own "
"rendering method. HTML means the report will be opened directly in your "
"browser PDF means the report will be rendered using Wkhtmltopdf and "
"downloaded by the user."
msgstr ""
#. module: report_xlsx
#. openerp-web
#: code:addons/report_xlsx/static/src/js/report/action_manager_report.js:0
#, python-format
msgid "Warning"
msgstr ""
#. module: report_xlsx
#: model:ir.model.fields.selection,name:report_xlsx.selection__ir_actions_report__report_type__xlsx
msgid "XLSX"
msgstr ""
#, fuzzy
#~ msgid "ir.actions.report"
#~ msgstr "ir.actions.report.xml"

View File

@ -0,0 +1,103 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * report_xlsx
#
# Translators:
# Peter Hageman <hageman.p@gmail.com>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-06-23 00:28+0000\n"
"PO-Revision-Date: 2017-06-23 00:28+0000\n"
"Last-Translator: Peter Hageman <hageman.p@gmail.com>, 2017\n"
"Language-Team: Dutch (Netherlands) (https://www.transifex.com/oca/"
"teams/23907/nl_NL/)\n"
"Language: nl_NL\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#. module: report_xlsx
#: code:addons/report_xlsx/models/ir_report.py:0
#, python-format
msgid "%s model was not found"
msgstr ""
#. module: report_xlsx
#. openerp-web
#: code:addons/report_xlsx/static/src/js/report/action_manager_report.js:0
#, python-format
msgid ""
"A popup window with your report was blocked. You may need to change your "
"browser settings to allow popup windows for this page."
msgstr ""
#. module: report_xlsx
#: model:ir.model,name:report_xlsx.model_report_report_xlsx_abstract
msgid "Abstract XLSX Report"
msgstr ""
#. module: report_xlsx
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract__display_name
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx__display_name
msgid "Display Name"
msgstr ""
#. module: report_xlsx
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract__id
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx__id
msgid "ID"
msgstr ""
#. module: report_xlsx
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract____last_update
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx____last_update
msgid "Last Modified on"
msgstr ""
#. module: report_xlsx
#: model:ir.model,name:report_xlsx.model_report_report_xlsx_partner_xlsx
msgid "Partner XLSX Report"
msgstr ""
#. module: report_xlsx
#: model:ir.actions.report,name:report_xlsx.partner_xlsx
msgid "Print to XLSX"
msgstr ""
#. module: report_xlsx
#: model:ir.model,name:report_xlsx.model_ir_actions_report
msgid "Report Action"
msgstr ""
#. module: report_xlsx
#: model:ir.model.fields,field_description:report_xlsx.field_ir_actions_report__report_type
msgid "Report Type"
msgstr ""
#. module: report_xlsx
#: model:ir.model.fields,help:report_xlsx.field_ir_actions_report__report_type
msgid ""
"The type of the report that will be rendered, each one having its own "
"rendering method. HTML means the report will be opened directly in your "
"browser PDF means the report will be rendered using Wkhtmltopdf and "
"downloaded by the user."
msgstr ""
#. module: report_xlsx
#. openerp-web
#: code:addons/report_xlsx/static/src/js/report/action_manager_report.js:0
#, python-format
msgid "Warning"
msgstr ""
#. module: report_xlsx
#: model:ir.model.fields.selection,name:report_xlsx.selection__ir_actions_report__report_type__xlsx
msgid "XLSX"
msgstr ""
#, fuzzy
#~ msgid "ir.actions.report"
#~ msgstr "ir.actions.report.xml"

View File

@ -0,0 +1,119 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * report_xlsx
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2019-08-14 13:44+0000\n"
"Last-Translator: Pedro Castro Silva <pedrocs@exo.pt>\n"
"Language-Team: none\n"
"Language: pt\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n > 1;\n"
"X-Generator: Weblate 3.7.1\n"
#. module: report_xlsx
#: code:addons/report_xlsx/models/ir_report.py:0
#, python-format
msgid "%s model was not found"
msgstr "O modelo %s não foi encontrado"
#. module: report_xlsx
#. openerp-web
#: code:addons/report_xlsx/static/src/js/report/action_manager_report.js:0
#, python-format
msgid ""
"A popup window with your report was blocked. You may need to change your "
"browser settings to allow popup windows for this page."
msgstr ""
"Uma janela popup com o seu relatório foi bloqueada. Pode necessitar de mudar "
"as configurações do browser para permitir janelas popup nesta página."
#. module: report_xlsx
#: model:ir.model,name:report_xlsx.model_report_report_xlsx_abstract
msgid "Abstract XLSX Report"
msgstr "Relatório XLSX Abstrato"
#. module: report_xlsx
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract__display_name
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx__display_name
msgid "Display Name"
msgstr "Nome a Exibir"
#. module: report_xlsx
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract__id
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx__id
msgid "ID"
msgstr "ID"
#. module: report_xlsx
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract____last_update
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx____last_update
msgid "Last Modified on"
msgstr "Última Modificação em"
#. module: report_xlsx
#: model:ir.model,name:report_xlsx.model_report_report_xlsx_partner_xlsx
#, fuzzy
#| msgid "Abstract XLSX Report"
msgid "Partner XLSX Report"
msgstr "Relatório XLSX Abstrato"
#. module: report_xlsx
#: model:ir.actions.report,name:report_xlsx.partner_xlsx
msgid "Print to XLSX"
msgstr "Imprimir para XLSX"
#. module: report_xlsx
#: model:ir.model,name:report_xlsx.model_ir_actions_report
msgid "Report Action"
msgstr "Ação do Relatório"
#. module: report_xlsx
#: model:ir.model.fields,field_description:report_xlsx.field_ir_actions_report__report_type
msgid "Report Type"
msgstr "Tipo de Relatório"
#. module: report_xlsx
#: model:ir.model.fields,help:report_xlsx.field_ir_actions_report__report_type
msgid ""
"The type of the report that will be rendered, each one having its own "
"rendering method. HTML means the report will be opened directly in your "
"browser PDF means the report will be rendered using Wkhtmltopdf and "
"downloaded by the user."
msgstr ""
"O tipo de relatório que será produzido, tendo cada qual o seu método de "
"produção. HTML significa que o relatório será aberto diretamente no seu "
"browser. PDF indica que o relatório será produzido com o Wkhtmltopdf e "
"descarregado pelo utilizador."
#. module: report_xlsx
#. openerp-web
#: code:addons/report_xlsx/static/src/js/report/action_manager_report.js:0
#, python-format
msgid "Warning"
msgstr "Aviso"
#. module: report_xlsx
#: model:ir.model.fields.selection,name:report_xlsx.selection__ir_actions_report__report_type__xlsx
msgid "XLSX"
msgstr "XLSX"
#~ msgid "HTML"
#~ msgstr "HTML"
#~ msgid "PDF"
#~ msgstr "PDF"
#~ msgid "Py3o"
#~ msgstr "Py3o"
#~ msgid "Text"
#~ msgstr "Texto"
#~ msgid "XML"
#~ msgstr "XML"

View File

@ -0,0 +1,103 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * report_xlsx
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-05-31 03:52+0000\n"
"PO-Revision-Date: 2017-05-31 03:52+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n"
"Language-Team: Portuguese (Portugal) (https://www.transifex.com/oca/"
"teams/23907/pt_PT/)\n"
"Language: pt_PT\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#. module: report_xlsx
#: code:addons/report_xlsx/models/ir_report.py:0
#, python-format
msgid "%s model was not found"
msgstr ""
#. module: report_xlsx
#. openerp-web
#: code:addons/report_xlsx/static/src/js/report/action_manager_report.js:0
#, python-format
msgid ""
"A popup window with your report was blocked. You may need to change your "
"browser settings to allow popup windows for this page."
msgstr ""
#. module: report_xlsx
#: model:ir.model,name:report_xlsx.model_report_report_xlsx_abstract
msgid "Abstract XLSX Report"
msgstr ""
#. module: report_xlsx
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract__display_name
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx__display_name
msgid "Display Name"
msgstr ""
#. module: report_xlsx
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract__id
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx__id
msgid "ID"
msgstr ""
#. module: report_xlsx
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract____last_update
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx____last_update
msgid "Last Modified on"
msgstr ""
#. module: report_xlsx
#: model:ir.model,name:report_xlsx.model_report_report_xlsx_partner_xlsx
msgid "Partner XLSX Report"
msgstr ""
#. module: report_xlsx
#: model:ir.actions.report,name:report_xlsx.partner_xlsx
msgid "Print to XLSX"
msgstr ""
#. module: report_xlsx
#: model:ir.model,name:report_xlsx.model_ir_actions_report
msgid "Report Action"
msgstr ""
#. module: report_xlsx
#: model:ir.model.fields,field_description:report_xlsx.field_ir_actions_report__report_type
msgid "Report Type"
msgstr ""
#. module: report_xlsx
#: model:ir.model.fields,help:report_xlsx.field_ir_actions_report__report_type
msgid ""
"The type of the report that will be rendered, each one having its own "
"rendering method. HTML means the report will be opened directly in your "
"browser PDF means the report will be rendered using Wkhtmltopdf and "
"downloaded by the user."
msgstr ""
#. module: report_xlsx
#. openerp-web
#: code:addons/report_xlsx/static/src/js/report/action_manager_report.js:0
#, python-format
msgid "Warning"
msgstr ""
#. module: report_xlsx
#: model:ir.model.fields.selection,name:report_xlsx.selection__ir_actions_report__report_type__xlsx
msgid "XLSX"
msgstr ""
#, fuzzy
#~ msgid "ir.actions.report"
#~ msgstr "ir.actions.report.xml"

View File

@ -0,0 +1,93 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * report_xlsx
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: report_xlsx
#: code:addons/report_xlsx/models/ir_report.py:0
#, python-format
msgid "%s model was not found"
msgstr ""
#. module: report_xlsx
#. openerp-web
#: code:addons/report_xlsx/static/src/js/report/action_manager_report.js:0
#, python-format
msgid ""
"A popup window with your report was blocked. You may need to change your "
"browser settings to allow popup windows for this page."
msgstr ""
#. module: report_xlsx
#: model:ir.model,name:report_xlsx.model_report_report_xlsx_abstract
msgid "Abstract XLSX Report"
msgstr ""
#. module: report_xlsx
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract__display_name
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx__display_name
msgid "Display Name"
msgstr ""
#. module: report_xlsx
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract__id
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx__id
msgid "ID"
msgstr ""
#. module: report_xlsx
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract____last_update
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx____last_update
msgid "Last Modified on"
msgstr ""
#. module: report_xlsx
#: model:ir.model,name:report_xlsx.model_report_report_xlsx_partner_xlsx
msgid "Partner XLSX Report"
msgstr ""
#. module: report_xlsx
#: model:ir.actions.report,name:report_xlsx.partner_xlsx
msgid "Print to XLSX"
msgstr ""
#. module: report_xlsx
#: model:ir.model,name:report_xlsx.model_ir_actions_report
msgid "Report Action"
msgstr ""
#. module: report_xlsx
#: model:ir.model.fields,field_description:report_xlsx.field_ir_actions_report__report_type
msgid "Report Type"
msgstr ""
#. module: report_xlsx
#: model:ir.model.fields,help:report_xlsx.field_ir_actions_report__report_type
msgid ""
"The type of the report that will be rendered, each one having its own "
"rendering method. HTML means the report will be opened directly in your "
"browser PDF means the report will be rendered using Wkhtmltopdf and "
"downloaded by the user."
msgstr ""
#. module: report_xlsx
#. openerp-web
#: code:addons/report_xlsx/static/src/js/report/action_manager_report.js:0
#, python-format
msgid "Warning"
msgstr ""
#. module: report_xlsx
#: model:ir.model.fields.selection,name:report_xlsx.selection__ir_actions_report__report_type__xlsx
msgid "XLSX"
msgstr ""

View File

@ -0,0 +1,102 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * report_xlsx
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-05-31 03:52+0000\n"
"PO-Revision-Date: 2017-05-31 03:52+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n"
"Language-Team: Turkish (https://www.transifex.com/oca/teams/23907/tr/)\n"
"Language: tr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#. module: report_xlsx
#: code:addons/report_xlsx/models/ir_report.py:0
#, python-format
msgid "%s model was not found"
msgstr ""
#. module: report_xlsx
#. openerp-web
#: code:addons/report_xlsx/static/src/js/report/action_manager_report.js:0
#, python-format
msgid ""
"A popup window with your report was blocked. You may need to change your "
"browser settings to allow popup windows for this page."
msgstr ""
#. module: report_xlsx
#: model:ir.model,name:report_xlsx.model_report_report_xlsx_abstract
msgid "Abstract XLSX Report"
msgstr ""
#. module: report_xlsx
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract__display_name
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx__display_name
msgid "Display Name"
msgstr ""
#. module: report_xlsx
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract__id
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx__id
msgid "ID"
msgstr ""
#. module: report_xlsx
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract____last_update
#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx____last_update
msgid "Last Modified on"
msgstr ""
#. module: report_xlsx
#: model:ir.model,name:report_xlsx.model_report_report_xlsx_partner_xlsx
msgid "Partner XLSX Report"
msgstr ""
#. module: report_xlsx
#: model:ir.actions.report,name:report_xlsx.partner_xlsx
msgid "Print to XLSX"
msgstr ""
#. module: report_xlsx
#: model:ir.model,name:report_xlsx.model_ir_actions_report
msgid "Report Action"
msgstr ""
#. module: report_xlsx
#: model:ir.model.fields,field_description:report_xlsx.field_ir_actions_report__report_type
msgid "Report Type"
msgstr ""
#. module: report_xlsx
#: model:ir.model.fields,help:report_xlsx.field_ir_actions_report__report_type
msgid ""
"The type of the report that will be rendered, each one having its own "
"rendering method. HTML means the report will be opened directly in your "
"browser PDF means the report will be rendered using Wkhtmltopdf and "
"downloaded by the user."
msgstr ""
#. module: report_xlsx
#. openerp-web
#: code:addons/report_xlsx/static/src/js/report/action_manager_report.js:0
#, python-format
msgid "Warning"
msgstr ""
#. module: report_xlsx
#: model:ir.model.fields.selection,name:report_xlsx.selection__ir_actions_report__report_type__xlsx
msgid "XLSX"
msgstr ""
#, fuzzy
#~ msgid "ir.actions.report"
#~ msgstr "ir.actions.report.xml"

View File

@ -0,0 +1 @@
from . import ir_report

View File

@ -0,0 +1,37 @@
# Copyright 2015 ACSONE SA/NV (<http://acsone.eu>)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import _, api, fields, models
from odoo.exceptions import UserError
class ReportAction(models.Model):
_inherit = "ir.actions.report"
report_type = fields.Selection(selection_add=[("xlsx", "XLSX")])
@api.model
def render_xlsx(self, docids, data):
report_model_name = "report.%s" % self.report_name
report_model = self.env.get(report_model_name)
if report_model is None:
raise UserError(_("%s model was not found") % report_model_name)
return report_model.with_context(
active_model=self.model
).create_xlsx_report( # noqa
docids, data
)
@api.model
def _get_report_from_name(self, report_name):
res = super(ReportAction, self)._get_report_from_name(report_name)
if res:
return res
report_obj = self.env["ir.actions.report"]
qwebtypes = ["xlsx"]
conditions = [
("report_type", "in", qwebtypes),
("report_name", "=", report_name),
]
context = self.env["res.users"].context_get()
return report_obj.with_context(context).search(conditions, limit=1)

View File

@ -0,0 +1,7 @@
* Adrien Peiffer <adrien.peiffer@acsone.eu>
* Sébastien Alix <sebastien.alix@osiell.com>
* Stéphane Bidoul <stephane.bidoul@acsone.eu>
* Enric Tobella <etobella@creublanca.es>
* Graeme Gellatly <gdgellatly@gmail.com>
* Cristian Salamea <cs@prisehub.com>
* Rod Schouteden <rod.schouteden@dynapps.be>

View File

@ -0,0 +1 @@
This module provides a basic report class to generate xlsx report.

View File

@ -0,0 +1,7 @@
Make sure you have ``xlsxwriter`` Python module installed::
$ pip3 install xlsxwriter
For testing it is also necessary ``xlrd`` Python module installed::
$ pip3 install xlrd

View File

@ -0,0 +1,32 @@
An example of XLSX report for partners on a module called `module_name`:
A python class ::
from odoo import models
class PartnerXlsx(models.AbstractModel):
_name = 'report.module_name.report_name'
_inherit = 'report.report_xlsx.abstract'
def generate_xlsx_report(self, workbook, data, partners):
for obj in partners:
report_name = obj.name
# One sheet by partner
sheet = workbook.add_worksheet(report_name[:31])
bold = workbook.add_format({'bold': True})
sheet.write(0, 0, obj.name, bold)
To manipulate the ``workbook`` and ``sheet`` objects, refer to the
`documentation <http://xlsxwriter.readthedocs.org/>`_ of ``xlsxwriter``.
A report XML record ::
<report
id="partner_xlsx"
model="res.partner"
string="Print to XLSX"
report_type="xlsx"
name="module_name.report_name"
file="res_partner"
attachment_use="False"
/>

View File

@ -0,0 +1,2 @@
from . import report_abstract_xlsx
from . import report_partner_xlsx

View File

@ -0,0 +1,60 @@
# Copyright 2015 ACSONE SA/NV (<http://acsone.eu>)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
import logging
from io import BytesIO
from odoo import models
_logger = logging.getLogger(__name__)
try:
import xlsxwriter
except ImportError:
_logger.debug("Can not import xlsxwriter`.")
class ReportXlsxAbstract(models.AbstractModel):
_name = "report.report_xlsx.abstract"
_description = "Abstract XLSX Report"
def _get_objs_for_report(self, docids, data):
"""
Returns objects for xlx report. From WebUI these
are either as docids taken from context.active_ids or
in the case of wizard are in data. Manual calls may rely
on regular context, setting docids, or setting data.
:param docids: list of integers, typically provided by
qwebactionmanager for regular Models.
:param data: dictionary of data, if present typically provided
by qwebactionmanager for TransientModels.
:param ids: list of integers, provided by overrides.
:return: recordset of active model for ids.
"""
if docids:
ids = docids
elif data and "context" in data:
ids = data["context"].get("active_ids", [])
else:
ids = self.env.context.get("active_ids", [])
return self.env[self.env.context.get("active_model")].browse(ids)
def create_xlsx_report(self, docids, data):
objs = self._get_objs_for_report(docids, data)
file_data = BytesIO()
workbook = xlsxwriter.Workbook(file_data, self.get_workbook_options())
self.generate_xlsx_report(workbook, data, objs)
workbook.close()
file_data.seek(0)
return file_data.read(), "xlsx"
def get_workbook_options(self):
"""
See https://xlsxwriter.readthedocs.io/workbook.html constructor options
:return: A dictionary of options
"""
return {}
def generate_xlsx_report(self, workbook, data, objs):
raise NotImplementedError()

View File

@ -0,0 +1,16 @@
# Copyright 2017 Creu Blanca
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import models
class PartnerXlsx(models.AbstractModel):
_name = "report.report_xlsx.partner_xlsx"
_inherit = "report.report_xlsx.abstract"
_description = "Partner XLSX Report"
def generate_xlsx_report(self, workbook, data, partners):
for obj in partners:
sheet = workbook.add_worksheet("Report")
bold = workbook.add_format({"bold": True})
sheet.write(0, 0, obj.name, bold)

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Some files were not shown because too many files have changed in this diff Show More