diff --git a/.copier-answers.yml b/.copier-answers.yml new file mode 100644 index 0000000..6f847ea --- /dev/null +++ b/.copier-answers.yml @@ -0,0 +1,13 @@ +# Do NOT update manually; changes here will be overwritten by Copier +_commit: v1.1.3 +_src_path: https://github.com/OCA/oca-addons-repo-template.git +dependency_installation_mode: OCA +generate_requirements_txt: true +include_wkhtmltopdf: false +odoo_version: 13.0 +rebel_module_groups: [] +repo_description: Reports for the Odoo Logistics modules +repo_name: Odoo Stock Logistics Reporting +repo_slug: stock-logistics-reporting +travis_apt_packages: [] +travis_apt_sources: [] diff --git a/.editorconfig b/.editorconfig index 62276b0..bfd7ac5 100644 --- a/.editorconfig +++ b/.editorconfig @@ -7,11 +7,11 @@ indent_style = space insert_final_newline = true trim_trailing_whitespace = true -[.eslintrc,*.{json,yml,yaml,rst,md}] +[*.{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] +[{*/static/{lib,src/lib}/**,*/static/description/index.html,*/readme/../README.rst}] charset = unset end_of_line = unset indent_size = unset diff --git a/.eslintrc.yml b/.eslintrc.yml new file mode 100644 index 0000000..88f2881 --- /dev/null +++ b/.eslintrc.yml @@ -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 diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 0000000..335381c --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,13 @@ +name: pre-commit + +on: + pull_request: + push: + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + - uses: pre-commit/action@v2.0.0 diff --git a/.gitignore b/.gitignore index 5c55458..818770f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] +/.venv +/.pytest_cache # C extensions *.so @@ -21,6 +23,7 @@ var/ *.egg-info/ .installed.cfg *.egg +*.eggs # Installer logs pip-log.txt @@ -40,6 +43,19 @@ coverage.xml # Pycharm .idea +# Eclipse +.settings + +# Visual Studio cache/options directory +.vs/ +.vscode + +# OSX Files +.DS_Store + +# Django stuff: +*.log + # Mr Developer .mr.developer.cfg .project @@ -55,5 +71,5 @@ docs/_build/ *~ *.swp -# Visual Studio cache/options directory -.vs/ +# OCA rules +!static/lib/ diff --git a/.isort.cfg b/.isort.cfg index 98b216f..7683bad 100644 --- a/.isort.cfg +++ b/.isort.cfg @@ -9,4 +9,4 @@ line_length=88 known_odoo=odoo known_odoo_addons=odoo.addons sections=FUTURE,STDLIB,THIRDPARTY,ODOO,ODOO_ADDONS,FIRSTPARTY,LOCALFOLDER -known_third_party=setuptools +default_section=THIRDPARTY diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a9576b4..adeeab9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,69 +1,128 @@ -exclude: "^setup/|/static/lib/|/static/src/lib/" +exclude: | + (?x) + # NOT INSTALLABLE ADDONS + # END NOT INSTALLABLE ADDONS + # Files and folders generated by bots, to avoid loops + ^setup/|/static/description/index\.html$| + # We don't want to mess with tool-generated files + .svg$| + # 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 node: "14.13.0" repos: -- repo: https://github.com/psf/black - rev: 19.3b0 - hooks: - - id: black -- repo: https://github.com/pre-commit/pre-commit-hooks - rev: v2.3.0 - hooks: - - id: trailing-whitespace - # exclude autogenerated files - exclude: /README\.rst$|\.pot?$ - - id: end-of-file-fixer - # exclude autogenerated files - exclude: /README\.rst$|\.pot?$ - - id: debug-statements - - id: flake8 - name: flake8 except __init__.py - exclude: /__init__\.py$ - additional_dependencies: ["flake8-bugbear==19.8.0"] - - id: flake8 - name: flake8 only __init__.py - args: ["--extend-ignore=F401"] # ignore unused imports in __init__.py - files: /__init__\.py$ - additional_dependencies: ["flake8-bugbear==19.8.0"] - - id: fix-encoding-pragma - args: ["--remove"] - - id: check-case-conflict - - id: check-docstring-first - - id: check-executables-have-shebangs - - id: check-merge-conflict - - id: check-symlinks - - id: check-xml - - id: mixed-line-ending - args: ["--fix=lf"] -- repo: https://github.com/pre-commit/mirrors-pylint - rev: v2.3.1 - hooks: - - id: pylint - name: pylint with optional checks - args: ["--rcfile=.pylintrc", "--exit-zero"] - verbose: true - additional_dependencies: ["pylint-odoo==3.0.3"] - - id: pylint - name: pylint with mandatory checks - args: ["--rcfile=.pylintrc-mandatory"] - additional_dependencies: ["pylint-odoo==3.0.3"] -- repo: https://github.com/asottile/pyupgrade - rev: v1.24.0 - 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 - hooks: - - id: eslint - verbose: true + - repo: local + hooks: + # These files are most likely copier diff rejection junks; if found, + # review them manually, fix the problem (if needed) and remove them + - id: forbidden-files + name: forbidden files + entry: found forbidden files; remove them + language: fail + files: "\\.rej$" + - repo: https://github.com/oca/maintainer-tools + rev: ab1d7f6 + hooks: + # update the NOT INSTALLABLE ADDONS section above + - id: oca-update-pre-commit-excluded-addons + - id: oca-fix-manifest-website + args: ["https://github.com/OCA/stock-logistics-reporting"] + - repo: https://github.com/myint/autoflake + rev: v1.4 + hooks: + - id: autoflake + args: ["-i", "--ignore-init-module-imports"] + - repo: https://github.com/psf/black + rev: 19.10b0 + hooks: + - id: black + - repo: https://github.com/pre-commit/mirrors-prettier + rev: v1.19.1 + hooks: + - id: prettier + name: prettier (with plugin-xml) + entry: prettier --write --list-different + additional_dependencies: + - "prettier@1.19.1" + - "@prettier/plugin-xml@0.7.2" + files: \.(css|htm|html|js|json|jsx|less|md|scss|toml|ts|xml|yaml|yml)$ + - 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.4.0 + hooks: + - id: trailing-whitespace + # exclude autogenerated files + exclude: /README\.rst$|\.pot?$ + - id: end-of-file-fixer + # exclude autogenerated files + exclude: /README\.rst$|\.pot?$ + - id: debug-statements + - id: fix-encoding-pragma + args: ["--remove"] + - id: check-case-conflict + - 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 + args: ["--fix=lf"] + - repo: https://github.com/asottile/pyupgrade + rev: v1.26.2 + hooks: + - id: pyupgrade + args: ["--keep-percent-format"] + - 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/acsone/setuptools-odoo + rev: 2.5.2 + hooks: + - id: setuptools-odoo-make-default + - repo: https://gitlab.com/pycqa/flake8 + rev: 3.7.9 + hooks: + - id: flake8 + name: flake8 except __init__.py + exclude: /__init__\.py$ + additional_dependencies: ["flake8-bugbear==19.8.0"] + - id: flake8 + name: flake8 only __init__.py + args: ["--extend-ignore=F401"] # ignore unused imports in __init__.py + files: /__init__\.py$ + additional_dependencies: ["flake8-bugbear==19.8.0"] + - repo: https://github.com/pre-commit/mirrors-pylint + rev: v2.5.3 + hooks: + - id: pylint + name: pylint with optional checks + args: + - --rcfile=.pylintrc + - --exit-zero + verbose: true + additional_dependencies: &pylint_deps + - pylint-odoo==3.5.0 + - id: pylint + name: pylint with mandatory checks + args: + - --rcfile=.pylintrc-mandatory + additional_dependencies: *pylint_deps diff --git a/.prettierrc.yml b/.prettierrc.yml new file mode 100644 index 0000000..5b6d4b3 --- /dev/null +++ b/.prettierrc.yml @@ -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: "strict" diff --git a/.pylintrc b/.pylintrc index 485836b..c3d75e1 100644 --- a/.pylintrc +++ b/.pylintrc @@ -46,8 +46,6 @@ enable=anomalous-backslash-in-string, method-inverse, method-required-super, method-search, - missing-import-error, - missing-manifest-dependency, openerp-exception-warning, pointless-statement, pointless-string-statement, @@ -73,6 +71,7 @@ enable=anomalous-backslash-in-string, deprecated-module, file-not-used, invalid-commit, + missing-manifest-dependency, missing-newline-extrafiles, missing-readme, no-utf8-coding-comment, @@ -82,6 +81,7 @@ enable=anomalous-backslash-in-string, too-complex, unnecessary-utf8-coding-comment + [REPORTS] msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg} output-format=colorized diff --git a/.pylintrc-mandatory b/.pylintrc-mandatory index 55893fe..3e19630 100644 --- a/.pylintrc-mandatory +++ b/.pylintrc-mandatory @@ -39,8 +39,6 @@ enable=anomalous-backslash-in-string, method-inverse, method-required-super, method-search, - missing-import-error, - missing-manifest-dependency, openerp-exception-warning, pointless-statement, pointless-string-statement, diff --git a/.travis.yml b/.travis.yml index 8d16e8f..adfc611 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,8 @@ language: python cache: directories: - - $HOME/.cache/pip - - $HOME/.cache/pre-commit + - $HOME/.cache/pip + - $HOME/.cache/pre-commit python: - "3.6" @@ -11,33 +11,26 @@ addons: postgresql: "9.6" apt: packages: - - expect-dev # provides unbuffer utility + - expect-dev # provides unbuffer utility stages: - - linting - test jobs: include: - - stage: linting - name: "pre-commit" - before_install: - install: pip install pre-commit - script: pre-commit run --all --show-diff-on-failure --verbose --color always - after_success: - stage: test env: - - TESTS="1" ODOO_REPO="odoo/odoo" MAKEPOT="1" + - TESTS=1 ODOO_REPO="odoo/odoo" MAKEPOT="1" - stage: test env: - - TESTS="1" ODOO_REPO="OCA/OCB" - + - TESTS=1 ODOO_REPO="OCA/OCB" env: global: - - VERSION="13.0" TESTS="0" LINT_CHECK="0" MAKEPOT="0" + - 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 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..9ac71fe --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,10 @@ +# OCA Guidelines + +Please follow the official guide from the +[OCA Guidelines page](https://odoo-community.org/page/contributing). + +## Project Specific Guidelines + + + +This project does not have specific coding guidelines. diff --git a/LICENSE b/LICENSE index 58777e3..be3f7b2 100644 --- a/LICENSE +++ b/LICENSE @@ -1,7 +1,7 @@ -GNU AFFERO GENERAL PUBLIC LICENSE + GNU AFFERO GENERAL PUBLIC LICENSE Version 3, 19 November 2007 - Copyright (C) 2007 Free Software Foundation, Inc. + Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -633,8 +633,8 @@ the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -643,7 +643,7 @@ the "copyright" line and a pointer to where the full notice is found. GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. @@ -658,4 +658,4 @@ specific requirements. You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU AGPL, see -. +. diff --git a/README.md b/README.md index 044a7ec..52c23e4 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,42 @@ -[](https://travis-ci.org/OCA/stock-logistics-reporting) -[](https://coveralls.io/r/OCA/stock-logistics-reporting?branch=13.0) +[](https://runbot.odoo-community.org/runbot/repo/github-com-oca-stock-logistics-reporting-151) +[](https://travis-ci.com/OCA/stock-logistics-reporting) +[](https://codecov.io/gh/OCA/stock-logistics-reporting) +[](https://translation.odoo-community.org/engage/stock-logistics-reporting-13-0/?utm_source=widget) -Odoo Stock Logistics Reporting -============================== + -Reports for the Odoo Logistics modules. +# Odoo Stock Logistics Reporting - - Stock Picking Partner Lang: adds possibility to print picking in partner language +Reports for the Odoo Logistics modules + + + + + +[//]: # (addons) + +Available addons +---------------- +addon | version | summary +--- | --- | --- +[stock_card_report](stock_card_report/) | 13.0.1.0.0 | Add stock card report on Inventory Reporting. +[stock_picking_report_valued](stock_picking_report_valued/) | 13.0.1.1.0 | Adding Valued Picking on Delivery Slip report +[stock_quantity_history_location](stock_quantity_history_location/) | 13.0.1.1.0 | Provides stock quantity by location on past date + +[//]: # (end addons) + + + +## Licenses + +This repository is licensed under [AGPL-3.0](LICENSE). + +However, each module can have a totally different license, as long as they adhere to OCA +policy. Consult each module's `__manifest__.py` file, which contains a `license` key +that explains its license. + +---- + +OCA, or the [Odoo Community Association](http://odoo-community.org/), is a nonprofit +organization whose mission is to support the collaborative development of Odoo features +and promote its widespread use. diff --git a/oca_dependencies.txt b/oca_dependencies.txt index 5cd2498..931da65 100644 --- a/oca_dependencies.txt +++ b/oca_dependencies.txt @@ -1,2 +1,3 @@ +# See https://github.com/OCA/odoo-community.org/blob/master/website/Contribution/CONTRIBUTING.rst#oca_dependencies-txt server-ux reporting-engine diff --git a/stock_card_report/data/paper_format.xml b/stock_card_report/data/paper_format.xml index 163c384..ca082e9 100644 --- a/stock_card_report/data/paper_format.xml +++ b/stock_card_report/data/paper_format.xml @@ -2,7 +2,7 @@ Stock Card A4 - + A4 0 0 @@ -11,7 +11,7 @@ 28 7 7 - + 24 90 diff --git a/stock_card_report/data/report_data.xml b/stock_card_report/data/report_data.xml index f630564..873a0ab 100644 --- a/stock_card_report/data/report_data.xml +++ b/stock_card_report/data/report_data.xml @@ -6,21 +6,25 @@ - + - + diff --git a/stock_card_report/reports/stock_card_report.xml b/stock_card_report/reports/stock_card_report.xml index f993f2d..0310d15 100644 --- a/stock_card_report/reports/stock_card_report.xml +++ b/stock_card_report/reports/stock_card_report.xml @@ -1,26 +1,39 @@ - + - - + + - - + + @@ -28,15 +41,19 @@ - Print - Export + Print + Export - - + + @@ -44,7 +61,7 @@ - + @@ -54,36 +71,45 @@ - Stock Card - - + Stock Card - + - + - + - + - + Initial - - + + - + - - - - + + + + - + @@ -97,13 +123,13 @@ - + - + - + @@ -124,19 +150,19 @@ - + - + - + - + - + diff --git a/stock_card_report/static/src/css/report.css b/stock_card_report/static/src/css/report.css index a07a6cd..043291d 100644 --- a/stock_card_report/static/src/css/report.css +++ b/stock_card_report/static/src/css/report.css @@ -2,7 +2,7 @@ display: table !important; background-color: white; } -.act_as_row { +.act_as_row { display: table-row !important; page-break-inside: avoid; } @@ -14,21 +14,21 @@ display: table-header-group !important; } .act_as_row.labels { - background-color:#F0F0F0 !important; + background-color: #f0f0f0 !important; } .data_table { width: 100% !important; - border-left:0px; - border-right:0px; - text-align:center; - font-size:10px; - padding-right:3px; - padding-left:3px; - padding-top:2px; - padding-bottom:2px; - border-collapse:collapse; + border-left: 0px; + border-right: 0px; + text-align: center; + font-size: 10px; + padding-right: 3px; + padding-left: 3px; + padding-top: 2px; + padding-bottom: 2px; + border-collapse: collapse; } -.data_table .act_as_cell{ +.data_table .act_as_cell { border: 1px solid lightGrey; text-align: center; } @@ -39,13 +39,13 @@ font-weight: bold; } .act_as_cell.left { - text-align:left; + text-align: left; } .act_as_cell.right { - text-align:right; + text-align: right; } .custom_footer { - font-size:7px !important; + font-size: 7px !important; } .button_row { padding-bottom: 10px; diff --git a/stock_card_report/static/src/js/stock_card_report_backend.js b/stock_card_report/static/src/js/stock_card_report_backend.js index 2833649..036eb90 100644 --- a/stock_card_report/static/src/js/stock_card_report_backend.js +++ b/stock_card_report/static/src/js/stock_card_report_backend.js @@ -1,19 +1,18 @@ -odoo.define('stock_card_report.stock_card_report_backend', function (require) { - 'use strict'; - - var AbstractAction = require('web.AbstractAction'); - var core = require('web.core'); - var ReportWidget = require('web.Widget'); +odoo.define("stock_card_report.stock_card_report_backend", function(require) { + "use strict"; + var AbstractAction = require("web.AbstractAction"); + var core = require("web.core"); + var ReportWidget = require("web.Widget"); var report_backend = AbstractAction.extend({ hasControlPanel: true, // Stores all the parameters of the action. events: { - 'click .o_stock_card_reports_print': 'print', - 'click .o_stock_card_reports_export': 'export', + "click .o_stock_card_reports_print": "print", + "click .o_stock_card_reports_export": "export", }, - init: function (parent, action) { + init: function(parent, action) { this._super.apply(this, arguments); this.actionManager = parent; this.given_context = {}; @@ -22,49 +21,48 @@ odoo.define('stock_card_report.stock_card_report_backend', function (require) { if (action.context.context) { this.given_context = action.context.context; } - this.given_context.active_id = action.context.active_id || - action.params.active_id; + this.given_context.active_id = + action.context.active_id || action.params.active_id; this.given_context.model = action.context.active_model || false; this.given_context.ttype = action.context.ttype || false; }, - willStart: function () { + willStart: function() { return Promise.all([this._super.apply(this, arguments), this.get_html()]); }, - set_html: function () { + set_html: function() { var self = this; var def = Promise.resolve(); if (!this.report_widget) { this.report_widget = new ReportWidget(this, this.given_context); - def = this.report_widget.appendTo(this.$('.o_content')); + def = this.report_widget.appendTo(this.$(".o_content")); } - def.then(function () { + def.then(function() { self.report_widget.$el.html(self.html); }); }, - start: function () { + start: function() { this.set_html(); return this._super(); }, // Fetches the html and is previous report.context if any, // else create it - get_html: function () { + get_html: function() { var self = this; var defs = []; return this._rpc({ model: this.given_context.model, - method: 'get_html', + method: "get_html", args: [self.given_context], context: self.odoo_context, - }) - .then(function (result) { - self.html = result.html; - defs.push(self.update_cp()); - return $.when.apply($, defs); - }); + }).then(function(result) { + self.html = result.html; + defs.push(self.update_cp()); + return $.when.apply($, defs); + }); }, // Updates the control panel and render the elements that have yet // to be rendered - update_cp: function () { + update_cp: function() { if (this.$buttons) { var status = { breadcrumbs: this.actionManager.get_breadcrumbs(), @@ -73,40 +71,37 @@ odoo.define('stock_card_report.stock_card_report_backend', function (require) { return this.update_control_panel(status); } }, - do_show: function () { + do_show: function() { this._super(); this.update_cp(); }, - print: function () { + print: function() { var self = this; this._rpc({ model: this.given_context.model, - method: 'print_report', - args: [this.given_context.active_id, 'qweb-pdf'], + method: "print_report", + args: [this.given_context.active_id, "qweb-pdf"], context: self.odoo_context, - }).then(function (result) { + }).then(function(result) { self.do_action(result); }); }, - export: function () { + export: function() { var self = this; this._rpc({ model: this.given_context.model, - method: 'print_report', - args: [this.given_context.active_id, 'xlsx'], + method: "print_report", + args: [this.given_context.active_id, "xlsx"], context: self.odoo_context, - }).then(function (result) { + }).then(function(result) { self.do_action(result); }); }, - canBeRemoved: function () { + canBeRemoved: function() { return Promise.resolve(); }, }); - core.action_registry.add( - "stock_card_report_backend", - report_backend - ); + core.action_registry.add("stock_card_report_backend", report_backend); return report_backend; }); diff --git a/stock_card_report/wizard/stock_card_report_wizard_view.xml b/stock_card_report/wizard/stock_card_report_wizard_view.xml index f0570dc..031ff36 100644 --- a/stock_card_report/wizard/stock_card_report_wizard_view.xml +++ b/stock_card_report/wizard/stock_card_report_wizard_view.xml @@ -7,22 +7,35 @@ - - - + + + - - + + @@ -37,9 +50,11 @@ new - + diff --git a/stock_picking_report_valued/report/stock_picking_report_valued.xml b/stock_picking_report_valued/report/stock_picking_report_valued.xml index ef19b0d..8847b9e 100644 --- a/stock_picking_report_valued/report/stock_picking_report_valued.xml +++ b/stock_picking_report_valued/report/stock_picking_report_valued.xml @@ -1,9 +1,11 @@ - + - + Qty Reserved @@ -20,21 +22,25 @@ - - + + - + + t-field="move_line.sale_price_subtotal" + /> + t-field="move_line.sale_tax_description" + /> - + @@ -47,13 +53,13 @@ - + - + - + diff --git a/stock_picking_report_valued/views/res_partner_view.xml b/stock_picking_report_valued/views/res_partner_view.xml index c9229a5..3186418 100644 --- a/stock_picking_report_valued/views/res_partner_view.xml +++ b/stock_picking_report_valued/views/res_partner_view.xml @@ -1,13 +1,16 @@ - + Partner view (Valued picking) res.partner - + - - + + diff --git a/stock_quantity_history_location/static/src/js/inventory_report.js b/stock_quantity_history_location/static/src/js/inventory_report.js index f2e054f..1e00fdc 100644 --- a/stock_quantity_history_location/static/src/js/inventory_report.js +++ b/stock_quantity_history_location/static/src/js/inventory_report.js @@ -1,23 +1,25 @@ -odoo.define('stock.InventoryReportLocationListController', function (require) { -"use strict"; +/* eslint-disable no-unused-vars */ +odoo.define("stock.InventoryReportLocationListController", function(require) { + "use strict"; -var core = require('web.core'); -var InventoryReportListController = require('stock.InventoryReportListController'); + var core = require("web.core"); + var InventoryReportListController = require("stock.InventoryReportListController"); -var qweb = core.qweb; -var _t = core._t; + var qweb = core.qweb; + var _t = core._t; - -var InventoryReportLocationListController = InventoryReportListController.include({ - - renderButtons: function ($node) { - this._super.apply(this, arguments); - if (this.context.no_at_date) { - return; - } - if (this.modelName === "stock.quant") { - $node.find('.o_list_buttons').find(".btn-primary").html(_t("Inventory at Date & Location")) - } - }, -}); + var InventoryReportLocationListController = InventoryReportListController.include({ + renderButtons: function($node) { + this._super.apply(this, arguments); + if (this.context.no_at_date) { + return; + } + if (this.modelName === "stock.quant") { + $node + .find(".o_list_buttons") + .find(".btn-primary") + .html(_t("Inventory at Date & Location")); + } + }, + }); }); diff --git a/stock_quantity_history_location/wizards/stock_quantity_history.xml b/stock_quantity_history_location/wizards/stock_quantity_history.xml index 88b8e58..d81ccff 100644 --- a/stock_quantity_history_location/wizards/stock_quantity_history.xml +++ b/stock_quantity_history_location/wizards/stock_quantity_history.xml @@ -1,22 +1,33 @@ - + - + - + Inventory Report stock.quantity.history - + - - + +