Criptomart/red-supermercados-coop#2 stock_inventory_category_concurrency: store product_category_id in stock.quants. Add search and group_by categories
This commit is contained in:
parent
54e7755197
commit
91641c7c88
5 changed files with 64 additions and 8 deletions
|
|
@ -1,18 +1,23 @@
|
|||
from odoo import _, models
|
||||
from odoo import _, models, fields
|
||||
from odoo.exceptions import ValidationError
|
||||
|
||||
|
||||
class StockQuant(models.Model):
|
||||
_inherit = "stock.quant"
|
||||
|
||||
product_categ_id = fields.Many2one(
|
||||
related="product_tmpl_id.categ_id",
|
||||
store=True,
|
||||
index=True,
|
||||
string="Product Category",
|
||||
)
|
||||
|
||||
|
||||
class InventoryAdjustmentsGroup(models.Model):
|
||||
_inherit = "stock.inventory"
|
||||
|
||||
def action_state_to_in_progress(self):
|
||||
"""
|
||||
Relaja el bloqueo por categoría: si el ajuste actual es por categoría,
|
||||
solo bloquea otros ajustes en progreso que afecten a la MISMA categoría exacta,
|
||||
no a categorías hermanas distintas ni a todas sus hijas.
|
||||
"""
|
||||
self.ensure_one()
|
||||
# Reusar la lógica original, pero parchear el caso de category
|
||||
search_filter = [
|
||||
(
|
||||
"location_id",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue