Files
Odoo-Modules/fusion_plating/fusion_plating_culture/models/fp_value.py
gsinghpal 8c76a16366 chore(plating): de-dash shipped code + intake-neutral customer emails
Replace em-dashes and en-dashes with hyphens across 789 shipped source
files (py/xml/js/scss) so the delivered module reads as human-written;
em-dashes had become a recognizable AI-generated tell. Internal .md dev
notes are excluded. The WO-sticker mojibake strippers keep their dash
search targets (now written — / –). No logic changes: comments
and display strings only; validated with py_compile + lxml parse.

Rewrite the 7 customer notification emails to be intake-neutral
(ship-in / drop-off / pickup) and repair-aware, and fix the Shipped
email documents line (packing slip vs bill of lading; certificate only
when issued). Subjects use a hyphen separator.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 00:16:19 -04:00

101 lines
3.0 KiB
Python

# -*- coding: utf-8 -*-
# Copyright 2026 Nexa Systems Inc.
# License OPL-1 (Odoo Proprietary License v1.0)
# Part of the Fusion Plating product family.
from odoo import api, fields, models
class FpValue(models.Model):
"""A single value, fundamental, core behaviour, or belief.
Values are grouped under a fusion.plating.value.set. Each value has a
short title, an optional display number (e.g. "Fundamental #3"), a
long-form description, stories / examples of living the value, and an
icon for display in kanban tiles.
"""
_name = 'fusion.plating.value'
_description = 'Fusion Plating - Value'
_order = 'set_id, sequence, number, name'
name = fields.Char(
string='Title',
required=True,
help='Short, memorable title for the value, e.g. '
'"Do What\'s Best for the Customer".',
)
sequence = fields.Integer(
string='Sequence',
default=10,
help='Display order within the set.',
)
number = fields.Integer(
string='Number',
help='Optional display number (e.g. 1, 2, 3). Shows on kanban '
'tiles and in rotation schedules.',
)
set_id = fields.Many2one(
'fusion.plating.value.set',
string='Value Set',
required=True,
ondelete='cascade',
index=True,
)
company_id = fields.Many2one(
'res.company',
string='Company',
related='set_id.company_id',
store=True,
readonly=True,
)
description = fields.Html(
string='Description',
help='Long-form explanation of what this value means and how it '
'shows up in daily work.',
)
examples = fields.Html(
string='Stories & Examples',
help='Stories, anecdotes, and concrete examples of people living '
'this value.',
)
icon = fields.Char(
string='Icon',
default='fa-star',
help='Font Awesome icon class (without the "fa " prefix), '
'e.g. "fa-heart", "fa-bolt".',
)
color = fields.Integer(
string='Color Index',
default=0,
help='Kanban colour index (0-11).',
)
active = fields.Boolean(
string='Active',
default=True,
)
recognition_ids = fields.One2many(
'fusion.plating.value.recognition',
'value_id',
string='Recognitions',
)
recognition_count = fields.Integer(
string='Recognition Count',
compute='_compute_recognition_count',
)
@api.depends('recognition_ids', 'recognition_ids.state')
def _compute_recognition_count(self):
for rec in self:
rec.recognition_count = len(rec.recognition_ids.filtered(
lambda r: r.state == 'published'
))
def name_get(self):
result = []
for rec in self:
if rec.number:
result.append((rec.id, f'#{rec.number} - {rec.name}'))
else:
result.append((rec.id, rec.name))
return result