Skip to content

Commit

Permalink
[MIG] account_cutoff_base: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
thaolt99 committed Nov 28, 2023
1 parent cb8bb10 commit 9a31f79
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 44 deletions.
19 changes: 6 additions & 13 deletions account_cutoff_base/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ Account Cut-off Base
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:067c3a39abe7ad82a6363f9758669477eb84956bc7f6d793591d9501a39a1c85
!! source digest: sha256:8594085b2ee485fa468f0048cf1a7c979b49a57ff8c96c5c60960d949c73c3d7
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge2| image:: https://img.shields.io/badge/licence-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%2Faccount--closing-lightgray.png?logo=github
:target: https://github.com/OCA/account-closing/tree/17.0/account_cutoff_base
:alt: OCA/account-closing
Expand Down Expand Up @@ -100,11 +100,12 @@ Contributors
- `Trobz <https://trobz.com>`__:

- Dzung Tran <dungtd@trobz.com>
- Thao Le thaolt@trobz.com

Other credits
-------------

The migration of this module from 15.0 to 16.0 was financially supported
The migration of this module from 16.0 to 17.0 was financially supported
by Camptocamp

Maintainers
Expand All @@ -120,14 +121,6 @@ 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-alexis-via| image:: https://github.com/alexis-via.png?size=40px
:target: https://github.com/alexis-via
:alt: alexis-via

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

|maintainer-alexis-via|

