Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion l10n_ve_stock/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"author": "binaural-dev",
"website": "https://www.binauraldev.com",
"category": "Stock",
"version": "1.0",
"version": "1.4",
"depends": [
"stock",
"product",
Expand Down
133 changes: 128 additions & 5 deletions l10n_ve_stock/i18n/es_VE.po
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,24 @@
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 17.0+e-20250311\n"
"Project-Id-Version: Odoo Server 17.0+e-20250522\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-05-21 22:53+0000\n"
"PO-Revision-Date: 2025-05-21 22:53+0000\n"
"POT-Creation-Date: 2025-11-08 16:19+0000\n"
"PO-Revision-Date: 2025-11-08 16:19+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: l10n_ve_stock
#. odoo-python
#: code:addons/l10n_ve_stock/models/stock_picking.py:0
#, python-format
msgid "%s%s"
msgstr ""

#. module: l10n_ve_stock
#: model:ir.actions.report,print_report_name:l10n_ve_stock.action_packaging_picking
msgid "'Packaging tags - %s' % (object.name)"
Expand All @@ -34,6 +41,29 @@ msgstr "- Còdigo de barras \"%s\" ya ha sido asignado al producto(s): %s"
msgid "<span class=\"o_stat_text\">Available Quantity To Sale</span>"
msgstr "<span class=\"o_stat_text\">Cantidad Disponible para Vender</span>"

#. module: l10n_ve_stock
#: model_terms:ir.ui.view,arch_db:l10n_ve_stock.res_config_settings_view_form_l10n_ve_stock
msgid "<span>Do not allow negative stock in internal movements</span>"
msgstr "<span>No permite stock negativo en movimientos internos</span>"

#. module: l10n_ve_stock
#: model_terms:ir.ui.view,arch_db:l10n_ve_stock.res_config_settings_view_form_l10n_ve_stock
msgid ""
"<strong>When marked:</strong> Negative inventory adjustments (from both the product and inventory/operations views) will not be allowed.<br/>\n"
" <strong>When unchecked:</strong> Negative inventory adjustments will be allowed (both from the product view and from inventory/operations)."
msgstr ""
"<strong>Al estar marcado:</strong> No se permitirán ajustes de inventario negativos (tanto desde la vista del producto como desde la del inventario/operaciones).<br/>\n"
" <strong>Al estar desmarcado:</strong> Se permitirán ajustes de inventario negativos (tanto desde la vista del producto como desde el inventario/operaciones)."

#. module: l10n_ve_stock
#: model_terms:ir.ui.view,arch_db:l10n_ve_stock.res_config_settings_view_form_l10n_ve_stock
msgid ""
"<strong>When marked:</strong> No more than what is manufactured in an order may be scrapped.<br/>\n"
" <strong>When unchecked:</strong> More than what is manufactured in an order may be scrapped."
msgstr ""
"<strong>Al estar marcado:</strong> No se podrá desechar más de lo que se fabrique en un pedido.<br/>\n"
" <strong>Al estar desmarcado:</strong> Se podrá desechar más de lo que se fabrica en un pedido."

#. module: l10n_ve_stock
#: model_terms:ir.ui.view,arch_db:l10n_ve_stock.res_config_settings_view_form_l10n_ve_stock
msgid ""
Expand Down Expand Up @@ -87,6 +117,12 @@ msgstr "Todos"
msgid "All Warehouse"
msgstr "Todos los Almacenes"

#. module: l10n_ve_stock
#: model:ir.model.fields,field_description:l10n_ve_stock.field_res_company__allow_scrap_more_than_available
#: model:ir.model.fields,field_description:l10n_ve_stock.field_res_config_settings__allow_scrap_more_than_available
msgid "Allow Scrap More Than Available"
msgstr "Permitir desechar más de lo disponible"

#. module: l10n_ve_stock
#: model:ir.model.fields,field_description:l10n_ve_stock.field_res_company__validate_without_product_quantity
#: model:ir.model.fields,field_description:l10n_ve_stock.field_res_config_settings__validate_without_product_quantity
Expand All @@ -98,6 +134,11 @@ msgstr "Permitir Validar Sin Cantidad de Producto"
msgid "Allow changing weight during picking"
msgstr "Permitir cambiar de peso durante la Picking"

#. module: l10n_ve_stock
#: model_terms:ir.ui.view,arch_db:l10n_ve_stock.res_config_settings_view_form_l10n_ve_stock
msgid "Allow to scrap more than available quantity in stock."
msgstr "Permitir desechar más que la cantidad disponible en inventario."

#. module: l10n_ve_stock
#: model_terms:ir.ui.view,arch_db:l10n_ve_stock.res_config_settings_view_form_l10n_ve_stock
msgid ""
Expand Down Expand Up @@ -129,6 +170,7 @@ msgstr ""
#: model:ir.model.fields,field_description:l10n_ve_stock.field_stock_location__partner_id
msgid "Assigned Customer"
msgstr "Cliente"

#. module: l10n_ve_stock
#: model:ir.model.fields,field_description:l10n_ve_stock.field_stock_location__message_attachment_count
msgid "Attachment Count"
Expand Down Expand Up @@ -219,6 +261,11 @@ msgstr "Órdenes de Despacho"
msgid "Descripción"
msgstr ""

#. module: l10n_ve_stock
#: model_terms:ir.ui.view,arch_db:l10n_ve_stock.res_config_settings_view_form_l10n_ve_stock
msgid "Dispatch Guide"
msgstr "Configuración de guía de despacho"

#. module: l10n_ve_stock
#: model_terms:ir.ui.view,arch_db:l10n_ve_stock.view_stock_quantity_history_inherit_binaural_stock
msgid "Download"
Expand Down Expand Up @@ -347,6 +394,21 @@ msgstr ""
"Si tienes más de la cantidad en stock, no permitir\n"
" transferir/vender."

#. module: l10n_ve_stock
#. odoo-python
#: code:addons/l10n_ve_stock/models/stock_picking.py:0
#, python-format
msgid ""
"Insufficient stock:\n"
"%s\n"
"\n"
"Adjust quantitys or request stock for this location."
Copy link

Copilot AI Nov 8, 2025

Choose a reason for hiding this comment

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

Error de ortografía en el archivo de traducción: "quantitys" debería ser "quantities". Esta misma corrección debe aplicarse tanto en la cadena msgid como en la traducción msgstr correspondiente.

Suggested change
"Adjust quantitys or request stock for this location."
"Adjust quantities or request stock for this location."

Copilot uses AI. Check for mistakes.
msgstr ""
"Stock Insuficiente:\n"
"%s\n"
"\n"
"Ajuste las cantidades o solicite más stock para esta ubicación."

#. module: l10n_ve_stock
#. odoo-python
#: code:addons/l10n_ve_stock/models/stock_warehouse.py:0
Expand Down Expand Up @@ -416,6 +478,11 @@ msgstr "Mensajes"
msgid "My Activity Deadline"
msgstr "Mi fecha límite de actividad"

#. module: l10n_ve_stock
#: model:ir.model.fields,field_description:l10n_ve_stock.field_stock_location__activity_calendar_event_id
msgid "Next Activity Calendar Event"
msgstr "Próximo evento de calendario de actividad"

#. module: l10n_ve_stock
#: model:ir.model.fields,field_description:l10n_ve_stock.field_stock_location__activity_date_deadline
msgid "Next Activity Deadline"
Expand All @@ -431,6 +498,30 @@ msgstr "Resumen de la siguiente actividad"
msgid "Next Activity Type"
msgstr "Siguiente tipo de actividad"

#. module: l10n_ve_stock
#. odoo-python
#: code:addons/l10n_ve_stock/models/stock_scrap.py:0
#, python-format
msgid "No more than what is manufactured can be discarded in this operation."
msgstr "En esta operación no se puede desechar más de lo fabricado."

#. module: l10n_ve_stock
#: model:ir.model.fields,field_description:l10n_ve_stock.field_res_company__not_allow_negative_inventory_adjustments
#: model:ir.model.fields,field_description:l10n_ve_stock.field_res_config_settings__not_allow_negative_inventory_adjustments
msgid "Not Allow Negative Inventory Adjustments"
msgstr "No permitir ajustes de inventario negativos"

#. module: l10n_ve_stock
#: model:ir.model.fields,field_description:l10n_ve_stock.field_res_company__not_allow_negative_stock_movement
msgid "Not Allow Negative Stock Movement"
msgstr "No permitir movimientos de stock negativos"

#. module: l10n_ve_stock
#: model:ir.model.fields,field_description:l10n_ve_stock.field_res_company__not_allow_scrap_more_than_what_was_manufactured
#: model:ir.model.fields,field_description:l10n_ve_stock.field_res_config_settings__not_allow_scrap_more_than_what_was_manufactured
msgid "Not Allow Scrap More Than What Was Manufactured"
msgstr "No permitir que se deseche más de lo fabricado"

#. module: l10n_ve_stock
#: model_terms:ir.ui.view,arch_db:l10n_ve_stock.packaging_picking_item
msgid "Note:"
Expand Down Expand Up @@ -550,6 +641,11 @@ msgstr "Tipo de recolección"
msgid "Picks Count"
msgstr "Cantidad de Picks"

#. module: l10n_ve_stock
#: model:ir.model.fields,field_description:l10n_ve_stock.field_res_config_settings__not_allow_negative_stock_movement
msgid "Prevent internal movement with negative stock"
msgstr "Evita movimientos internos con stock negativo"

#. module: l10n_ve_stock
#: model_terms:ir.ui.view,arch_db:l10n_ve_stock.product_template_kanban_view
msgid "Price + IVA:"
Expand Down Expand Up @@ -623,7 +719,7 @@ msgstr "Cantidad"
#. module: l10n_ve_stock
#: model:ir.model,name:l10n_ve_stock.model_stock_quant
msgid "Quants"
msgstr ""
msgstr "Cantidades"

#. module: l10n_ve_stock
#: model_terms:ir.ui.view,arch_db:l10n_ve_stock.report_inventory_valuation_template
Expand Down Expand Up @@ -657,6 +753,11 @@ msgstr "Error de entrega de SMS"
msgid "Sales Price"
msgstr "Precio de Venta + Impuesto"

#. module: l10n_ve_stock
#: model:ir.model,name:l10n_ve_stock.model_stock_scrap
msgid "Scrap"
msgstr "Desechar"

#. module: l10n_ve_stock
#: model:ir.model.fields,field_description:l10n_ve_stock.field_res_config_settings__group_product_available_quantity_on_sale
msgid "Show Available Quantity From All Warehouses"
Expand Down Expand Up @@ -756,7 +857,7 @@ msgstr ""
#. module: l10n_ve_stock
#: model:ir.model,name:l10n_ve_stock.model_stock_picking
msgid "Transfer"
msgstr "Transferir "
msgstr "Transferencia"

#. module: l10n_ve_stock
#: model:ir.model.fields,field_description:l10n_ve_stock.field_stock_picking__type_delivery_step
Expand Down Expand Up @@ -815,6 +916,11 @@ msgstr "Usuario"
msgid "VALOR DEL INVENTARIO A PARTIR DE UNA FECHA"
msgstr ""

#. module: l10n_ve_stock
#: model:ir.model,name:l10n_ve_stock.model_stock_warehouse
msgid "Warehouse"
msgstr "Almacén"

#. module: l10n_ve_stock
#: model:ir.model.fields,field_description:l10n_ve_stock.field_stock_quantity_history__warehouse_search_id
msgid "Warehouse Search"
Expand Down Expand Up @@ -864,6 +970,23 @@ msgstr "No puedes hacer transferencias mayores que la demanda"
msgid "You cannot make transfers larger than the reserved quantity"
msgstr "No puedes hacer transferencias mayores que la cantidad reservada"

#. module: l10n_ve_stock
#. odoo-python
#: code:addons/l10n_ve_stock/models/stock_scrap.py:0
#, python-format
msgid ""
"You cannot scrap more than the available product quantity in this location."
msgstr ""
"No puedes desechar más cantidad de producto que la disponible en esta "
"ubicación."

#. module: l10n_ve_stock
#. odoo-python
#: code:addons/l10n_ve_stock/models/stock_quant.py:0
#, python-format
msgid "You cannot set the physical quantity of '%s' to a negative value."
msgstr "No puedes ajustar la cantidad física de '%s' a un valor negativo."

#. module: l10n_ve_stock
#. odoo-python
#: code:addons/l10n_ve_stock/models/stock_picking.py:0
Expand Down
1 change: 1 addition & 0 deletions l10n_ve_stock/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@
stock_picking_type,
stock_quant,
stock_warehouse,
stock_scrap
)
13 changes: 13 additions & 0 deletions l10n_ve_stock/models/res_company.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,15 @@ class ResCompany(models.Model):
_inherit = "res.company"

