diff --git a/stock_batch_picking_ux/README.rst b/stock_batch_picking_ux/README.rst
index 93f85a0a4..58a6cdea9 100644
--- a/stock_batch_picking_ux/README.rst
+++ b/stock_batch_picking_ux/README.rst
@@ -19,14 +19,13 @@ This module add the following features:
#. While creating a batch picking:
- Add the partner in the batch transfer, and then filter the transfers able to be selected according to it.
- Add the number of packages in the batch transfer
-- For receipts, it add the supplier's shipping number.
-- When pickings are selected while creating a new batch, we allow them to check availability.
#. While proccesing the batch picking:
-- Add the possibility of processing stock.move.line from a list view.
- In the transfer lines it add information of the vouchers, from & to and source document, among others.
-- Allow to unreserve everything from the batch
- A smart button is added to go to the list view of associated transfers.
- When you click on a transfer (from the transfer tab) you see all the possible actions that would be seen by entering it directly, such as the possibility of printing the voucher.
+#. Batch Delivery Slip report:
+- A **Delivery Slip** report for batch transfers is included, analogous to the one available for individual pickings.
+- The **Print** button in the batch form view follows the same logic as native pickings: when the batch is ``in_progress`` it prints the *Batch Transfer* report; once the batch is ``done`` it prints the *Delivery Slip* instead.
Installation
============
diff --git a/stock_batch_picking_ux/__manifest__.py b/stock_batch_picking_ux/__manifest__.py
index bd5f4f500..741644dcc 100644
--- a/stock_batch_picking_ux/__manifest__.py
+++ b/stock_batch_picking_ux/__manifest__.py
@@ -18,8 +18,8 @@
#
##############################################################################
{
- "name": "Stock Usability with Batch Picking and stock vouchers",
- "version": "18.0.1.1.0",
+ "name": "Stock Usability with Batch Picking",
+ "version": "19.0.1.0.0",
"category": "Warehouse Management",
"sequence": 14,
"summary": "",
@@ -29,18 +29,17 @@
"images": [],
"depends": [
"stock_ux",
- "stock_voucher",
"stock_picking_batch",
],
"data": [
"views/stock_batch_picking_views.xml",
"views/stock_move_line_views.xml",
- "views/stock_picking_views.xml",
"reports/ir.actions.report.xml",
"reports/picking_templates.xml",
+ "reports/report_batch_deliveryslip.xml",
],
"demo": [],
- "installable": False,
+ "installable": True,
"auto_install": True,
"application": False,
}
diff --git a/stock_batch_picking_ux/models/__init__.py b/stock_batch_picking_ux/models/__init__.py
index 25800d491..3dde2d385 100644
--- a/stock_batch_picking_ux/models/__init__.py
+++ b/stock_batch_picking_ux/models/__init__.py
@@ -3,6 +3,4 @@
# directory
##############################################################################
from . import stock_batch_picking
-from . import stock_move_line
-from . import stock_picking_voucher
from . import stock_picking
diff --git a/stock_batch_picking_ux/models/stock_batch_picking.py b/stock_batch_picking_ux/models/stock_batch_picking.py
index 6ffa43939..299f19524 100644
--- a/stock_batch_picking_ux/models/stock_batch_picking.py
+++ b/stock_batch_picking_ux/models/stock_batch_picking.py
@@ -2,8 +2,7 @@
# For copyright and license notices, see __manifest__.py file in module root
# directory
##############################################################################
-from odoo import _, api, fields, models
-from odoo.exceptions import UserError
+from odoo import api, fields, models
class StockPickingBatch(models.Model):
@@ -18,34 +17,22 @@ class StockPickingBatch(models.Model):
# required=True,
help="If you choose a partner then only pickings of this partner will" "be sellectable",
)
- voucher_number = fields.Char()
- voucher_required = fields.Boolean(
- # related='picking_type_id.voucher_required',
- compute="_compute_picking_type_data",
- )
- restrict_number_package = fields.Boolean(
- compute="_compute_picking_type_data",
- )
+ # restrict_number_package = fields.Boolean(
+ # compute="_compute_picking_type_data",
+ # )
number_of_packages = fields.Integer(
copy=False,
)
-
picking_type_id = fields.Many2one(required=True)
-
picking_type_ids = fields.Many2many(
"stock.picking.type",
# related='picking_type_id.voucher_required',
compute="_compute_picking_type_data",
)
- vouchers = fields.Char(
- related="picking_ids.vouchers",
- )
-
picking_count = fields.Integer(
string="# Transferencias",
compute="_compute_picking_count",
)
-
notes = fields.Text(help="free form remarks")
def _compute_picking_count(self):
@@ -59,82 +46,43 @@ def _compute_picking_count(self):
for batch in self:
batch.picking_count = counts.get(batch.id, 0)
+ @api.depends("partner_id")
+ def _compute_allowed_picking_ids(self):
+ super()._compute_allowed_picking_ids()
+ for rec in self.filtered("partner_id"):
+ rec.allowed_picking_ids = rec.allowed_picking_ids.filtered(lambda p: p.partner_id == rec.partner_id)
+
+ def write(self, vals):
+ # Interceptamos las operaciones de picking_ids para evitar que se borren físicamente
+ # En lugar de comando 2 (delete), usamos comando 3 (unlink) que solo desvincula
+ if "picking_ids" in vals:
+ new_picking_ops = []
+ for operation in vals["picking_ids"]:
+ if operation[0] == 2: # Si es un delete (2), lo convertimos a unlink (3)
+ new_picking_ops.append((3, operation[1])) # Unlink en lugar de delete
+ else:
+ new_picking_ops.append(operation)
+ vals["picking_ids"] = new_picking_ops
+ return super().write(vals)
+
@api.depends("picking_ids")
def _compute_picking_type_data(self):
for rec in self:
types = rec.picking_ids.mapped("picking_type_id")
rec.picking_type_ids = types
- rec.voucher_required = any(x.voucher_required for x in types)
- rec.restrict_number_package = False
+ # rec.voucher_required = any(x.voucher_required for x in types)
+ # rec.restrict_number_package = False
# este viene exigido desde la cia pero seguramente lo movamos a
# exigir desde picking type
# solo es requerido para outgoings
- if rec.picking_type_code == "outgoing":
- rec.restrict_number_package = any(x.picking_type_id.restrict_number_package for x in rec.picking_ids)
+ # if rec.picking_type_code == "outgoing":
+ # rec.restrict_number_package = any(x.picking_type_id.restrict_number_package for x in rec.picking_ids)
@api.onchange("picking_type_code", "partner_id")
def changes_set_pickings(self):
# if we change type or partner reset pickings
self.picking_ids = False
- @api.onchange("voucher_number", "picking_ids")
- def format_voucher_number(self):
- for rec in self:
- if not rec.voucher_number:
- continue
- voucher_number = self.env["stock.picking.voucher"]._format_document_number(rec.voucher_number)
- if voucher_number and voucher_number != rec.voucher_number:
- rec.voucher_number = voucher_number
-
- def write(self, vals):
- if "voucher_number" in vals and vals.get("voucher_number"):
- voucher_number = self.env["stock.picking.voucher"]._format_document_number(vals.get("voucher_number"))
- if voucher_number and voucher_number != vals.get("voucher_number"):
- vals["voucher_number"] = voucher_number
- return super().write(vals)
-
- def add_picking_operation(self):
- self.ensure_one()
- view_id = self.env.ref("stock_ux.view_move_line_tree").id
- search_view_id = self.env.ref("stock_ux.stock_move_line_view_search").id
- return {
- "type": "ir.actions.act_window",
- "res_model": "stock.move.line",
- "search_view_id": search_view_id,
- "views": [[view_id, "list"], [False, "form"]],
- "domain": [["id", "in", self.move_line_ids.ids]],
- "context": {"create": False, "from_batch": True},
- }
-
- def action_done(self):
- # agregamos los numeros de remito
- for rec in self:
- # al agregar la restriccion de que al menos una tenga que tener
- # cantidad entonces nunca se manda el force_qty al picking
- if all(operation.quantity == 0 for operation in rec.move_line_ids):
- raise UserError(_("Debe definir Cantidad Realizada en al menos una " "operación."))
-
- if rec.restrict_number_package and not rec.number_of_packages > 0:
- raise UserError(_("The number of packages can not be 0"))
- if rec.number_of_packages:
- rec.picking_ids.write({"number_of_packages": rec.number_of_packages})
-
- if rec.picking_type_code == "incoming" and rec.voucher_number:
- for picking in rec.picking_ids:
- # agregamos esto para que no se asigne a los pickings
- # que no se van a recibir ya que todavia no se limpiaron
- # y ademas, por lo de arriba, no se fuerza la cantidad
- # si son todos cero, se terminan sacando
- if all(operation.quantity == 0 for operation in picking.move_line_ids):
- continue
- rec.env["stock.picking.voucher"].create(
- {
- "picking_id": picking.id,
- "name": rec.voucher_number,
- }
- )
- return super(StockPickingBatch, self.with_context(do_not_assign_numbers=True)).action_done()
-
def action_view_stock_picking(self):
"""This function returns an action that display existing pickings of
given batch picking.
diff --git a/stock_batch_picking_ux/models/stock_move_line.py b/stock_batch_picking_ux/models/stock_move_line.py
deleted file mode 100644
index ca978061e..000000000
--- a/stock_batch_picking_ux/models/stock_move_line.py
+++ /dev/null
@@ -1,15 +0,0 @@
-##############################################################################
-# For copyright and license notices, see __manifest__.py file in module root
-# directory
-##############################################################################
-from odoo import fields, models
-
-
-class StockMoveLine(models.Model):
- _inherit = "stock.move.line"
-
- origin = fields.Char(
- related="move_id.picking_id.origin",
- # we store so we can group
- store=True,
- )
diff --git a/stock_batch_picking_ux/models/stock_picking.py b/stock_batch_picking_ux/models/stock_picking.py
index 762dccb7a..9aa796d63 100644
--- a/stock_batch_picking_ux/models/stock_picking.py
+++ b/stock_batch_picking_ux/models/stock_picking.py
@@ -1,58 +1,14 @@
-# @2016 Cyril Gaudin, Camptocamp SA
-# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-
-from odoo import models
-from odoo.tools import float_is_zero
+from odoo import _, api, models
+from odoo.exceptions import ValidationError
class StockPicking(models.Model):
_inherit = "stock.picking"
- # sobreescribimos esta funcion por el FIX, deberia ir a la oca una vez
- # depurado
- def force_transfer(self, force_qty=True):
- """Do the picking transfer (by calling do_transfer)
-
- If *force_qty* is True, force the transfer for all product_qty
- when quantity is 0.
-
- Otherwise, process only pack operation with quantity.
- If a picking has no quantity filled, we released it from his batch
- """
- for pick in self:
- if pick.state != "assigned":
- pick.action_assign()
- # FIX
- # fix porque si el picking esta parcialmente disponible
- # no lo termina procesando
- # if pick.state != 'assigned':
- if pick.state not in ["assigned", "partially_available"]:
- continue
- # END FIX
-
- if force_qty:
- for pack in pick.move_line_ids:
- pack.quantity = pack.quantity
- else:
- if all(
- float_is_zero(pack.quantity, precision_rounding=pack.product_uom_id.rounding)
- for pack in pick.move_line_ids
- ):
- # No qties to process, release out of the batch
- pick.batch_id = False
- continue
- else:
- for pack in pick.move_line_ids:
- if not pack.quantity:
- pack.unlink()
-
- pick._action_done()
-
- def _action_generate_backorder_wizard(self, show_transfers=False):
- if self._context.get("picking_batches", False):
- wiz = self.env["stock.backorder.confirmation"].create({"pick_ids": [(4, p.id) for p in self]})
- wiz.process()
- self._context.get("picking_batches").write({"state": "done"})
- return True
- else:
- return super(StockPicking, self)._action_generate_backorder_wizard(show_transfers=show_transfers)
+ @api.constrains("picking_type_id", "batch_id")
+ def _check_picking_type_batch(self):
+ for rec in self.filtered("batch_id"):
+ if rec.batch_id.picking_type_id and rec.picking_type_id != rec.batch_id.picking_type_id:
+ raise ValidationError(
+ _("You cannot change the operation type of a picking if it is already assigned to a batch.")
+ )
diff --git a/stock_batch_picking_ux/models/stock_picking_voucher.py b/stock_batch_picking_ux/models/stock_picking_voucher.py
deleted file mode 100644
index 995f94446..000000000
--- a/stock_batch_picking_ux/models/stock_picking_voucher.py
+++ /dev/null
@@ -1,31 +0,0 @@
-##############################################################################
-# For copyright and license notices, see __manifest__.py file in module root
-# directory
-##############################################################################
-from odoo import _, models
-from odoo.exceptions import ValidationError
-
-
-class StockPickingVoucher(models.Model):
- _inherit = "stock.picking.voucher"
-
- def _check_voucher_number_unique(self):
- """
- We modify it to make it unique per batch (if available) or per
- pikcing
- """
- self.ensure_one()
- if self.picking_id.batch_id:
- same_number_recs = self.search(
- [
- ("picking_id.partner_id", "=", self.picking_id.partner_id.id),
- ("name", "=", self.name),
- ("picking_id.batch_id", "!=", self.picking_id.batch_id.id),
- ("id", "!=", self.id),
- ]
- )
- if same_number_recs:
- raise ValidationError(_("Picking voucher number must be unique per " "partner"))
-
- else:
- return super()._check_voucher_number_unique()
diff --git a/stock_batch_picking_ux/reports/ir.actions.report.xml b/stock_batch_picking_ux/reports/ir.actions.report.xml
index 58013f382..babd02132 100644
--- a/stock_batch_picking_ux/reports/ir.actions.report.xml
+++ b/stock_batch_picking_ux/reports/ir.actions.report.xml
@@ -37,4 +37,14 @@
report
+
+
+ Delivery Slip
+ stock.picking.batch
+
+ qweb-pdf
+ stock_batch_picking_ux.report_batch_deliveryslip
+ stock_batch_picking_ux.report_batch_deliveryslip
+ report
+
diff --git a/stock_batch_picking_ux/reports/picking_templates.xml b/stock_batch_picking_ux/reports/picking_templates.xml
index 5b40463a8..d165805d4 100644
--- a/stock_batch_picking_ux/reports/picking_templates.xml
+++ b/stock_batch_picking_ux/reports/picking_templates.xml
@@ -12,37 +12,22 @@
^XA
-
-
+
+
^CF0,60^CI28^FO50,50^FD
-
+
^FS ^CF0,30 ^FO50,115^FD
-
+
^FS ^FO50,155^FD
(
-)
+)
^FS ^FO50,195^FD
-
+
,
-
+
^FS ^FO50,250^GB700,3,3^FS
-^CF0,60^CI28^FO50,50^FD
-
-^FS ^CF0,30 ^FO50,115^FD
-
-^FS ^FO50,155^FD
-(
-)
-^FS ^FO50,195^FD
-
-,
-
-^FS ^FO50,250^GB700,3,3^FS
-
-
-
^CF0,60 ^FO50,50^FD
^FS ^CF0,30 ^CI28 ^FO50,115^FD
@@ -113,7 +98,7 @@
^FX Referencias Odoo ^CFJ,25 ^FO50,680^FDOrden:^FS ^FO50,720^FDRemito:^FS ^CF0,28 ^FO160,680^FD
^FS ^FO160,720^FD
-
+
^FS ^BY3,2,160 ^FO100,765^BC^FD
@@ -147,37 +132,22 @@ Fecha
-
-
-
-
-
+
-
-
-
-
-
-
-
- {'show_print_button': 1}
- [('company_id', '=', company_id), ('state', 'in', ('confirmed', 'partially_available', 'assigned')), ('picking_type_id', '=', picking_type_id)] if not partner_id else [('company_id', '=', company_id), ('state', 'in', ('confirmed', 'partially_available', 'assigned')), ('picking_type_id', '=', picking_type_id), ('partner_id', '=', partner_id)]
-
-
- {'from_batch': True}
-
-
-
-
- {'show_picking': True, 'list_view_ref': 'stock.view_move_picking_tree'}
-
-
+
-
+
+
+
+
+
+
+
+
+
+
-
diff --git a/stock_batch_picking_ux/views/stock_move_line_views.xml b/stock_batch_picking_ux/views/stock_move_line_views.xml
index 6d7b57b5f..76cbe119e 100644
--- a/stock_batch_picking_ux/views/stock_move_line_views.xml
+++ b/stock_batch_picking_ux/views/stock_move_line_views.xml
@@ -1,44 +1,25 @@
-
- stock.move.line.filter
- stock.move.line
-
+
+ stock.move.list
+ stock.move
+
-
+
-
-
- stock.move.line.liststock.move.line
-
+
-
-
-
- context.get('from_batch')
-
-
-
-
-
- stock.move.line.list
- stock.move.line
- primary
- 50
-
-
-
- 1
+
diff --git a/stock_batch_picking_ux/views/stock_picking_views.xml b/stock_batch_picking_ux/views/stock_picking_views.xml
index fea5c5a62..4b0e6417c 100644
--- a/stock_batch_picking_ux/views/stock_picking_views.xml
+++ b/stock_batch_picking_ux/views/stock_picking_views.xml
@@ -1,14 +1,14 @@
-
- stock.picking.list
+
+ stock.picking.form.exceptionstock.picking
-
+ 99
+
-
-
-
-
-
+
+
+ batch_id
+
diff --git a/stock_batch_picking_voucher/README.rst b/stock_batch_picking_voucher/README.rst
deleted file mode 100644
index 44be64e94..000000000
--- a/stock_batch_picking_voucher/README.rst
+++ /dev/null
@@ -1,65 +0,0 @@
-.. |company| replace:: ADHOC SA
-
-.. |company_logo| image:: https://raw.githubusercontent.com/ingadhoc/maintainer-tools/master/resources/adhoc-logo.png
- :alt: ADHOC SA
- :target: https://www.adhoc.com.ar
-
-.. |icon| image:: https://raw.githubusercontent.com/ingadhoc/maintainer-tools/master/resources/adhoc-icon.png
-
-.. image:: https://img.shields.io/badge/license-AGPL--3-blue.png
- :target: https://www.gnu.org/licenses/agpl
- :alt: License: AGPL-3
-
-====================================
-Pre-printed report in batch pickings
-====================================
-
-This module add the following features:
-#. Add aeroo report to print Pre-printed from batch pickings
-
-Installation
-============
-
-To install this module, you need to:
-
-#. Only need to install the module
-
-Configuration
-=============
-
-To configure this module, you need to:
-
-#. Nothing to configure
-
-
-.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
- :alt: Try me on Runbot
- :target: http://runbot.adhoc.com.ar/
-
-Bug Tracker
-===========
-
-Bugs are tracked on `GitHub Issues
-`_. In case of trouble, please
-check there if your issue has already been reported. If you spotted it first,
-help us smashing it by providing a detailed and welcomed feedback.
-
-Credits
-=======
-
-Images
-------
-
-* |company| |icon|
-
-Contributors
-------------
-
-Maintainer
-----------
-
-|company_logo|
-
-This module is maintained by the |company|.
-
-To contribute to this module, please visit https://www.adhoc.com.ar.
diff --git a/stock_batch_picking_voucher/__init__.py b/stock_batch_picking_voucher/__init__.py
deleted file mode 100644
index bc704a047..000000000
--- a/stock_batch_picking_voucher/__init__.py
+++ /dev/null
@@ -1,6 +0,0 @@
-##############################################################################
-# For copyright and license notices, see __manifest__.py file in module root
-# directory
-##############################################################################
-from . import models
-from . import controllers
diff --git a/stock_batch_picking_voucher/__manifest__.py b/stock_batch_picking_voucher/__manifest__.py
deleted file mode 100644
index bacc7b05d..000000000
--- a/stock_batch_picking_voucher/__manifest__.py
+++ /dev/null
@@ -1,46 +0,0 @@
-##############################################################################
-#
-# Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar)
-# All Rights Reserved.
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-{
- "name": "Preprinted report in batch pickings",
- "version": "18.0.1.2.0",
- "category": "Warehouse Management",
- "sequence": 14,
- "summary": "",
- "author": "ADHOC SA",
- "website": "www.adhoc.com.ar",
- "license": "AGPL-3",
- "images": [],
- "depends": [
- "stock_batch_picking_ux",
- "report_aeroo",
- "l10n_latam_base",
- "delivery_ux",
- "stock_voucher_ux",
- ],
- "data": [
- "report/batch_picking_preprinted_data.xml",
- "views/stock_batch_picking_views.xml",
- "views/stock_picking_views.xml",
- ],
- "demo": [],
- "installable": False,
- "auto_install": False,
- "application": False,
-}
diff --git a/stock_batch_picking_voucher/controllers/__init__.py b/stock_batch_picking_voucher/controllers/__init__.py
deleted file mode 100644
index 12a7e529b..000000000
--- a/stock_batch_picking_voucher/controllers/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from . import main
diff --git a/stock_batch_picking_voucher/controllers/main.py b/stock_batch_picking_voucher/controllers/main.py
deleted file mode 100644
index 516e34ede..000000000
--- a/stock_batch_picking_voucher/controllers/main.py
+++ /dev/null
@@ -1,39 +0,0 @@
-import io
-import json
-import urllib.parse
-
-from odoo.addons.web.controllers import report
-from odoo.http import request, route
-from PyPDF2 import PdfFileReader
-
-
-class ReportController(report.ReportController):
- @route()
- def report_download(self, data, context=None, token=None, **kwargs):
- """This function is used by 'qwebactionmanager.js' in order to trigger
- the download of a py3o/controller report.
- :param data: a javascript array JSON.stringified containg report
- internal url ([0]) and type [1]
- :returns: Response with a filetoken cookie and an attachment header
- """
- response = super().report_download(data, context=context, token=token, **kwargs)
- # NTH detect if the binary is a PDF, no matter ifn it was generated by a QWeb or Aeroo
- requestcontent = json.loads(data)
- type = requestcontent[1]
- if type != "aeroo":
- return response
- json_string = json.loads(data)[0]
- context_part = json_string.split("context=")[1]
- decoded_context = urllib.parse.unquote(context_part)
- context_dict = json.loads(decoded_context)
- batch_id = context_dict.get("active_id")
- batch = context_dict.get("batch")
- if batch and batch_id and "batch_picking_preprinted" in data:
- book_id = request.env["stock.picking.batch"].browse(batch_id).book_id
- pdf_response = response.response[0]
- reader = PdfFileReader(io.BytesIO(pdf_response))
- number_pages = reader.getNumPages()
- if not request.env["stock.picking.batch"].browse(batch_id).voucher_ids:
- request.env["stock.picking.batch"].browse(batch_id).assign_numbers(number_pages, book_id)
-
- return response
diff --git a/stock_batch_picking_voucher/i18n/es.po b/stock_batch_picking_voucher/i18n/es.po
deleted file mode 100644
index b3cc53011..000000000
--- a/stock_batch_picking_voucher/i18n/es.po
+++ /dev/null
@@ -1,145 +0,0 @@
-# Translation of Odoo Server.
-# This file contains the translation of the following modules:
-# * stock_batch_picking_voucher
-#
-# Translators:
-# Juan José Scarafía , 2025
-# Matias Velazquez, 2025
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: Odoo Server 18.0+e\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2025-07-22 11:58+0000\n"
-"PO-Revision-Date: 2025-01-03 14:01+0000\n"
-"Last-Translator: Matias Velazquez, 2025\n"
-"Language-Team: Spanish (https://app.transifex.com/adhoc/teams/46451/es/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: \n"
-"Language: es\n"
-"Plural-Forms: nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n"
-
-#. module: stock_batch_picking_voucher
-#: model_terms:ir.ui.view,arch_db:stock_batch_picking_voucher.stock_picking_form_exception
-msgid ""
-"Advertencia: La asignación de remitos se hace desde el lote"
-" de traslados, si quiere hacerlos desde este traslado cancele el lote o "
-"separe el traslado del mismo"
-msgstr ""
-
-#. module: stock_batch_picking_voucher
-#: model:ir.model.fields,field_description:stock_batch_picking_voucher.field_stock_picking_batch__next_number
-msgid "Actual Next Number"
-msgstr "Número siguiente real"
-
-#. module: stock_batch_picking_voucher
-#: model:ir.model.fields,field_description:stock_batch_picking_voucher.field_stock_picking_voucher__batch_id
-msgid "Batch"
-msgstr "Lote"
-
-#. module: stock_batch_picking_voucher
-#: model:ir.model,name:stock_batch_picking_voucher.model_stock_picking_batch
-msgid "Batch Transfer"
-msgstr "Traslado por lote"
-
-#. module: stock_batch_picking_voucher
-#: model:ir.model.fields,field_description:stock_batch_picking_voucher.field_stock_picking_batch__book_id
-msgid "Book"
-msgstr "Talonario"
-
-#. module: stock_batch_picking_voucher
-#: model_terms:ir.ui.view,arch_db:stock_batch_picking_voucher.stock_batch_picking_form
-msgid "Imprimir"
-msgstr ""
-
-#. module: stock_batch_picking_voucher
-#: model_terms:ir.ui.view,arch_db:stock_batch_picking_voucher.stock_batch_picking_form
-msgid "Imprimir Remitos"
-msgstr ""
-
-#. module: stock_batch_picking_voucher
-#: model_terms:ir.ui.view,arch_db:stock_batch_picking_voucher.stock_batch_picking_form
-msgid "Limpiar remitos"
-msgstr ""
-
-#. module: stock_batch_picking_voucher
-#: model:ir.model.fields,field_description:stock_batch_picking_voucher.field_stock_picking_batch__next_voucher_number
-msgid "Next Voucher Number"
-msgstr "Número del siguiente remito"
-
-#. module: stock_batch_picking_voucher
-#: model:ir.model.fields,help:stock_batch_picking_voucher.field_stock_picking_batch__next_number
-#: model:ir.model.fields,help:stock_batch_picking_voucher.field_stock_picking_batch__next_voucher_number
-msgid ""
-"Next number that will be used. This number can be incremented frequently so "
-"the displayed value might already be obsolete"
-msgstr ""
-"Próximo número que será utilizado. Este número puede incrementarse "
-"frecuentemente, por lo que el valor mostrado podría ya ser obsoleto."
-
-#. module: stock_batch_picking_voucher
-#: model:ir.model.fields,field_description:stock_batch_picking_voucher.field_stock_picking_batch__estimated_number_of_pages
-msgid "Number of Pages"
-msgstr "Número de páginas"
-
-#. module: stock_batch_picking_voucher
-#. odoo-python
-#: code:addons/stock_batch_picking_voucher/models/stock_picking_batch.py:0
-msgid "Números de remitos asignados: %s"
-msgstr ""
-
-#. module: stock_batch_picking_voucher
-#: model:ir.model.fields,field_description:stock_batch_picking_voucher.field_stock_picking_voucher__picking_id
-msgid "Picking"
-msgstr "Recolección"
-
-#. module: stock_batch_picking_voucher
-#: model:ir.actions.report,name:stock_batch_picking_voucher.batch_picking_preprinted
-msgid "Preprinted Voucher"
-msgstr "Remito Preimpreso"
-
-#. module: stock_batch_picking_voucher
-#: model_terms:ir.ui.view,arch_db:stock_batch_picking_voucher.stock_batch_picking_form
-msgid "Print pre-printed report"
-msgstr "Imprimir reporte preimpreso"
-
-#. module: stock_batch_picking_voucher
-#: model:ir.model.fields,field_description:stock_batch_picking_voucher.field_stock_picking_batch__printed
-msgid "Printed"
-msgstr "Impreso"
-
-#. module: stock_batch_picking_voucher
-#: model_terms:ir.ui.view,arch_db:stock_batch_picking_voucher.stock_batch_picking_form
-msgid ""
-"Prints pre-printed report and assigns vouchers depending on the number of "
-"sheets to be printed (automatic calculation)"
-msgstr ""
-"Imprime el reporte preimpreso y asigna los remitos dependiendo el número de "
-"páginas a imprimir (cáculo automático)."
-
-#. module: stock_batch_picking_voucher
-#: model:ir.model.fields,field_description:stock_batch_picking_voucher.field_stock_picking_batch__voucher_ids
-msgid "Remitos"
-msgstr ""
-
-#. module: stock_batch_picking_voucher
-#: model:ir.model,name:stock_batch_picking_voucher.model_stock_picking_voucher
-msgid "Stock Voucher Book"
-msgstr "Talonario de Remitos"
-
-#. module: stock_batch_picking_voucher
-#: model_terms:ir.ui.view,arch_db:stock_batch_picking_voucher.stock_batch_picking_form
-msgid "Talonario"
-msgstr ""
-
-#. module: stock_batch_picking_voucher
-#. odoo-python
-#: code:addons/stock_batch_picking_voucher/models/stock_picking_batch.py:0
-msgid "The assigned voucher were deleted"
-msgstr "Los remitos asignados fueron eliminados"
-
-#. module: stock_batch_picking_voucher
-#: model:ir.model.fields,field_description:stock_batch_picking_voucher.field_stock_picking_batch__with_vouchers
-msgid "With Vouchers"
-msgstr "Con Remitos"
diff --git a/stock_batch_picking_voucher/models/__init__.py b/stock_batch_picking_voucher/models/__init__.py
deleted file mode 100644
index f9dc4d14c..000000000
--- a/stock_batch_picking_voucher/models/__init__.py
+++ /dev/null
@@ -1,2 +0,0 @@
-from . import stock_picking_voucher
-from . import stock_picking_batch
diff --git a/stock_batch_picking_voucher/models/stock_picking_batch.py b/stock_batch_picking_voucher/models/stock_picking_batch.py
deleted file mode 100644
index 181e6445f..000000000
--- a/stock_batch_picking_voucher/models/stock_picking_batch.py
+++ /dev/null
@@ -1,91 +0,0 @@
-##############################################################################
-# For copyright and license notices, see __manifest__.py file in module root
-# directory
-##############################################################################
-from odoo import _, api, fields, models
-from odoo.exceptions import UserError
-
-
-class StockPickingBatch(models.Model):
- _inherit = "stock.picking.batch"
-
- voucher_ids = fields.One2many(
- "stock.picking.voucher",
- "batch_id",
- "Remitos",
- copy=False,
- )
-
- book_id = fields.Many2one("stock.book", "Talonario", copy=False, ondelete="restrict", check_company=True)
-
- next_number = fields.Integer(
- related="book_id.next_number",
- )
-
- def assign_numbers(self, estimated_number_of_pages, book):
- self.ensure_one()
- list_of_vouchers = []
- for page in range(estimated_number_of_pages):
- list_of_vouchers.append(
- {
- "name": book.sequence_id.next_by_id(),
- "book_id": book.id,
- "batch_id": self.id,
- }
- )
- self.env["stock.picking.voucher"].sudo().create(list_of_vouchers)
- self.message_post(body=_("Números de remitos asignados: %s") % (self.voucher_ids.mapped("display_name")))
- self.write({"book_id": book.id})
-
- ############# Cambios post wizard, posible abstract #############
-
- printed = fields.Boolean()
-
- with_vouchers = fields.Boolean(
- compute="_compute_with_vouchers",
- )
-
- book_id = fields.Many2one(
- "stock.book",
- "Book",
- default=lambda self: self._get_book(),
- )
-
- next_voucher_number = fields.Integer(
- "Next Voucher Number",
- related="book_id.sequence_id.number_next_actual",
- )
-
- estimated_number_of_pages = fields.Integer(
- "Number of Pages",
- )
-
- @api.model
- def _get_book(self):
- return self.book_id or self.env["stock.book"].search(
- [("company_id", "=", self.picking_ids[:1].company_id.id)], limit=1
- )
-
- @api.depends("picking_ids", "picking_ids.voucher_ids")
- def _compute_with_vouchers(self):
- for rec in self:
- rec.with_vouchers = bool(self.voucher_ids)
-
- def do_print_and_assign(self):
- # We override the method to avoid assignation
- if not self.book_id:
- raise UserError("Primero debe setear un talonario")
- if not self.book_id.autoprinted:
- self.printed = True
- return self.with_context(batch=True).do_print_batch_vouchers()
- self.assign_numbers(1, self.book_id)
- return self.do_print_batch_vouchers()
-
- def do_print_batch_vouchers(self):
- """This function prints the voucher"""
- return self.env.ref("stock_batch_picking_voucher.batch_picking_preprinted").report_action(self)
-
- def do_clean(self):
- self.voucher_ids.unlink()
- # self.book_id = False
- self.message_post(body=_("The assigned voucher were deleted"))
diff --git a/stock_batch_picking_voucher/models/stock_picking_voucher.py b/stock_batch_picking_voucher/models/stock_picking_voucher.py
deleted file mode 100644
index 569832c91..000000000
--- a/stock_batch_picking_voucher/models/stock_picking_voucher.py
+++ /dev/null
@@ -1,33 +0,0 @@
-##############################################################################
-# For copyright and license notices, see __manifest__.py file in module root
-# directory
-##############################################################################
-from odoo import api, fields, models
-from odoo.exceptions import ValidationError
-
-
-class StockPickingVoucher(models.Model):
- _inherit = "stock.picking.voucher"
-
- batch_id = fields.Many2one(
- "stock.picking.batch",
- "Batch",
- ondelete="cascade",
- index=True,
- )
-
- picking_id = fields.Many2one(
- "stock.picking",
- "Picking",
- ondelete="cascade",
- required=False,
- index=True,
- )
-
- @api.constrains("picking_id", "batch_id")
- def _check_picking_id_required(self):
- for record in self:
- if not record.batch_id and not record.picking_id:
- raise ValidationError(
- "Al crear un voucher debe estar ligado a una trasnferencia o lote de transferencias"
- )
diff --git a/stock_batch_picking_voucher/report/batch_picking_preprinted.odt b/stock_batch_picking_voucher/report/batch_picking_preprinted.odt
deleted file mode 100644
index e1cb79576..000000000
Binary files a/stock_batch_picking_voucher/report/batch_picking_preprinted.odt and /dev/null differ
diff --git a/stock_batch_picking_voucher/report/batch_picking_preprinted_data.xml b/stock_batch_picking_voucher/report/batch_picking_preprinted_data.xml
deleted file mode 100644
index 94fd2a0d5..000000000
--- a/stock_batch_picking_voucher/report/batch_picking_preprinted_data.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
- Preprinted Voucher
- stock.picking.batch
- batch_picking_preprinted
- aeroo
- oo-odt
- stock_batch_picking_voucher/report/batch_picking_preprinted.odt
-
- file
-
- report
-
-
-
diff --git a/stock_batch_picking_voucher/views/stock_batch_picking_views.xml b/stock_batch_picking_voucher/views/stock_batch_picking_views.xml
deleted file mode 100644
index 48dca71ec..000000000
--- a/stock_batch_picking_voucher/views/stock_batch_picking_views.xml
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
- stock.picking.batch.form
- stock.picking.batch
-
- 99
-
-
-
-
-
-
-
- True
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- stock.picking.batch.form
- stock.picking.batch
-
-
-
-
-
-
-
-
-
- stock.picking.list.inherited
- stock.picking
-
- 99
-
-
-
-
-
-
-
-
- stock.picking.list.inherited2
- stock.picking
-
- 99
-
-
-
-
-
-
-
-
-
-
diff --git a/stock_batch_picking_voucher/views/stock_picking_views.xml b/stock_batch_picking_voucher/views/stock_picking_views.xml
deleted file mode 100644
index 0e8eabca8..000000000
--- a/stock_batch_picking_voucher/views/stock_picking_views.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
- stock.picking.form.exception
- stock.picking
- 99
-
-
-
-
-
- Advertencia: La asignación de remitos se hace desde el lote de traslados, si quiere hacerlos desde este traslado cancele el lote o separe el traslado del mismo
-
-
-
-
-
-
-
-
-
-
-
-
-
- stock.picking.list.inherit
- stock.picking
-
-
-
-
-
-
-
-
-
diff --git a/stock_declared_value/models/stock_picking.py b/stock_declared_value/models/stock_picking.py
index 889d8a8eb..40353805e 100644
--- a/stock_declared_value/models/stock_picking.py
+++ b/stock_declared_value/models/stock_picking.py
@@ -14,16 +14,15 @@ class StockPicking(models.Model):
store=True,
readonly=False,
)
- automatic_declare_value = fields.Boolean(
- related="picking_type_id.automatic_declare_value",
- )
@api.depends(
"move_ids.state",
"move_ids.quantity",
)
def _compute_declared_value(self):
- for rec in self.filtered(lambda p: p.automatic_declare_value and p.state not in ["done", "cancel"]):
+ for rec in self.filtered(
+ lambda p: p.picking_type_id.automatic_declare_value and p.state not in ["done", "cancel"]
+ ):
done_value = 0.0
picking_value = 0.0
inmediate_transfer = True
diff --git a/stock_ux/models/stock_picking.py b/stock_ux/models/stock_picking.py
index d5b3edd39..900c2cc10 100644
--- a/stock_ux/models/stock_picking.py
+++ b/stock_ux/models/stock_picking.py
@@ -43,7 +43,8 @@ def button_validate(self):
return super().button_validate()
- def unlink(self):
+ @api.ondelete(at_uninstall=False)
+ def _check_block_picking_deletion(self):
"""
To avoid errors we block deletion of pickings in other state than
draft or cancel
@@ -64,7 +65,6 @@ def unlink(self):
not_del_pickings.ids,
)
)
- return super().unlink()
def copy(self, default=None):
for picking in self:
diff --git a/stock_ux/views/stock_move_line_views.xml b/stock_ux/views/stock_move_line_views.xml
index 73c55648c..15b95e9f4 100644
--- a/stock_ux/views/stock_move_line_views.xml
+++ b/stock_ux/views/stock_move_line_views.xml
@@ -19,6 +19,9 @@
stock.move.line
+
+
+
@@ -28,17 +31,8 @@
-
-
-
-
-
-
-
-
-
-
-
+
+
diff --git a/stock_ux/views/stock_move_views.xml b/stock_ux/views/stock_move_views.xml
index 0279bb2b0..27142c774 100644
--- a/stock_ux/views/stock_move_views.xml
+++ b/stock_ux/views/stock_move_views.xml
@@ -42,7 +42,7 @@
-
+
diff --git a/stock_ux/views/stock_picking_views.xml b/stock_ux/views/stock_picking_views.xml
index f1beb7f24..2309b0202 100644
--- a/stock_ux/views/stock_picking_views.xml
+++ b/stock_ux/views/stock_picking_views.xml
@@ -19,6 +19,7 @@
+