mirror of
https://github.com/bringout/oca-technical.git
synced 2026-04-24 02:52:03 +02:00
Initial commit: OCA Technical packages (595 packages)
This commit is contained in:
commit
2cc02aac6e
24950 changed files with 2318079 additions and 0 deletions
|
|
@ -0,0 +1,2 @@
|
|||
from . import product
|
||||
from . import pos_session
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
# Copyright 2024 Tecnativa - Carlos Lopez
|
||||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
|
||||
|
||||
from odoo import models
|
||||
|
||||
|
||||
class PosSession(models.Model):
|
||||
_inherit = "pos.session"
|
||||
|
||||
def _loader_params_product_product(self):
|
||||
res = super()._loader_params_product_product()
|
||||
res["search_params"]["fields"].append("supplier_data_json")
|
||||
return res
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
import json
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class ProductTemplate(models.Model):
|
||||
_inherit = "product.template"
|
||||
|
||||
supplier_data_json = fields.Char(
|
||||
"Supplier data dict",
|
||||
help="Technical field: Used in POS frontend to search products by supplierinfo",
|
||||
compute="_compute_supplier_data_json",
|
||||
)
|
||||
|
||||
def _compute_supplier_data_json(self):
|
||||
for rec in self:
|
||||
rec.supplier_data_json = json.dumps(
|
||||
[
|
||||
{
|
||||
"supplier_name": s.partner_id.display_name,
|
||||
"supplier_product_code": s.product_code or "",
|
||||
"supplier_product_name": s.product_name or "",
|
||||
}
|
||||
for s in rec.seller_ids
|
||||
]
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue