Skip to content
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 printing_auto_base + stock_picking_auto_print #310

Closed
wants to merge 8 commits into from

Conversation

jbaudoux
Copy link

@jbaudoux jbaudoux commented Dec 12, 2022

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).

cc @sebalix @mt-software-de

@jbaudoux jbaudoux force-pushed the 14-stock_picking_auto_print branch 3 times, most recently from 0e4357b to 0202c43 Compare December 12, 2022 13:49
@jbaudoux jbaudoux force-pushed the 14-stock_picking_auto_print branch 4 times, most recently from 4f0bba8 to 58bb18d Compare December 16, 2022 13:03
@jbaudoux
Copy link
Author

@mt-software-de I finished the refactor. Looks better now.

@sebalix sebalix added this to the 14.0 milestone Dec 16, 2022
Copy link

@mt-software-de mt-software-de left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The attachment field must be changed in the view and test to attachment_domain :-)

@jbaudoux jbaudoux force-pushed the 14-stock_picking_auto_print branch 3 times, most recently from 55daad4 to 9d3afab Compare December 16, 2022 13:50
@jbaudoux
Copy link
Author

jbaudoux commented Dec 16, 2022

Merged do_automated_printing and _do_automated_printing at https://github.com/OCA/report-print-send/pull/310/files#diff-ff122f5756c8074c5db95d9f9fcd541f871d3b6e312a3033b0e2304a50356676R57
Replaced Warning in favor of UserError

@jbaudoux jbaudoux force-pushed the 14-stock_picking_auto_print branch 10 times, most recently from 629569b to fdb2477 Compare December 16, 2022 15:20
@jbaudoux
Copy link
Author

Changes:

  • split into base & stock picking modules
  • added error logging
  • added button to redo the printing

@mt-software-de
Copy link

Changes:

* split into base & stock picking modules

* added error logging

* added button to redo the printing

Could you let me know when your are done with your changes?

@jbaudoux jbaudoux force-pushed the 14-stock_picking_auto_print branch from 0938ffb to 69e710e Compare March 3, 2023 12:29
@jbaudoux jbaudoux force-pushed the 14-stock_picking_auto_print branch from 69e710e to c9f1e5e Compare June 20, 2023 15:40
@jbaudoux
Copy link
Author

rebased

@simahawk
Copy link
Contributor

@jbaudoux pls split commits by module 🙏

@jbaudoux jbaudoux force-pushed the 14-stock_picking_auto_print branch from c9f1e5e to 5265abc Compare June 21, 2023 08:04
@jbaudoux
Copy link
Author

@simahawk done

help="Give a domain that must be valid for printing this",
)
record_change = fields.Char(
"Record change", help="Select on which document the report must be executed"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This help msg must be improved, is not clear what it's used for and how it should be valued.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we need a record rule so that they can see auto-printing records only for stock models?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. I had to add a model field to bound the config to it



@mock.patch.object(PrintingPrinter, "print_document", print_document)
@mock.patch.object(logging.Logger, "exception", exception)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you mock the exception? If you expect an exception to be logged it should be tested w/ assertLogs

@jbaudoux jbaudoux force-pushed the 14-stock_picking_auto_print branch 2 times, most recently from 011c517 to 9cc9676 Compare September 14, 2023 14:35
@jbaudoux
Copy link
Author

This module should maybe depend on OCA/web#2614

@jbaudoux jbaudoux force-pushed the 14-stock_picking_auto_print branch 2 times, most recently from fd51a2a to 6b29ae7 Compare September 19, 2023 15:47
@jbaudoux jbaudoux force-pushed the 14-stock_picking_auto_print branch 3 times, most recently from 2b6d127 to cc45b96 Compare September 19, 2023 20:10
Copy link

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Jan 21, 2024
@github-actions github-actions bot closed this Feb 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale PR/Issue without recent activity, it'll be soon closed automatically. work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants