2
0

Add option to auto-archive spreads

This commit is contained in:
Andrea 2019-08-21 12:11:26 +02:00 committed by Andrea Stirpe
parent 117e80f381
commit 6bf9e855ed
10 changed files with 172 additions and 55 deletions

View File

@ -14,13 +14,13 @@ Cost-Revenue Spread
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3 :alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Faccount--financial--tools-lightgray.png?logo=github .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Faccount--financial--tools-lightgray.png?logo=github
:target: https://github.com/OCA/account-financial-tools/tree/11.0/account_spread_cost_revenue :target: https://github.com/OCA/account-financial-tools/tree/12.0/account_spread_cost_revenue
:alt: OCA/account-financial-tools :alt: OCA/account-financial-tools
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/account-financial-tools-11-0/account-financial-tools-11-0-account_spread_cost_revenue :target: https://translation.odoo-community.org/projects/account-financial-tools-12-0/account-financial-tools-12-0-account_spread_cost_revenue
:alt: Translate me on Weblate :alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/92/11.0 :target: https://runbot.odoo-community.org/runbot/92/12.0
:alt: Try me on Runbot :alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5| |badge1| |badge2| |badge3| |badge4| |badge5|
@ -48,9 +48,23 @@ In the same *Account Spread* tab, you can also configure the Spread Balance Shee
* the *Default Spread Account for Revenues*, * the *Default Spread Account for Revenues*,
* the *Default Spread Account for Expenses*. * the *Default Spread Account for Expenses*.
This module by default allows the spreading even before the receipt of the invoice or when the invoice is still draft,
so that it is possible to work on the plan of the cost/revenue spreading. To disable this feature, on the form view of
the company disable the *Allow Spread Planning* option.
On the form view of the company, the *Auto-post spread lines* option forces the account moves created
during the cost/revenue spreading to be automatically posted. When this option is false, the user can
enable/disable the automatic posting by the flag *Auto-post lines* present in the spread board.
On the form view of the company, enable the *Auto-archive spread* option if you want the
cron job to automatically archive the spreads when all lines are posted.
Usage Usage
===== =====
Define Spread Costs/Revenues Board
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Under Invoicing -> Adviser -> Accounting Entries -> Spread Costs/Revenues, create a new spread board. Under Invoicing -> Adviser -> Accounting Entries -> Spread Costs/Revenues, create a new spread board.
Complete the definition of the spreading criteria, by setting the the fields: Complete the definition of the spreading criteria, by setting the the fields:
@ -63,25 +77,32 @@ Complete the definition of the spreading criteria, by setting the the fields:
* *Start date* * *Start date*
* *Journal* * *Journal*
.. figure:: static/description/spread.png .. figure:: https://raw.githubusercontent.com/OCA/account-financial-tools/12.0/account_spread_cost_revenue/static/description/spread.png
:alt: Create a new spread board :alt: Create a new spread board
Click on the button on the top-left to calculate the spread lines. Click on the button on the top-left to calculate the spread lines.
.. figure:: static/description/create_spread.png .. figure:: https://raw.githubusercontent.com/OCA/account-financial-tools/12.0/account_spread_cost_revenue/static/description/create_spread.png
:alt: The spreading board is defined :alt: The spreading board is defined
A cron job will automatically create the accounting moves for all the lines having date previous that the current day (today). A cron job will automatically create the accounting moves for all the lines having date previous that the current day (today).
.. figure:: static/description/update_spread.png .. figure:: https://raw.githubusercontent.com/OCA/account-financial-tools/12.0/account_spread_cost_revenue/static/description/update_spread.png
:alt: The spreading board is updated by the cron job :alt: The spreading board is updated by the cron job
By default, the status of the created accounting moves is unposted, so you should post them manually one by one. By default, the status of the created accounting moves is posted.
To allow the automatic posting of the accounting moves, set the flag *Auto-post lines* to True. To disable the automatic posting of the accounting moves, set the flag *Auto-post lines* to False.
This flag is only available when the *Auto-post spread lines* option, present on the form view of the company, is disabled.
Click on button *Recalculate entire spread* button in the spread board to force the recalculation of the spread lines:
this will also reset all the journal entries previously created.
Link Invoice to Spread Costs/Revenues Board
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Create an invoice or vendor bill in draft. On its lines, the spreading right-arrow icon are displayed in dark-grey color. Create an invoice or vendor bill in draft. On its lines, the spreading right-arrow icon are displayed in dark-grey color.
.. figure:: static/description/invoice_line_1.png .. figure:: https://raw.githubusercontent.com/OCA/account-financial-tools/12.0/account_spread_cost_revenue/static/description/invoice_line_1.png
:alt: On the invoice line the spreading icon is displayed :alt: On the invoice line the spreading icon is displayed
Click on the spreading right-arrow icon. A wizard prompts to enter a *Spread Action Type*: Click on the spreading right-arrow icon. A wizard prompts to enter a *Spread Action Type*:
@ -96,7 +117,7 @@ the selected Spread Board will be automatically displayed.
Go back to the draft invoice/bill. The spreading functionality is now enabled on the invoice line: Go back to the draft invoice/bill. The spreading functionality is now enabled on the invoice line:
the spreading right-arrow icon is now displayed in green color. the spreading right-arrow icon is now displayed in green color.
.. figure:: static/description/invoice_line_2.png .. figure:: https://raw.githubusercontent.com/OCA/account-financial-tools/12.0/account_spread_cost_revenue/static/description/invoice_line_2.png
:alt: On the invoice line the spreading icon is displayed in green color :alt: On the invoice line the spreading icon is displayed in green color
Validate the invoice/bill. Click on the spreading (green) right-arrow icon to open the spread board, then click Validate the invoice/bill. Click on the spreading (green) right-arrow icon to open the spread board, then click
@ -105,14 +126,32 @@ on the smart button *Reconciled entries*: the moves of the spread lines are reco
In case the Subtotal Price of the invoice line is different than the *Estimated Amount* of the spread board, the spread In case the Subtotal Price of the invoice line is different than the *Estimated Amount* of the spread board, the spread
lines (not yet posted) will be recalculated when validating the invoice/bill. lines (not yet posted) will be recalculated when validating the invoice/bill.
Click on button *Recalculate entire spread* button in the spread board to force the recalculation of the spread lines: Define Spread Costs/Revenues Template
this will also reset all the journal entries previously created. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Known issues / Roadmap Under Invoicing -> Configuration -> Accounting -> Spread Templates, create a new spread template.
======================
* Verify last day of month * *Spread Type*
* Not yet compatible with cutoff module: create module for adaptation? * *Spread Balance Sheet Account*
* *Journal*
When creating a new Spread Costs/Revenues Board, select the right template.
This way the above fields will be copied to the Spread Board.
Changelog
=========
12.0.1.0.0
~~~~~~~~~~
* [MIG] Port account_spread_cost_revenue to V12.
11.0.1.0.0
~~~~~~~~~~
* [ADD] Module account_spread_cost_revenue.
(`#715 <https://github.com/OCA/account-financial-tools/pull/715>`_)
Bug Tracker Bug Tracker
=========== ===========
@ -120,7 +159,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/account-financial-tools/issues>`_. Bugs are tracked on `GitHub Issues <https://github.com/OCA/account-financial-tools/issues>`_.
In case of trouble, please check there if your issue has already been reported. In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/account-financial-tools/issues/new?body=module:%20account_spread_cost_revenue%0Aversion:%2011.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. `feedback <https://github.com/OCA/account-financial-tools/issues/new?body=module:%20account_spread_cost_revenue%0Aversion:%2012.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. Do not contact contributors directly about support or help with technical issues.
@ -165,6 +204,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
|maintainer-astirpe| |maintainer-astirpe|
This module is part of the `OCA/account-financial-tools <https://github.com/OCA/account-financial-tools/tree/11.0/account_spread_cost_revenue>`_ project on GitHub. This module is part of the `OCA/account-financial-tools <https://github.com/OCA/account-financial-tools/tree/12.0/account_spread_cost_revenue>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View File