This module is part of the `OCA/account-closing <https://github.com/OCA/account-closing/tree/17.0/account_cutoff_base>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
6 changes: 3 additions & 3 deletions account_cutoff_base/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@

{
"name": "Account Cut-off Base",
"version": "16.0.1.3.0",
"version": "17.0.1.0.0",
"category": "Accounting & Finance",
"license": "AGPL-3",
"summary": "Base module for Account Cut-offs",
"author": "Akretion,Odoo Community Association (OCA)",
"maintainers": ["alexis-via"],
"maintainer": "alexis-via",
"website": "https://github.com/OCA/account-closing",
"depends": ["account"],
"data": [
Expand All @@ -23,4 +22,5 @@
"views/account_tax.xml",
],
"installable": True,
"license": "LGPL-3",
}
9 changes: 0 additions & 9 deletions account_cutoff_base/models/account_cutoff.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ def _default_cutoff_account_id(self):

cutoff_date = fields.Date(
string="Cut-off Date",
states={"done": [("readonly", True)]},
copy=False,
tracking=True,
default=lambda self: self._default_cutoff_date(),
Expand All @@ -92,14 +91,12 @@ def _default_cutoff_account_id(self):
selection="_selection_cutoff_type",
string="Type",
required=True,
states={"done": [("readonly", True)]},
)
source_move_state = fields.Selection(
[("posted", "Posted Entries"), ("draft_posted", "Draft and Posted Entries")],
string="Source Entries",
required=True,
default="posted",
states={"done": [("readonly", True)]},
tracking=True,
)
move_id = fields.Many2one(
Expand All @@ -111,20 +108,17 @@ def _default_cutoff_account_id(self):
)
move_ref = fields.Char(
string="Reference of the Cut-off Journal Entry",
states={"done": [("readonly", True)]},
default=lambda self: self._default_move_ref(),
)
move_partner = fields.Boolean(
string="Partner on Journal Items",
default=lambda self: self.env.company.default_cutoff_move_partner,
states={"done": [("readonly", True)]},
tracking=True,
)
cutoff_account_id = fields.Many2one(
comodel_name="account.account",
string="Cut-off Account",
domain="[('deprecated', '=', False), ('company_id', '=', company_id)]",
states={"done": [("readonly", True)]},
default=lambda self: self._default_cutoff_account_id(),
check_company=True,
tracking=True,
Expand All @@ -133,7 +127,6 @@ def _default_cutoff_account_id(self):
comodel_name="account.journal",
string="Cut-off Account Journal",
default=lambda self: self.env.company.default_cutoff_journal_id,
states={"done": [("readonly", True)]},
domain="[('company_id', '=', company_id)]",
check_company=True,
tracking=True,
Expand All @@ -148,7 +141,6 @@ def _default_cutoff_account_id(self):
"res.company",
string="Company",
required=True,
states={"done": [("readonly", True)]},
default=lambda self: self.env.company,
)
company_currency_id = fields.Many2one(
Expand All @@ -158,7 +150,6 @@ def _default_cutoff_account_id(self):
comodel_name="account.cutoff.line",
inverse_name="parent_id",
string="Cut-off Lines",
states={"done": [("readonly", True)]},
)
state = fields.Selection(
selection=[("draft", "Draft"), ("done", "Done")],
Expand Down
1 change: 1 addition & 0 deletions account_cutoff_base/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@

- [Trobz](https://trobz.com):
- Dzung Tran \<<dungtd@trobz.com>\>
- Thao Le <thaolt@trobz.com>
2 changes: 1 addition & 1 deletion account_cutoff_base/readme/CREDITS.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
The migration of this module from 15.0 to 16.0 was financially supported
The migration of this module from 16.0 to 17.0 was financially supported
by Camptocamp
9 changes: 4 additions & 5 deletions account_cutoff_base/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,9 +367,9 @@ <h1 class="title">Account Cut-off Base</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:067c3a39abe7ad82a6363f9758669477eb84956bc7f6d793591d9501a39a1c85
!! source digest: sha256:8594085b2ee485fa468f0048cf1a7c979b49a57ff8c96c5c60960d949c73c3d7
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" 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 image-reference" 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 image-reference" href="https://github.com/OCA/account-closing/tree/17.0/account_cutoff_base"><img alt="OCA/account-closing" src="https://img.shields.io/badge/github-OCA%2Faccount--closing-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/account-closing-17-0/account-closing-17-0-account_cutoff_base"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/account-closing&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external image-reference" 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 image-reference" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/account-closing/tree/17.0/account_cutoff_base"><img alt="OCA/account-closing" src="https://img.shields.io/badge/github-OCA%2Faccount--closing-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/account-closing-17-0/account-closing-17-0-account_cutoff_base"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/account-closing&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module contains the technical basis for other cut-off modules ; it
doesn’t provide useful features by itself. You need to install other
cut-off modules to get the useful features:</p>
Expand Down Expand Up @@ -440,13 +440,14 @@ <h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
<li>Jim Hoefnagels &lt;<a class="reference external" href="mailto:jim.hoefnagels&#64;dynapps.be">jim.hoefnagels&#64;dynapps.be</a>&gt;</li>
<li><a class="reference external" href="https://trobz.com">Trobz</a>:<ul>
<li>Dzung Tran &lt;<a class="reference external" href="mailto:dungtd&#64;trobz.com">dungtd&#64;trobz.com</a>&gt;</li>
<li>Thao Le <a class="reference external" href="mailto:thaolt&#64;trobz.com">thaolt&#64;trobz.com</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="other-credits">
<h2><a class="toc-backref" href="#toc-entry-7">Other credits</a></h2>
<p>The migration of this module from 15.0 to 16.0 was financially supported
<p>The migration of this module from 16.0 to 17.0 was financially supported
by Camptocamp</p>
</div>
<div class="section" id="maintainers">
Expand All @@ -456,8 +457,6 @@ <h2><a class="toc-backref" href="#toc-entry-8">Maintainers</a></h2>
<p>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.</p>
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
<p><a class="reference external image-reference" href="https://github.com/alexis-via"><img alt="alexis-via" src="https://github.com/alexis-via.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/account-closing/tree/17.0/account_cutoff_base">OCA/account-closing</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>
</div>
Expand Down
27 changes: 20 additions & 7 deletions account_cutoff_base/views/account_cutoff.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,22 @@
name="back2draft"
string="Back to Draft"
type="object"
states="done"
invisible="state != 'done'"
confirm="Are you sure you want to go back to draft state?"
/>
<button
class="btn-primary"
name="get_lines"
string="Re-Generate Lines"
type="object"
states="draft"
invisible="state != 'draft'"
/>
<button
class="btn-primary"
name="create_move"
string="Create Journal Entry"
type="object"
attrs="{'invisible': ['|', ('line_ids', '=', []), ('state', '!=', 'draft')]}"
invisible="line_ids == [] or state != 'draft'"
/>
<field name="state" widget="statusbar" />
</header>
Expand Down Expand Up @@ -65,25 +65,36 @@
<field
name="cutoff_date"
options="{'datepicker': {'warn_future': true}}"
readonly="state == 'done'"
/>
<field name="total_cutoff_amount" />
<field name="source_move_state" widget="radio" />
<field name="company_id" options="{'no_create': True}" />
<field
name="source_move_state"
widget="radio"
invisible="state != 'done'"
/>
<field
name="company_id"
options="{'no_create': True}"
readonly="state == 'done'"
/>
<field name="company_currency_id" invisible="1" />
</group>
<group name="accounting-params">
<field
name="cutoff_journal_id"
required="1"
options="{'no_create': True}"
readonly="state == 'done'"
/>
<field
name="cutoff_account_id"
required="1"
options="{'no_create': True}"
readonly="state == 'done'"
/>
<field name="move_ref" />
<field name="move_partner" />
<field name="move_ref" readonly="state == 'done'" />
<field name="move_partner" readonly="state == 'done'" />
<field name="move_id" />
</group>
</group>
Expand All @@ -93,6 +104,7 @@
nolabel="1"
colspan="2"
context="{'cutoff_type': cutoff_type}"
readonly="state == 'done'"
/>
</group>
</sheet>
Expand All @@ -111,6 +123,7 @@
<tree>
<field
name="cutoff_type"
readonly="state == 'done'"
invisible="context.get('default_cutoff_type')"
/>
<field name="cutoff_date" decoration-bf="1" />
Expand Down
2 changes: 1 addition & 1 deletion account_cutoff_base/views/account_cutoff_line.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<group
name="tax"
string="Cut-off Taxes Lines"
attrs="{'invisible': [('cutoff_type', 'not in', ('accrued_expense', 'accrued_revenue'))]}"
invisible="cutoff_type not in ('accrued_expense', 'accrued_revenue')"
>
<field name="tax_line_ids" nolabel="1" colspan="2" />
</group>
Expand Down
4 changes: 2 additions & 2 deletions account_cutoff_base/views/account_tax.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
<field name="tax_group_id" position="after">
<field
name="account_accrued_revenue_id"
attrs="{'invisible': [('type_tax_use', '=', 'purchase')]}"
invisible="type_tax_use == 'purchase'"
options="{'no_create': True}"
/>
<field
name="account_accrued_expense_id"
attrs="{'invisible': [('type_tax_use', '=', 'sale')]}"
invisible="type_tax_use == 'sale'"
options="{'no_create': True}"
/>
</field>
Expand Down
6 changes: 3 additions & 3 deletions account_cutoff_base/views/res_config_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<field name="model">res.config.settings</field>
<field name="inherit_id" ref="account.res_config_settings_view_form" />
<field name="arch" type="xml">
<xpath expr="//div[@id='accounting_reports']" position="after">
<xpath expr="//block[@id='accounting_reports']" position="after">
<h2>Cut-offs</h2>
<div class="row mt16 o_settings_container" id="cutoff">
<div
Expand Down Expand Up @@ -83,7 +83,7 @@
<div
class="row"
id="dft_accrued_revenue_tax_account_id"
attrs="{'invisible': [('accrual_taxes', '=', False)]}"
invisible="accrual_taxes == False"
>
<label
for="dft_accrued_revenue_tax_account_id"
Expand All @@ -97,7 +97,7 @@
<div
class="row"
id="dft_accrued_expense_tax_account_id"
attrs="{'invisible': [('accrual_taxes', '=', False)]}"
invisible="accrual_taxes == False"
>
<label
for="dft_accrued_expense_tax_account_id"
Expand Down

0 comments on commit 9a31f79

Please sign in to comment.