group_product_available_quantity_on_sale = fields.Boolean()

use_main_warehouse = fields.Boolean()

main_warehouse_id = fields.Many2one("stock.warehouse")

change_weight = fields.Boolean()

use_physical_location = fields.Boolean()

use_free_qty_odoo = fields.Boolean()

# not_allow_sell_products = fields.Boolean(
Expand All @@ -21,3 +26,11 @@ class ResCompany(models.Model):
"Allow Validate Without Product Quantity", default=False
)
limit_product_qty_out = fields.Integer()

not_allow_negative_inventory_adjustments = fields.Boolean()

allow_scrap_more_than_available = fields.Boolean()

not_allow_scrap_more_than_what_was_manufactured = fields.Boolean()

not_allow_negative_stock_movement = fields.Boolean()
21 changes: 21 additions & 0 deletions l10n_ve_stock/models/res_config_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,24 @@ class ResConfigSettings(models.TransientModel):

limit_product_qty_out = fields.Integer(string="Limit stock picking product lines", related='company_id.limit_product_qty_out', readonly=False)

not_allow_negative_inventory_adjustments = fields.Boolean(
"Not Allow Negative Inventory Adjustments",
related="company_id.not_allow_negative_inventory_adjustments",
readonly=False,
)

allow_scrap_more_than_available = fields.Boolean(related='company_id.allow_scrap_more_than_available', readonly=False)

