Files
Odoo-Modules/fusion_plating/fusion_plating_culture/models/fp_value_recognition.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

121 lines
3.4 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 FpValueRecognition(models.Model):
"""A peer recognition tied to a specific value.
Example: "I saw Sarah living Value #3 yesterday when she stayed late
to re-mask a customer part after first-article inspection flagged a
nick."
Recognitions start in draft, move to published, and can be archived
when they roll off a stand-up wall or a newsletter.
"""
_name = 'fusion.plating.value.recognition'
_description = 'Fusion Plating - Value Recognition'
_inherit = ['mail.thread', 'mail.activity.mixin']
_order = 'nomination_date desc, id desc'
name = fields.Char(
string='Title',
required=True,
tracking=True,
help='Short headline for the recognition, e.g. '
'"Sarah stayed late for the customer".',
default=lambda self: _('New Recognition'),
)
reference = fields.Char(
string='Reference',
readonly=True,
copy=False,
default=lambda self: _('New'),
)
value_id = fields.Many2one(
'fusion.plating.value',
string='Value',
required=True,
tracking=True,
ondelete='restrict',
)
set_id = fields.Many2one(
'fusion.plating.value.set',
string='Value Set',
related='value_id.set_id',
store=True,
readonly=True,
)
recognized_employee_id = fields.Many2one(
'hr.employee',
string='Recognized',
required=True,
tracking=True,
help='The person being recognized.',
)
nominated_by_id = fields.Many2one(
'res.users',
string='Nominated By',
default=lambda self: self.env.user,
tracking=True,
)
nomination_date = fields.Datetime(
string='Nominated On',
default=fields.Datetime.now,
tracking=True,
)
story = fields.Html(
string='Story',
help='What happened? Describe the moment you saw the value being '
'lived.',
)
state = fields.Selection(
[
('draft', 'Draft'),
('published', 'Published'),
('archived', 'Archived'),
],
string='Status',
default='draft',
required=True,
tracking=True,
)
company_id = fields.Many2one(
'res.company',
string='Company',
default=lambda self: self.env.company,
)
color = fields.Integer(
string='Color Index',
default=0,
)
@api.model_create_multi
def create(self, vals_list):
for vals in vals_list:
if not vals.get('reference') or vals['reference'] == _('New'):
vals['reference'] = self.env['ir.sequence'].next_by_code(
'fusion.plating.value.recognition'
) or _('New')
return super().create(vals_list)
def action_publish(self):
for rec in self:
rec.state = 'published'
rec.message_post(body=_('Recognition published.'))
return True
def action_archive_recognition(self):
for rec in self:
rec.state = 'archived'
rec.message_post(body=_('Recognition archived.'))
return True
def action_reset_to_draft(self):
for rec in self:
rec.state = 'draft'
return True