mirror of
https://github.com/OCA/report-print-send.git
synced 2025-02-16 07:11:31 +02:00
24
.copier-answers.yml
Normal file
24
.copier-answers.yml
Normal file
@@ -0,0 +1,24 @@
|
||||
# Do NOT update manually; changes here will be overwritten by Copier
|
||||
_commit: v1.8.0
|
||||
_src_path: gh:oca/oca-addons-repo-template
|
||||
ci: GitHub
|
||||
dependency_installation_mode: PIP
|
||||
generate_requirements_txt: true
|
||||
github_check_license: true
|
||||
github_enable_codecov: true
|
||||
github_enable_makepot: true
|
||||
github_enable_stale_action: true
|
||||
github_enforce_dev_status_compatibility: true
|
||||
include_wkhtmltopdf: false
|
||||
odoo_version: 13.0
|
||||
org_name: Odoo Community Association (OCA)
|
||||
org_slug: OCA
|
||||
rebel_module_groups: []
|
||||
repo_description:
|
||||
This project aim to deal with modules related to manage document printing and sending
|
||||
in a generic way.
|
||||
repo_name: Odoo Printing Services and Printer related addons
|
||||
repo_slug: report-print-send
|
||||
repo_website: https://github.com/OCA/report-print-send
|
||||
travis_apt_packages: []
|
||||
travis_apt_sources: []
|
||||
37
.github/workflows/pre-commit.yml
vendored
Normal file
37
.github/workflows/pre-commit.yml
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
name: pre-commit
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- "13.0*"
|
||||
push:
|
||||
branches:
|
||||
- "13.0"
|
||||
- "13.0-ocabot-*"
|
||||
|
||||
jobs:
|
||||
pre-commit:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: "3.8"
|
||||
- name: Get python version
|
||||
run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
|
||||
- uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.cache/pre-commit
|
||||
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
|
||||
- name: Install pre-commit
|
||||
run: pip install pre-commit
|
||||
- name: Run pre-commit
|
||||
run: pre-commit run --all-files --show-diff-on-failure --color=always
|
||||
- name: Check that all files generated by pre-commit are in git
|
||||
run: |
|
||||
newfiles="$(git ls-files --others --exclude-from=.gitignore)"
|
||||
if [ "$newfiles" != "" ] ; then
|
||||
echo "Please check-in the following files:"
|
||||
echo "$newfiles"
|
||||
exit 1
|
||||
fi
|
||||
73
.github/workflows/test.yml
vendored
Normal file
73
.github/workflows/test.yml
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
name: tests
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- "13.0*"
|
||||
push:
|
||||
branches:
|
||||
- "13.0"
|
||||
- "13.0-ocabot-*"
|
||||
|
||||
jobs:
|
||||
unreleased-deps:
|
||||
runs-on: ubuntu-latest
|
||||
name: Detect unreleased dependencies
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: |
|
||||
for reqfile in requirements.txt test-requirements.txt ; do
|
||||
if [ -f ${reqfile} ] ; then
|
||||
result=0
|
||||
# reject non-comment lines that contain a / (i.e. URLs, relative paths)
|
||||
grep "^[^#].*/" ${reqfile} || result=$?
|
||||
if [ $result -eq 0 ] ; then
|
||||
echo "Unreleased dependencies found in ${reqfile}."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
done
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
container: ${{ matrix.container }}
|
||||
name: ${{ matrix.name }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- container: ghcr.io/oca/oca-ci/py3.6-odoo13.0:latest
|
||||
makepot: "true"
|
||||
name: test with Odoo
|
||||
- container: ghcr.io/oca/oca-ci/py3.6-ocb13.0:latest
|
||||
name: test with OCB
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:9.6
|
||||
env:
|
||||
POSTGRES_USER: odoo
|
||||
POSTGRES_PASSWORD: odoo
|
||||
POSTGRES_DB: odoo
|
||||
ports:
|
||||
- 5432:5432
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Install addons and dependencies
|
||||
run: oca_install_addons
|
||||
- name: Check licenses
|
||||
run: manifestoo -d . check-licenses
|
||||
- name: Check development status
|
||||
run: manifestoo -d . check-dev-status --default-dev-status=Beta
|
||||
- name: Initialize test db
|
||||
run: oca_init_test_database
|
||||
- name: Run tests
|
||||
run: oca_run_tests
|
||||
- uses: codecov/codecov-action@v1
|
||||
- name: Update .pot files
|
||||
run:
|
||||
oca_export_and_push_pot https://x-access-token:${{ secrets.GIT_PUSH_TOKEN
|
||||
}}@github.com/${{ github.repository }}
|
||||
if:
|
||||
${{ matrix.makepot == 'true' && github.event_name == 'push' &&
|
||||
github.repository_owner == 'OCA' }}
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -13,7 +13,6 @@ build/
|
||||
develop-eggs/
|
||||
dist/
|
||||
eggs/
|
||||
lib/
|
||||
lib64/
|
||||
parts/
|
||||
sdist/
|
||||
|
||||
@@ -15,7 +15,7 @@ default_language_version:
|
||||
node: "14.13.0"
|
||||
repos:
|
||||
- repo: https://github.com/psf/black
|
||||
rev: 19.10b0
|
||||
rev: 22.3.0
|
||||
hooks:
|
||||
- id: black
|
||||
- repo: https://github.com/prettier/pre-commit
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
[MASTER]
|
||||
load-plugins=pylint_odoo
|
||||
score=n
|
||||
|
||||
51
.travis.yml
51
.travis.yml
@@ -1,51 +0,0 @@
|
||||
language: python
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.cache/pip
|
||||
- $HOME/.cache/pre-commit
|
||||
|
||||
python:
|
||||
- "3.6"
|
||||
|
||||
addons:
|
||||
postgresql: "9.6"
|
||||
apt:
|
||||
packages:
|
||||
- expect-dev # provides unbuffer utility
|
||||
- cups
|
||||
- libcups2-dev
|
||||
|
||||
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"
|
||||
- stage: test
|
||||
env:
|
||||
- TESTS="1" ODOO_REPO="OCA/OCB"
|
||||
|
||||
env:
|
||||
global:
|
||||
- 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
|
||||
- export PATH=${HOME}/maintainer-quality-tools/travis:${PATH}
|
||||
- travis_install_nightly
|
||||
|
||||
script:
|
||||
- travis_run_tests
|
||||
|
||||
after_success:
|
||||
- travis_after_tests_success
|
||||
45
README.md
45
README.md
@@ -1,14 +1,37 @@
|
||||