not_allow_scrap_more_than_what_was_manufactured = fields.Boolean(
"Not Allow Scrap More Than What Was Manufactured",
related="company_id.not_allow_scrap_more_than_what_was_manufactured",
readonly=False
)

not_allow_negative_stock_movement = fields.Boolean(
string="Prevent internal movement with negative stock",
related="company_id.not_allow_negative_stock_movement",
readonly=False
)


59 changes: 57 additions & 2 deletions l10n_ve_stock/models/stock_picking.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import logging

from odoo import _, api, fields, models
from odoo.exceptions import UserError
from odoo.exceptions import UserError, ValidationError
from odoo.fields import Domain
_logger = logging.getLogger(__name__)

from odoo.exceptions import UserError


class StockPicking(models.Model):
Expand Down Expand Up @@ -242,3 +241,59 @@ def action_assign(self):
self = self.with_context(skip_physical_location=True)
return super().action_assign()

def button_validate(self):
if self.env.company.not_allow_negative_stock_movement:
res = super(StockPicking, self).button_validate()
if isinstance(res, dict) and res.get('res_model') == 'stock.backorder.confirmation':
return res
else:
self._check_stock_availability_for_pickings()
return super().button_validate()

def _check_stock_availability_for_pickings(self):
if self.picking_type_id.code in ['internal', 'outgoing']:
group_product_location_lot = {}

