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

odoo freezes after send document to print #358

Open
NadozirnySvyatoslav opened this issue May 25, 2024 · 1 comment
Open

odoo freezes after send document to print #358

NadozirnySvyatoslav opened this issue May 25, 2024 · 1 comment
Labels
bug stale PR/Issue without recent activity, it'll be soon closed automatically.

Comments

@NadozirnySvyatoslav
Copy link

NadozirnySvyatoslav commented May 25, 2024

Module

base_report_to_printer

Describe the bug

Stock picking function write overrided with:

from odoo import models

class Picking(models.Model):
    _inherit = "stock.picking"

    def write(self, vals):
        res = super(Picking, self).write(vals)
        if self.sale_id and (vals.get('state', False) == 'done' or vals.get('date_done', False)):
            if len(self) == 1:
                receipt = self.env.ref('my_module.action_saleorder_invoice_print')
                if receipt:
                    receipt.print_document( [self.sale_id.id] )
        return res

Mostly it works fine when cups response, but sometimes it freezes odoo at all and I have to kill and restart server

To Reproduce

17.0e

Steps to reproduce the behavior:

  1. Add model stock.picking with overrided function write
  2. Done picking
  3. Odoo freezes

Expected behavior
Maybe some exception or writing to the log error. Maybe should be started in separated thread

Additional context
odoo 17.0e
python 3.10.12
ubuntu 22.04 LTS
cups 2.4.1op1-1ubuntu4.8

Copy link

There hasn't been any activity on this issue in the past 6 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 issue 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 Nov 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug stale PR/Issue without recent activity, it'll be soon closed automatically.
Projects
None yet
Development

No branches or pull requests

1 participant