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

[FIX]stock_ux:template in operation type #645

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 2 additions & 16 deletions stock_ux/models/stock_picking.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,21 +75,7 @@ def change_location_dest(self):
self.move_ids.update(
{'location_dest_id': self.location_dest_id.id})

def action_done(self):
for picking in self:
# con esto arreglamos que odoo dejaria entregar varias veces el
# mismo picking si por alguna razon el boton esta presente
# en nuestro caso pasaba cuando la impresion da algun error
# lo que provoca que el picking se entregue pero la pantalla no
# se actualice
# antes lo haciamo en do_new_transfer, pero como algunas
# veces se llama este metodo sin pasar por do_new_transfer
if picking.state in ['done', 'cancel']:
raise UserError(_(
'No se puede validar un picking que no esté en estado '
'Parcialmente Disponible o Reservado, probablemente el '
'picking ya fue validado, pruebe refrezcar la ventana!'))
res = super().action_done()
def _action_done(self):
for rec in self.with_context(mail_notify_force_send=False).filtered('picking_type_id.mail_template_id'):
try:
rec.message_post_with_template(rec.picking_type_id.mail_template_id.id)
Expand All @@ -104,7 +90,7 @@ def action_done(self):
"<code>" + str(error) + "</code>"
]),
)
return res
return super()._action_done()

def new_force_availability(self):
self.action_assign()
Expand Down