-
-
Notifications
You must be signed in to change notification settings - Fork 239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[14.0][ADD] auto_printing_stock_picking #354
Open
jbaudoux
wants to merge
4
commits into
OCA:14.0
Choose a base branch
from
jbaudoux:14-auto_printing_stock_picking
base: 14.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
=========================== | ||
Printing Auto Stock Picking | ||
=========================== | ||
|
||
.. | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! source digest: sha256:4710fc372fc2fd7f0e76ac7a85e80d0085d241012504943c41d828f44863809e | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
|
||
.. |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%2Fstock--logistics--reporting-lightgray.png?logo=github | ||
:target: https://github.com/OCA/stock-logistics-reporting/tree/14.0/printing_auto_stock_picking | ||
:alt: OCA/stock-logistics-reporting | ||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png | ||
:target: https://translation.odoo-community.org/projects/stock-logistics-reporting-14-0/stock-logistics-reporting-14-0-printing_auto_stock_picking | ||
:alt: Translate me on Weblate | ||
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png | ||
:target: https://runboat.odoo-community.org/builds?repo=OCA/stock-logistics-reporting&target_branch=14.0 | ||
:alt: Try me on Runboat | ||
|
||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
||
When a picking is done, automatically trigger the printing of some documents. | ||
This can be used to print a delivery slip (report) or labels received from the carrier (attachment). | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
Configuration | ||
============= | ||
|
||
Go to the Operation Type and configure which report or attachment to print. | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/stock-logistics-reporting/issues>`_. | ||
In case of trouble, please check there if your issue has already been reported. | ||
If you spotted it first, help us to smash it by providing a detailed and welcomed | ||
`feedback <https://github.com/OCA/stock-logistics-reporting/issues/new?body=module:%20printing_auto_stock_picking%0Aversion:%2014.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 | ||
~~~~~~~ | ||
|
||
* BCIM | ||
* MT Software | ||
|
||
Contributors | ||
~~~~~~~~~~~~ | ||
|
||
* Jacques-Etienne Baudoux (BCIM) <[email protected]> | ||
* Michael Tietz (MT Software) <[email protected]> | ||
* Camptocamp | ||
* Christopher Hansen <[email protected]> | ||
|
||
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-jbaudoux| image:: https://github.com/jbaudoux.png?size=40px | ||
:target: https://github.com/jbaudoux | ||
:alt: jbaudoux | ||
|
||
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__: | ||
|
||
|maintainer-jbaudoux| | ||
|
||
This module is part of the `OCA/stock-logistics-reporting <https://github.com/OCA/stock-logistics-reporting/tree/14.0/printing_auto_stock_picking>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Copyright 2022 Jacques-Etienne Baudoux (BCIM) <[email protected]> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
{ | ||
"name": "Printing Auto Stock Picking", | ||
"author": "BCIM, MT Software, Odoo Community Association (OCA)", | ||
"maintainers": ["jbaudoux"], | ||
"category": "Warehouse Management", | ||
"data": [ | ||
"security/ir.model.access.csv", | ||
"security/ir_rule.xml", | ||
"views/stock_picking.xml", | ||
"views/stock_picking_type.xml", | ||
], | ||
"depends": [ | ||
"stock", | ||
"printing_auto_base", | ||
], | ||
"license": "AGPL-3", | ||
"version": "14.0.1.0.0", | ||
"website": "https://github.com/OCA/stock-logistics-reporting", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from . import stock_picking | ||
from . import stock_picking_type |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Copyright 2022 Jacques-Etienne Baudoux (BCIM) <[email protected]> | ||
# Copyright 2022 Michael Tietz (MT Software) <[email protected]> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import fields, models | ||
|
||
|
||
class StockPicking(models.Model): | ||
_name = "stock.picking" | ||
_inherit = ["stock.picking", "printing.auto.mixin"] | ||
|
||
auto_printing_ids = fields.Many2many( | ||
"printing.auto", related="picking_type_id.auto_printing_ids" | ||
) | ||
|
||
def _action_done(self): | ||
result = super()._action_done() | ||
self.handle_print_auto() | ||
return result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Copyright 2022 Jacques-Etienne Baudoux (BCIM) <[email protected]> | ||
# Copyright 2022 Michael Tietz (MT Software) <[email protected]> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import fields, models | ||
|
||
|
||
class StockPickingType(models.Model): | ||
_inherit = "stock.picking.type" | ||
|
||
auto_printing_ids = fields.Many2many( | ||
"printing.auto", | ||
string="Auto Printing Configuration", | ||
domain=[("model", "=", "stock.picking.type")], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Go to the Operation Type and configure which report or attachment to print. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
* Jacques-Etienne Baudoux (BCIM) <[email protected]> | ||
* Michael Tietz (MT Software) <[email protected]> | ||
* Camptocamp | ||
* Christopher Hansen <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
When a picking is done, automatically trigger the printing of some documents. | ||
This can be used to print a delivery slip (report) or labels received from the carrier (attachment). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink | ||
access_manager,stock_picking_auto_print - manager,printing_auto_base.model_printing_auto,stock.group_stock_manager,1,1,1,1 | ||
access_user,stock_picking_auto_print - user,printing_auto_base.model_printing_auto,stock.group_stock_user,1,0,0,0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<odoo> | ||
<record id="ir_rule_user" model="ir.rule"> | ||
<field name="name">stock picking auto print</field> | ||
<field name="model_id" ref="printing_auto_base.model_printing_auto" /> | ||
<field name="domain_force">[("model", "=", "stock.picking.type")]</field> | ||
<field name="groups" eval="[(4, ref('stock.group_stock_user'))]" /> | ||
<field name="perm_create" eval="0" /> | ||
<field name="perm_write" eval="0" /> | ||
<field name="perm_unlink" eval="0" /> | ||
<field name="perm_read" eval="1" /> | ||
</record> | ||
</odoo> |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mt-software-de I wonder if this is not a mistake and if we should not put the model of what is printed instead of where it is configured? And in
_get_printing_auto
filter on that model. https://github.com/OCA/report-print-send/pull/310/files#diff-1360f4baf5029947c074c2576244e65952f4043906416d240f5026996ac26f68R37There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I don't quite understand what you mean.
We need to configure the printing.auto on the picking.type.
I also think we should change the model in the domain to stock.picking. This then aligned with the model which is printing.
But a filter is not needed, because the auto_printing_ids are on the model with the mixin.