Metadata-Version: 2.1
Name: odoo-addon-l10n_jp_kana
Version: 19.0.1.0.0.2
Requires-Dist: jaconv
Requires-Dist: odoo==19.0.*
Summary: Normalized kana readings for any model, and their format setting
Home-page: https://github.com/OCA/l10n-japan
License: LGPL-3
Author: Quartile, Odoo Community Association (OCA)
Author-email: support@odoo-community.org
Classifier: Programming Language :: Python
Classifier: Framework :: Odoo
Classifier: Framework :: Odoo :: 19.0
Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)
Description-Content-Type: text/x-rst

.. image:: https://odoo-community.org/readme-banner-image
   :target: https://odoo-community.org/get-involved?utm_source=readme
   :alt: Odoo Community Association

=============
Japanese Kana
=============

.. 
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   !! This file is generated by oca-gen-addon-readme !!
   !! changes will be overwritten.                   !!
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   !! source digest: sha256:3f8ff2a8f0b57a4ab246b34009f31fb272cfb949c1a2d246fe617f3ce7ae94e1
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
    :target: https://odoo-community.org/page/development-status
    :alt: Beta
.. |badge2| image:: https://img.shields.io/badge/license-LGPL--3-blue.png
    :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
    :alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fl10n--japan-lightgray.png?logo=github
    :target: https://github.com/OCA/l10n-japan/tree/19.0/l10n_jp_kana
    :alt: OCA/l10n-japan
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
    :target: https://translation.odoo-community.org/projects/l10n-japan-19-0/l10n-japan-19-0-l10n_jp_kana
    :alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
    :target: https://runboat.odoo-community.org/builds?repo=OCA/l10n-japan&target_branch=19.0
    :alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

Provides the abstract models that give a phonetic reading (カナ /
ふりがな) to a model -- of its name, or of any other field -- and the
setting that chooses the kana format readings are stored in.

A reading is stored in a canonical form, so the same pronunciation
matches however it was typed: kana take the configured format,
full-width ASCII and digits fold to half-width (ＡＢＣショウジ is stored
as ABCショウジ), and spacing collapses to single half-width spaces. A
search term goes through the same normalization before it is compared.

This module adds no field to any model of its own; the readings live in
the modules that apply the mixins to a model.

**Table of contents**

.. contents::
   :local:

Configuration
=============

Select the kana format under *Settings > General Settings > Japanese
Kana*. Full-width katakana is the default; half-width katakana and
hiragana are the alternatives.

A single model can depart from that, for the case where personal
furigana is kept in hiragana while contacts and products stay in
katakana. This is rare, so it has no setting of its own: add a system
parameter under *Settings > Technical > System Parameters* whose key is
the model name appended to the global one, and whose value is one of
``full_width_katakana``, ``half_width_katakana`` or ``hiragana``.

======================================== ===========================
Key                                      Applies to
======================================== ===========================
``l10n_jp_kana.format``                  every model with a reading
``l10n_jp_kana.format.res.partner``      contacts
``l10n_jp_kana.format.hr.employee``      employees
``l10n_jp_kana.format.product.template`` products and their variants
======================================== ===========================

An empty or absent per-model key means the model follows the global
format.

Changing a format affects only the readings saved afterwards -- see
Known Issues.

Usage
=====

Install the module that carries the reading to the model you need:

- ``l10n_jp_kana_partner_name`` -- contacts
- ``l10n_jp_kana_product_name`` -- products
- ``l10n_jp_kana_hr_employee_name`` -- employees

To give another model a reading of its name, inherit ``kana.mixin`` and
``name.kana.mixin`` alongside the model and add the ``name_kana`` field
to the form and list views. In the search view, use ``name_kana_search``
rather than ``name_kana``: a search view compares the term to the column
as typed, and that field is what normalizes the term first. Readings are
then normalized on create and write, and a term typed into the model's
lookup finds the record whichever kana form it is in.

For a reading of something other than the name -- an address, say --
inherit ``kana.mixin`` alone and declare the ``Char`` fields with
``kana=True``. They are normalized on create and write like a name
reading; add an ``onchange`` on them if the form should show the stored
form before saving.

``name.kana.mixin`` needs ``kana.mixin`` beside it, which is where the
normalization lives. Neither derives from the other, so a module
extending ``kana.mixin`` reaches every model that took it.

Known issues / Roadmap
======================

Changing a kana format does not rewrite the readings that are already
stored. Only readings saved after the change follow the new format; the
older ones keep the format they were saved in, and because a search term
is normalized to the current format, they stop being found by it until
they are saved again.

Pick the format when the module is installed. If it has to change
afterwards, re-save the affected readings separately -- writing a
reading back through the ORM normalizes it to the current format.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/l10n-japan/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/l10n-japan/issues/new?body=module:%20l10n_jp_kana%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* Quartile

Contributors
------------

- `Quartile <https://www.quartile.co>`__:

  - Aung Ko Ko Lin

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
   :alt: Odoo Community Association
   :target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

.. |maintainer-AungKoKoLin1997| image:: https://github.com/AungKoKoLin1997.png?size=40px
    :target: https://github.com/AungKoKoLin1997
    :alt: AungKoKoLin1997

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-AungKoKoLin1997| 

This module is part of the `OCA/l10n-japan <https://github.com/OCA/l10n-japan/tree/19.0/l10n_jp_kana>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