|
||||
[](https://runbot.odoo-community.org/runbot/repo/github-com-oca-report-print-send-144)
|
||||
[](https://travis-ci.org/OCA/report-print-send)
|
||||
[](https://coveralls.io/github/OCA/report-print-send?branch=13.0)
|
||||
|
||||
Report - Printing and Sending
|
||||
=============================
|
||||
[](https://runboat.odoo-community.org/builds?repo=OCA/report-print-send&target_branch=13.0)
|
||||
[](https://github.com/OCA/report-print-send/actions/workflows/pre-commit.yml?query=branch%3A13.0)
|
||||
[](https://github.com/OCA/report-print-send/actions/workflows/test.yml?query=branch%3A13.0)
|
||||
[](https://codecov.io/gh/OCA/report-print-send)
|
||||
[](https://translation.odoo-community.org/engage/report-print-send-13-0/?utm_source=widget)
|
||||
|
||||
This project aim to deal with modules related to manage document printing and sending in a generic way. You'll find modules that:
|
||||
<!-- /!\ do not modify above this line -->
|
||||
|
||||
- Interface Odoo with Pingen (https://www.pingen.com/en)
|
||||
- Add an printing queue
|
||||
- Allow to choose printer
|
||||
- ...
|
||||
# Odoo Printing Services and Printer related addons
|
||||
|
||||
This project aim to deal with modules related to manage document printing and sending in a generic way.
|
||||
|
||||
<!-- /!\ do not modify below this line -->
|
||||
|
||||
<!-- prettier-ignore-start -->
|
||||
|
||||
[//]: # (addons)
|
||||
|
||||
This part will be replaced when running the oca-gen-addons-table script from OCA/maintainer-tools.
|
||||
|
||||
[//]: # (end addons)
|
||||
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
## 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 Odoo Community Association (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.
|
||||
|
||||
50
README.md.rej
Normal file
50
README.md.rej
Normal file
@@ -0,0 +1,50 @@
|
||||
diff a/README.md b/README.md (rejected hunks)
|
||||
@@ -1,37 +1,14 @@
|
||||
+
|
||||
+[](https://runbot.odoo-community.org/runbot/repo/github-com-oca-report-print-send-144)
|
||||
+[](https://travis-ci.org/OCA/report-print-send)
|
||||
+[](https://coveralls.io/github/OCA/report-print-send?branch=13.0)
|
||||
|
||||
-[](https://runboat.odoo-community.org/builds?repo=OCA/report-print-send&target_branch=13.0)
|
||||
-[](https://github.com/OCA/report-print-send/actions/workflows/pre-commit.yml?query=branch%3A13.0)
|
||||
-[](https://github.com/OCA/report-print-send/actions/workflows/test.yml?query=branch%3A13.0)
|
||||
-[](https://codecov.io/gh/OCA/report-print-send)
|
||||
-[](https://translation.odoo-community.org/engage/report-print-send-13-0/?utm_source=widget)
|
||||
+Report - Printing and Sending
|
||||
+=============================
|
||||
|
||||
-<!-- /!\ do not modify above this line -->
|
||||
+This project aim to deal with modules related to manage document printing and sending in a generic way. You'll find modules that:
|
||||
|
||||
-# report-print-send
|
||||
-
|
||||
-TODO: add repo description.
|
||||
-
|
||||
-<!-- /!\ do not modify below this line -->
|
||||
-
|
||||
-<!-- prettier-ignore-start -->
|
||||
-
|
||||
-[//]: # (addons)
|
||||
-
|
||||
-This part will be replaced when running the oca-gen-addons-table script from OCA/maintainer-tools.
|
||||
-
|
||||
-[//]: # (end addons)
|
||||
-
|
||||
-<!-- prettier-ignore-end -->
|
||||
-
|
||||
-## 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 Odoo Community Association (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.
|
||||
+ - Interface Odoo with Pingen (https://www.pingen.com/en)
|
||||
+ - Add an printing queue
|
||||
+ - Allow to choose printer
|
||||
+ - ...
|
||||
@@ -133,8 +133,7 @@ class TestIrActionsReportXml(TransactionCase):
|
||||
)
|
||||
|
||||
def test_behaviour_printing_action_on_wrong_user(self):
|
||||
""" It should return the action and printer ignoring printing action
|
||||
"""
|
||||
"""It should return the action and printer ignoring printing action"""
|
||||
report = self.Model.search([], limit=1)
|
||||
self.env.user.printing_action = "client"
|
||||
printing_action = self.new_printing_action()
|
||||
@@ -147,8 +146,7 @@ class TestIrActionsReportXml(TransactionCase):
|
||||
)
|
||||
|
||||
def test_behaviour_printing_action_on_wrong_report(self):
|
||||
""" It should return the action and printer ignoring printing action
|
||||
"""
|
||||
"""It should return the action and printer ignoring printing action"""
|
||||
report = self.Model.search([], limit=1)
|
||||
self.env.user.printing_action = "client"
|
||||
printing_action = self.new_printing_action()
|
||||
|
||||
@@ -98,7 +98,8 @@ class TestPrintingServer(TransactionCase):
|
||||
cups.Connection().getPrinters().get.return_value = False
|
||||
self.Model.action_update_printers()
|
||||
self.assertEqual(
|
||||
"unavailable", rec_id.status,
|
||||
"unavailable",
|
||||
rec_id.status,
|
||||
)
|
||||
|
||||
@mock.patch("%s.cups" % model)
|
||||
|
||||
@@ -82,8 +82,7 @@ class TestReport(common.HttpCase):
|
||||
self.assertFalse(res)
|
||||
|
||||
def test_render_qweb_pdf_not_printable(self):
|
||||
""" It should print the report, only if it is printable
|
||||
"""
|
||||
"""It should print the report, only if it is printable"""
|
||||
with mock.patch(
|
||||
"odoo.addons.base_report_to_printer.models."
|
||||
"printing_printer.PrintingPrinter."
|
||||
@@ -93,8 +92,7 @@ class TestReport(common.HttpCase):
|
||||
print_document.assert_not_called()
|
||||
|
||||
def test_render_qweb_pdf_printable(self):
|
||||
""" It should print the report, only if it is printable
|
||||
"""
|
||||
"""It should print the report, only if it is printable"""
|
||||
with mock.patch(
|
||||
"odoo.addons.base_report_to_printer.models."
|
||||
"printing_printer.PrintingPrinter."
|
||||
|
||||
@@ -66,7 +66,9 @@ class PrintingLabelZpl2(models.Model):
|
||||
default=True,
|
||||
)
|
||||
action_window_id = fields.Many2one(
|
||||
comodel_name="ir.actions.act_window", string="Action", readonly=True,
|
||||
comodel_name="ir.actions.act_window",
|
||||
string="Action",
|
||||
readonly=True,
|
||||
)
|
||||
test_print_mode = fields.Boolean(string="Mode Print")
|
||||
test_labelary_mode = fields.Boolean(string="Mode Labelary")
|
||||
|
||||
@@ -13,4 +13,6 @@ class PrintingAction(models.Model):
|
||||
res.append(("remote_default", "Use remote's default"))
|
||||
return res
|
||||
|
||||
action_type = fields.Selection(selection=_available_action_types,)
|
||||
action_type = fields.Selection(
|
||||
selection=_available_action_types,
|
||||
)
|
||||
|
||||
@@ -7,7 +7,8 @@ class ResRemote(models.Model):
|
||||
_inherit = "res.remote"
|
||||
|
||||
remote_printer_ids = fields.One2many(
|
||||
"res.remote.printer", inverse_name="remote_id",
|
||||
"res.remote.printer",
|
||||
inverse_name="remote_id",
|
||||
)
|
||||
|
||||
def get_printer_behaviour(self):
|
||||
|
||||
@@ -8,10 +8,19 @@ class ResRemotePrinter(models.Model):
|
||||
_name = "res.remote.printer"
|
||||
_description = "Remote Printer"
|
||||
|
||||
remote_id = fields.Many2one("res.remote", ondelete="cascade", readonly=True,)
|
||||
printer_id = fields.Many2one("printing.printer", ondelete="cascade",)
|
||||
remote_id = fields.Many2one(
|
||||
"res.remote",
|
||||
ondelete="cascade",
|
||||
readonly=True,
|
||||
)
|
||||
printer_id = fields.Many2one(
|
||||
"printing.printer",
|
||||
ondelete="cascade",
|
||||
)
|
||||
printer_tray_id = fields.Many2one(
|
||||
"printing.tray", ondelete="cascade", domain="[('printer_id', '=', printer_id)]",
|
||||
"printing.tray",
|
||||
ondelete="cascade",
|
||||
domain="[('printer_id', '=', printer_id)]",
|
||||
)
|
||||
is_default = fields.Boolean(default=False)
|
||||
printer_usage = fields.Selection([("standard", "Standard")], default="standard")
|
||||
|
||||
@@ -68,8 +68,7 @@ class StockPikcing(TransactionCase):
|
||||
self.uom_unit = self.env.ref("uom.product_uom_unit")
|
||||
|
||||
def test_stock_picking_auto_print(self):
|
||||
""" Auto print when DO is ready or done
|
||||
"""
|
||||
"""Auto print when DO is ready or done"""
|
||||
self.env["stock.quant"]._update_available_quantity(
|
||||
self.product_A, self.stock_location, 2
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user