@ -68,6 +68,9 @@ class AccountSpread(models.Model):
total_amount = fields.Float( total_amount = fields.Float(
digits=dp.get_precision('Account'), digits=dp.get_precision('Account'),
compute='_compute_amounts') compute='_compute_amounts')
all_posted = fields.Boolean(
compute='_compute_amounts',
store=True)
line_ids = fields.One2many( line_ids = fields.One2many(
'account.spread.line', 'account.spread.line',
'spread_id', 'spread_id',
@ -123,6 +126,7 @@ class AccountSpread(models.Model):
display_move_line_auto_post = fields.Boolean( display_move_line_auto_post = fields.Boolean(
compute='_compute_display_move_line_auto_post', compute='_compute_display_move_line_auto_post',
string='Display Button Auto-post lines') string='Display Button Auto-post lines')
active = fields.Boolean(default=True)
@api.model @api.model
def default_get(self, fields): def default_get(self, fields):
@ -181,6 +185,7 @@ class AccountSpread(models.Model):
spread.unposted_amount = total_amount - posted_amount spread.unposted_amount = total_amount - posted_amount
spread.posted_amount = posted_amount spread.posted_amount = posted_amount
spread.total_amount = total_amount spread.total_amount = total_amount
spread.all_posted = spread.unposted_amount == 0.0
@api.multi @api.multi
def _compute_display_create_all_moves(self): def _compute_display_create_all_moves(self):

View File

@ -166,3 +166,8 @@ class AccountInvoiceSpreadLine(models.Model):
'move_id').filtered(lambda m: m.state != 'posted') 'move_id').filtered(lambda m: m.state != 'posted')
unposted_moves.filtered( unposted_moves.filtered(
lambda m: m.company_id.force_move_auto_post).post() lambda m: m.company_id.force_move_auto_post).post()
spreads_to_archive = self.env['account.spread'].search([
('all_posted', '=', True)
]).filtered(lambda s: s.company_id.auto_archive)
spreads_to_archive.write({'active': False})

