This commit is contained in:
2026-11-08 20:08:53 +08:00
parent 7526a5fe4d
commit 9b924747c5
2692 changed files with 394867 additions and 0 deletions

View File

@@ -0,0 +1 @@
from . import appointment_type

View File

@@ -0,0 +1,24 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
class AppointmentType(models.Model):
_inherit = 'appointment.type'
def _ai_get_preview_metadata(self):
"""Extend preview metadata with linked product prices."""
metadata = super()._ai_get_preview_metadata()
appointments_with_product = self.filtered('product_id')
if not appointments_with_product:
return metadata
product_id_by_appointment_id = {
appointment.id: appointment.product_id.id
for appointment in appointments_with_product
}
combo_info = (
appointments_with_product.mapped('product_id').sudo()._resolve_product_combination_info()
)
for entry in metadata:
entry.update(combo_info.get(product_id_by_appointment_id.get(entry['id']), {}))
return metadata