all_move_lines_to_check = self.env['stock.move.line']
for picking in self:
all_move_lines_to_check |= picking.move_line_ids

for line in all_move_lines_to_check:
if line.product_id.type == 'consu':
qty_done_line = line.quantity
if qty_done_line <= 0:
continue

key = (line.product_id.id, line.lot_id.id if line.lot_id else False, line.location_id.id)

group_product_location_lot[key] = \
group_product_location_lot.get(key, 0.0) + qty_done_line

stock_msg = []

for key, total_qty_to_move in group_product_location_lot.items():
product_id, lot_id, location_id = key

product_obj = self.env['product.product'].browse(product_id)
location_obj = self.env['stock.location'].browse(location_id)
lot_obj = self.env['stock.lot'].browse(lot_id) if lot_id else False

context_to_stock = {'location': location_obj.id}
if lot_obj:
context_to_stock['lot_id'] = lot_obj.id

qty_real_allow = \
product_obj.with_context(context_to_stock).qty_available - \
total_qty_to_move

if qty_real_allow < 0:
info_lote_serial = f" ({_('Lot/Serial')}: {lot_obj.name})" if lot_obj else ""
stock_msg.append(
_("%s%s", product_obj.display_name, info_lote_serial)
)

if stock_msg:
error_msg = _(
"Insufficient stock:\n%s\n\nAdjust quantitys or request stock for this location."
Copy link

Copilot AI Nov 8, 2025

Choose a reason for hiding this comment

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

Error de ortografía en el mensaje de error: "quantitys" debería ser "quantities".

Suggested change
"Insufficient stock:\n%s\n\nAdjust quantitys or request stock for this location."
"Insufficient stock:\n%s\n\nAdjust quantities or request stock for this location."

Copilot uses AI. Check for mistakes.
) % "\n".join(stock_msg)
raise ValidationError(error_msg)
Loading