View File

@ -27,3 +27,7 @@ class ResCompany(models.Model):
'Auto-post spread lines', 'Auto-post spread lines',
help="Enable this option if you want to post automatically the " help="Enable this option if you want to post automatically the "
"accounting moves of all the spreads.") "accounting moves of all the spreads.")
auto_archive = fields.Boolean(
'Auto-archive spread',
help="Enable this option if you want the cron job to automatically "
"archive the spreads when all lines are posted.")

View File

@ -18,3 +18,6 @@ the company disable the *Allow Spread Planning* option.
On the form view of the company, the *Auto-post spread lines* option forces the account moves created On the form view of the company, the *Auto-post spread lines* option forces the account moves created
during the cost/revenue spreading to be automatically posted. When this option is false, the user can during the cost/revenue spreading to be automatically posted. When this option is false, the user can
enable/disable the automatic posting by the flag *Auto-post lines* present in the spread board. enable/disable the automatic posting by the flag *Auto-post lines* present in the spread board.
On the form view of the company, enable the *Auto-archive spread* option if you want the
cron job to automatically archive the spreads when all lines are posted.

View File

@ -367,26 +367,35 @@ ul.auto-toc {
!! This file is generated by oca-gen-addon-readme !! !! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !! !! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/account-financial-tools/tree/11.0/account_spread_cost_revenue"><img alt="OCA/account-financial-tools" src="https://img.shields.io/badge/github-OCA%2Faccount--financial--tools-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/account-financial-tools-11-0/account-financial-tools-11-0-account_spread_cost_revenue"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/92/11.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p> <p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/account-financial-tools/tree/12.0/account_spread_cost_revenue"><img alt="OCA/account-financial-tools" src="https://img.shields.io/badge/github-OCA%2Faccount--financial--tools-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/account-financial-tools-12-0/account-financial-tools-12-0-account_spread_cost_revenue"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/92/12.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>Allows to spread costs or revenues over a customizable periods, to even out cost or invoice spikes.</p> <p>Allows to spread costs or revenues over a customizable periods, to even out cost or invoice spikes.</p>
<p><strong>Table of contents</strong></p> <p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents"> <div class="contents local topic" id="contents">
<ul class="simple"> <ul class="simple">
<li><a class="reference internal" href="#configuration" id="id1">Configuration</a></li> <li><a class="reference internal" href="#configuration" id="id4">Configuration</a></li>
<li><a class="reference internal" href="#usage" id="id2">Usage</a></li> <li><a class="reference internal" href="#usage" id="id5">Usage</a><ul>
<li><a class="reference internal" href="#known-issues-roadmap" id="id3">Known issues / Roadmap</a></li> <li><a class="reference internal" href="#define-spread-costs-revenues-board" id="id6">Define Spread Costs/Revenues Board</a></li>
<li><a class="reference internal" href="#bug-tracker" id="id4">Bug Tracker</a></li> <li><a class="reference internal" href="#link-invoice-to-spread-costs-revenues-board" id="id7">Link Invoice to Spread Costs/Revenues Board</a></li>
<li><a class="reference internal" href="#credits" id="id5">Credits</a><ul> <li><a class="reference internal" href="#define-spread-costs-revenues-template" id="id8">Define Spread Costs/Revenues Template</a></li>
<li><a class="reference internal" href="#authors" id="id6">Authors</a></li> </ul>
<li><a class="reference internal" href="#contributors" id="id7">Contributors</a></li> </li>
<li><a class="reference internal" href="#other-credits" id="id8">Other credits</a></li> <li><a class="reference internal" href="#changelog" id="id9">Changelog</a><ul>
<li><a class="reference internal" href="#maintainers" id="id9">Maintainers</a></li> <li><a class="reference internal" href="#id1" id="id10">12.0.1.0.0</a></li>
<li><a class="reference internal" href="#id2" id="id11">11.0.1.0.0</a></li>
</ul>
</li>
<li><a class="reference internal" href="#bug-tracker" id="id12">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="id13">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="id14">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="id15">Contributors</a></li>
<li><a class="reference internal" href="#other-credits" id="id16">Other credits</a></li>
<li><a class="reference internal" href="#maintainers" id="id17">Maintainers</a></li>
</ul> </ul>
</li> </li>
</ul> </ul>
</div> </div>
<div class="section" id="configuration"> <div class="section" id="configuration">
<h1><a class="toc-backref" href="#id1">Configuration</a></h1> <h1><a class="toc-backref" href="#id4">Configuration</a></h1>
<p>To be able to access the full spreading features, the user must belong to <em>Show Full Accounting Features</em> group.</p> <p>To be able to access the full spreading features, the user must belong to <em>Show Full Accounting Features</em> group.</p>
<p>On the form view of the company, in the <em>Account Spread</em> tab, you can configure <p>On the form view of the company, in the <em>Account Spread</em> tab, you can configure
the journals in which the spread journal items will be generated by default:</p> the journals in which the spread journal items will be generated by default:</p>
@ -399,9 +408,19 @@ the journals in which the spread journal items will be generated by default:</p>
<li>the <em>Default Spread Account for Revenues</em>,</li> <li>the <em>Default Spread Account for Revenues</em>,</li>
<li>the <em>Default Spread Account for Expenses</em>.</li> <li>the <em>Default Spread Account for Expenses</em>.</li>
</ul> </ul>
<p>This module by default allows the spreading even before the receipt of the invoice or when the invoice is still draft,
so that it is possible to work on the plan of the cost/revenue spreading. To disable this feature, on the form view of
the company disable the <em>Allow Spread Planning</em> option.</p>
<p>On the form view of the company, the <em>Auto-post spread lines</em> option forces the account moves created
during the cost/revenue spreading to be automatically posted. When this option is false, the user can
enable/disable the automatic posting by the flag <em>Auto-post lines</em> present in the spread board.</p>
<p>On the form view of the company, enable the <em>Auto-archive spread</em> option if you want the
cron job to automatically archive the spreads when all lines are posted.</p>
</div> </div>
<div class="section" id="usage"> <div class="section" id="usage">
<h1><a class="toc-backref" href="#id2">Usage</a></h1> <h1><a class="toc-backref" href="#id5">Usage</a></h1>
<div class="section" id="define-spread-costs-revenues-board">
<h2><a class="toc-backref" href="#id6">Define Spread Costs/Revenues Board</a></h2>
<p>Under Invoicing -&gt; Adviser -&gt; Accounting Entries -&gt; Spread Costs/Revenues, create a new spread board.</p> <p>Under Invoicing -&gt; Adviser -&gt; Accounting Entries -&gt; Spread Costs/Revenues, create a new spread board.</p>
<p>Complete the definition of the spreading criteria, by setting the the fields:</p> <p>Complete the definition of the spreading criteria, by setting the the fields:</p>
<ul class="simple"> <ul class="simple">
@ -414,21 +433,27 @@ the journals in which the spread journal items will be generated by default:</p>
<li><em>Journal</em></li> <li><em>Journal</em></li>
</ul> </ul>
<div class="figure"> <div class="figure">
<img alt="Create a new spread board" src="https://raw.githubusercontent.com/OCA/account-financial-tools/11.0/account_spread_cost_revenue/static/description/spread.png" /> <img alt="Create a new spread board" src="https://raw.githubusercontent.com/OCA/account-financial-tools/12.0/account_spread_cost_revenue/static/description/spread.png" />
</div> </div>
<p>Click on the button on the top-left to calculate the spread lines.</p> <p>Click on the button on the top-left to calculate the spread lines.</p>
<div class="figure"> <div class="figure">
<img alt="The spreading board is defined" src="https://raw.githubusercontent.com/OCA/account-financial-tools/11.0/account_spread_cost_revenue/static/description/create_spread.png" /> <img alt="The spreading board is defined" src="https://raw.githubusercontent.com/OCA/account-financial-tools/12.0/account_spread_cost_revenue/static/description/create_spread.png" />
</div> </div>
<p>A cron job will automatically create the accounting moves for all the lines having date previous that the current day (today).</p> <p>A cron job will automatically create the accounting moves for all the lines having date previous that the current day (today).</p>
<div class="figure"> <div class="figure">
<img alt="The spreading board is updated by the cron job" src="https://raw.githubusercontent.com/OCA/account-financial-tools/11.0/account_spread_cost_revenue/static/description/update_spread.png" /> <img alt="The spreading board is updated by the cron job" src="https://raw.githubusercontent.com/OCA/account-financial-tools/12.0/account_spread_cost_revenue/static/description/update_spread.png" />
</div> </div>
<p>By default, the status of the created accounting moves is unposted, so you should post them manually one by one. <p>By default, the status of the created accounting moves is posted.
To allow the automatic posting of the accounting moves, set the flag <em>Auto-post lines</em> to True.</p> To disable the automatic posting of the accounting moves, set the flag <em>Auto-post lines</em> to False.
This flag is only available when the <em>Auto-post spread lines</em> option, present on the form view of the company, is disabled.</p>
<p>Click on button <em>Recalculate entire spread</em> button in the spread board to force the recalculation of the spread lines:
this will also reset all the journal entries previously created.</p>
</div>
<div class="section" id="link-invoice-to-spread-costs-revenues-board">
<h2><a class="toc-backref" href="#id7">Link Invoice to Spread Costs/Revenues Board</a></h2>
<p>Create an invoice or vendor bill in draft. On its lines, the spreading right-arrow icon are displayed in dark-grey color.</p> <p>Create an invoice or vendor bill in draft. On its lines, the spreading right-arrow icon are displayed in dark-grey color.</p>
<div class="figure"> <div class="figure">
<img alt="On the invoice line the spreading icon is displayed" src="https://raw.githubusercontent.com/OCA/account-financial-tools/11.0/account_spread_cost_revenue/static/description/invoice_line_1.png" /> <img alt="On the invoice line the spreading icon is displayed" src="https://raw.githubusercontent.com/OCA/account-financial-tools/12.0/account_spread_cost_revenue/static/description/invoice_line_1.png" />
</div> </div>
<p>Click on the spreading right-arrow icon. A wizard prompts to enter a <em>Spread Action Type</em>:</p> <p>Click on the spreading right-arrow icon. A wizard prompts to enter a <em>Spread Action Type</em>:</p>
<ul class="simple"> <ul class="simple">
@ -441,52 +466,71 @@ the selected Spread Board will be automatically displayed.</p>
<p>Go back to the draft invoice/bill. The spreading functionality is now enabled on the invoice line: <p>Go back to the draft invoice/bill. The spreading functionality is now enabled on the invoice line:
the spreading right-arrow icon is now displayed in green color.</p> the spreading right-arrow icon is now displayed in green color.</p>
<div class="figure"> <div class="figure">
<img alt="On the invoice line the spreading icon is displayed in green color" src="https://raw.githubusercontent.com/OCA/account-financial-tools/11.0/account_spread_cost_revenue/static/description/invoice_line_2.png" /> <img alt="On the invoice line the spreading icon is displayed in green color" src="https://raw.githubusercontent.com/OCA/account-financial-tools/12.0/account_spread_cost_revenue/static/description/invoice_line_2.png" />
</div> </div>
<p>Validate the invoice/bill. Click on the spreading (green) right-arrow icon to open the spread board, then click <p>Validate the invoice/bill. Click on the spreading (green) right-arrow icon to open the spread board, then click
on the smart button <em>Reconciled entries</em>: the moves of the spread lines are reconciled with the move of the invoice line.</p> on the smart button <em>Reconciled entries</em>: the moves of the spread lines are reconciled with the move of the invoice line.</p>
<p>In case the Subtotal Price of the invoice line is different than the <em>Estimated Amount</em> of the spread board, the spread <p>In case the Subtotal Price of the invoice line is different than the <em>Estimated Amount</em> of the spread board, the spread
lines (not yet posted) will be recalculated when validating the invoice/bill.</p> lines (not yet posted) will be recalculated when validating the invoice/bill.</p>
<p>Click on button <em>Recalculate entire spread</em> button in the spread board to force the recalculation of the spread lines:
this will also reset all the journal entries previously created.</p>
</div> </div>
<div class="section" id="known-issues-roadmap"> <div class="section" id="define-spread-costs-revenues-template">
<h1><a class="toc-backref" href="#id3">Known issues / Roadmap</a></h1> <h2><a class="toc-backref" href="#id8">Define Spread Costs/Revenues Template</a></h2>
<p>Under Invoicing -&gt; Configuration -&gt; Accounting -&gt; Spread Templates, create a new spread template.</p>
<ul class="simple"> <ul class="simple">
<li>Verify last day of month</li> <li><em>Spread Type</em></li>
<li>Not yet compatible with cutoff module: create module for adaptation?</li> <li><em>Spread Balance Sheet Account</em></li>
<li><em>Journal</em></li>
</ul>
<p>When creating a new Spread Costs/Revenues Board, select the right template.
This way the above fields will be copied to the Spread Board.</p>
</div>
</div>
<div class="section" id="changelog">
<h1><a class="toc-backref" href="#id9">Changelog</a></h1>
<div class="section" id="id1">
<h2><a class="toc-backref" href="#id10">12.0.1.0.0</a></h2>
<ul class="simple">
<li>[MIG] Port account_spread_cost_revenue to V12.</li>
</ul> </ul>
</div> </div>
<div class="section" id="id2">
<h2><a class="toc-backref" href="#id11">11.0.1.0.0</a></h2>
<ul class="simple">
<li>[ADD] Module account_spread_cost_revenue.
(<a class="reference external" href="https://github.com/OCA/account-financial-tools/pull/715">#715</a>)</li>
</ul>
</div>
</div>
<div class="section" id="bug-tracker"> <div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#id4">Bug Tracker</a></h1> <h1><a class="toc-backref" href="#id12">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/account-financial-tools/issues">GitHub Issues</a>. <p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/account-financial-tools/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported. In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed If you spotted it first, help us smashing it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/account-financial-tools/issues/new?body=module:%20account_spread_cost_revenue%0Aversion:%2011.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p> <a class="reference external" href="https://github.com/OCA/account-financial-tools/issues/new?body=module:%20account_spread_cost_revenue%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p> <p>Do not contact contributors directly about support or help with technical issues.</p>
</div> </div>
<div class="section" id="credits"> <div class="section" id="credits">
<h1><a class="toc-backref" href="#id5">Credits</a></h1> <h1><a class="toc-backref" href="#id13">Credits</a></h1>
<div class="section" id="authors"> <div class="section" id="authors">
<h2><a class="toc-backref" href="#id6">Authors</a></h2> <h2><a class="toc-backref" href="#id14">Authors</a></h2>
<ul class="simple"> <ul class="simple">
<li>Onestein</li> <li>Onestein</li>
</ul> </ul>
</div> </div>
<div class="section" id="contributors"> <div class="section" id="contributors">
<h2><a class="toc-backref" href="#id7">Contributors</a></h2> <h2><a class="toc-backref" href="#id15">Contributors</a></h2>
<ul class="simple"> <ul class="simple">
<li>Andrea Stirpe &lt;<a class="reference external" href="mailto:a.stirpe&#64;onestein.nl">a.stirpe&#64;onestein.nl</a>&gt;</li> <li>Andrea Stirpe &lt;<a class="reference external" href="mailto:a.stirpe&#64;onestein.nl">a.stirpe&#64;onestein.nl</a>&gt;</li>
</ul> </ul>
</div> </div>
<div class="section" id="other-credits"> <div class="section" id="other-credits">
<h2><a class="toc-backref" href="#id8">Other credits</a></h2> <h2><a class="toc-backref" href="#id16">Other credits</a></h2>
<p>Part of the code in this module (in particular the computation of the spread lines) <p>Part of the code in this module (in particular the computation of the spread lines)
is highly inspired by the Assets Management module from the standard is highly inspired by the Assets Management module from the standard
Odoo 11.0 Community developed by Odoo SA.</p> Odoo 11.0 Community developed by Odoo SA.</p>
</div> </div>
<div class="section" id="maintainers"> <div class="section" id="maintainers">
<h2><a class="toc-backref" href="#id9">Maintainers</a></h2> <h2><a class="toc-backref" href="#id17">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p> <p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a> <a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose <p>OCA, or the Odoo Community Association, is a nonprofit organization whose
@ -494,7 +538,7 @@ mission is to support the collaborative development of Odoo features and
promote its widespread use.</p> promote its widespread use.</p>
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p> <p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
<p><a class="reference external" href="https://github.com/astirpe"><img alt="astirpe" src="https://github.com/astirpe.png?size=40px" /></a></p> <p><a class="reference external" href="https://github.com/astirpe"><img alt="astirpe" src="https://github.com/astirpe.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/account-financial-tools/tree/11.0/account_spread_cost_revenue">OCA/account-financial-tools</a> project on GitHub.</p> <p>This module is part of the <a class="reference external" href="https://github.com/OCA/account-financial-tools/tree/12.0/account_spread_cost_revenue">OCA/account-financial-tools</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p> <p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div> </div>
</div> </div>

View File

@ -4,7 +4,7 @@
import datetime import datetime
from odoo.tools import convert_file from odoo.tools import convert_file
from odoo.modules.module import get_module_resource from odoo.modules.module import get_resource_path
from odoo.exceptions import UserError, ValidationError from odoo.exceptions import UserError, ValidationError
from odoo.tests import common from odoo.tests import common
@ -15,7 +15,7 @@ class TestAccountInvoiceSpread(common.TransactionCase):
convert_file( convert_file(
self.cr, self.cr,
'account_spread_cost_revenue', 'account_spread_cost_revenue',
get_module_resource(module, *args), get_resource_path(module, *args),
{}, 'init', False, 'test', self.registry._assertion_report) {}, 'init', False, 'test', self.registry._assertion_report)
def setUp(self): def setUp(self):

View File

@ -6,7 +6,7 @@ import datetime
from psycopg2 import IntegrityError from psycopg2 import IntegrityError
from odoo.tools import convert_file, mute_logger from odoo.tools import convert_file, mute_logger
from odoo.modules.module import get_module_resource from odoo.modules.module import get_resource_path
from odoo.exceptions import ValidationError from odoo.exceptions import ValidationError
from odoo.tests import common from odoo.tests import common
@ -17,7 +17,7 @@ class TestAccountSpreadCostRevenue(common.TransactionCase):
convert_file( convert_file(
self.cr, self.cr,
'account_spread_cost_revenue', 'account_spread_cost_revenue',
get_module_resource(module, *args), get_resource_path(module, *args),
{}, 'init', False, 'test', self.registry._assertion_report) {}, 'init', False, 'test', self.registry._assertion_report)
def setUp(self): def setUp(self):

View File

@ -19,6 +19,12 @@
type="object" type="object"
string="Reconciled entries"> string="Reconciled entries">
</button> </button>
<button name="toggle_active" type="object"
attrs="{'invisible': [('all_posted','=',False)]}"
class="oe_stat_button" icon="fa-archive">
<field name="active" widget="boolean_button"
options='{"terminology": "archive"}'/>
</button>
</div> </div>
<div class="oe_title"> <div class="oe_title">
<label for="name" string="Spread Board Name"/> <label for="name" string="Spread Board Name"/>
@ -30,6 +36,7 @@
<field name="invoice_type" attrs="{'readonly':[('invoice_line_id','!=',False)]}"/> <field name="invoice_type" attrs="{'readonly':[('invoice_line_id','!=',False)]}"/>
<field name="display_recompute_buttons" invisible="1"/> <field name="display_recompute_buttons" invisible="1"/>
<field name="display_move_line_auto_post" invisible="1"/> <field name="display_move_line_auto_post" invisible="1"/>
<field name="all_posted" invisible="1"/>
</group> </group>
</group> </group>
<group name="accounts"> <group name="accounts">
@ -167,6 +174,15 @@
</field> </field>
</record> </record>
<record id="view_account_spread_search" model="ir.ui.view">
<field name="model">account.spread</field>
<field name="arch" type="xml">
<search>
<filter string="Archived" name="inactive" domain="[('active','=',False)]"/>
</search>
</field>
</record>
<record id="action_account_spread_form" model="ir.actions.act_window"> <record id="action_account_spread_form" model="ir.actions.act_window">
<field name="name">Spread Costs/Revenues</field> <field name="name">Spread Costs/Revenues</field>
<field name="res_model">account.spread</field> <field name="res_model">account.spread</field>

View File

@ -23,6 +23,7 @@
</group> </group>
<group name="spreading_options_right"> <group name="spreading_options_right">
<field name="force_move_auto_post"/> <field name="force_move_auto_post"/>
<field name="auto_archive"/>
</group> </group>
</group> </group>
</page> </page>