Metadata-Version: 2.1
Name: odoo-addon-credit_control_communication_total_due
Version: 16.0.1.0.0.5
Requires-Python: >=3.10
Requires-Dist: odoo-addon-account_credit_control>=16.0dev,<16.1dev
Requires-Dist: odoo>=16.0a,<16.1dev
Summary: Persist total_due on credit.control.communication for QWeb templates
Home-page: https://github.com/somit/credit-control
License: AGPL-3
Author: SOMIT, Odoo Community Association (OCA)
Author-email: support@odoo-community.org
Classifier: Programming Language :: Python
Classifier: Framework :: Odoo
Classifier: Framework :: Odoo :: 16.0
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
Description-Content-Type: text/x-rst

======================================
Credit Control Communication Total Due
======================================

This module persists the ``total_due`` field on
``credit.control.communication`` as a stored database column and adds a
pre-formatted companion ``total_due_formatted``, so both values are reachable
from ``mail.template`` QWeb bodies.

The upstream OCA ``account_credit_control`` module defines ``total_due`` as a
non-stored computed field.  Because QWeb rendering of stored objects does not
recompute non-stored functional fields, the total amount due cannot be embedded
directly in credit control follow-up emails.  This module overrides the field
with ``store=True`` (keeping the exact same compute body and ``@api.depends``
chain as upstream) and provides a ready-to-render formatted variant.

Usage
=====

To embed the total due in a credit control email template::

    <p>The total amount due is: <strong t-out="object.total_due_formatted"/>.</p>

Or the raw value::

    <p>Total due: <span t-esc="object.total_due"/></p>

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/credit-control/issues>`_.
In case of trouble, please check there if your issue has already been reported.

Credits
=======

Author
------

* SOMIT

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

* SOMIT

Maintainer
----------

This module is maintained by the OCA.

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