Browse Source

[MIG] account_bank_statement_import_move_line: Migration to v12

12.0
Victor M.M. Torres 5 years ago
committed by Pedro M. Baeza
parent
commit
dc40c9cb1b
  1. 36
      account_bank_statement_import_move_line/README.rst
  2. 4
      account_bank_statement_import_move_line/__manifest__.py
  3. 1
      account_bank_statement_import_move_line/models/account_move_line.py
  4. 5
      account_bank_statement_import_move_line/readme/CONFIGURE.rst
  5. 5
      account_bank_statement_import_move_line/readme/CONTRIBUTORS.rst
  6. 48
      account_bank_statement_import_move_line/static/description/index.html
  7. 3
      account_bank_statement_import_move_line/views/account_bank_statement_view.xml
  8. 20
      account_bank_statement_import_move_line/wizards/account_statement_line_create.py
  9. 2
      account_bank_statement_import_move_line/wizards/account_statement_line_create_view.xml

36
account_bank_statement_import_move_line/README.rst

@ -7,20 +7,20 @@ Bank statement import move lines
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
:alt: Production/Stable
.. |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
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fbank--statement--import-lightgray.png?logo=github
:target: https://github.com/OCA/bank-statement-import/tree/11.0/account_bank_statement_import_move_line
:target: https://github.com/OCA/bank-statement-import/tree/12.0/account_bank_statement_import_move_line
:alt: OCA/bank-statement-import
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/bank-statement-import-11-0/bank-statement-import-11-0-account_bank_statement_import_move_line
:target: https://translation.odoo-community.org/projects/bank-statement-import-12-0/bank-statement-import-12-0-account_bank_statement_import_move_line
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/174/11.0
:target: https://runbot.odoo-community.org/runbot/174/12.0
:alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5|
@ -34,6 +34,15 @@ statement.
.. contents::
:local:
Configuration
=============
To configure this module, you need to:
#. Go to *Settings > Users & Companies > Users*.
#. Open the user that needs to use this feature.
#. Mark the check *Show Full Accounting Features*.
Usage
=====
@ -52,7 +61,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/bank-statement-import/issues>`_.
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
`feedback <https://github.com/OCA/bank-statement-import/issues/new?body=module:%20account_bank_statement_import_move_line%0Aversion:%2011.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/bank-statement-import/issues/new?body=module:%20account_bank_statement_import_move_line%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.
@ -67,7 +76,10 @@ Authors
Contributors
~~~~~~~~~~~~
* Luis M. Ontalba luis.martinez@tecnativa.com>
* `Tecnativa <https://www.tecnativa.com>`_:
* Luis M. Ontalba
* Victor M.M. Torres
Maintainers
~~~~~~~~~~~
@ -82,6 +94,14 @@ 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.
This module is part of the `OCA/bank-statement-import <https://github.com/OCA/bank-statement-import/tree/11.0/account_bank_statement_import_move_line>`_ project on GitHub.
.. |maintainer-pedrobaeza| image:: https://github.com/pedrobaeza.png?size=40px
:target: https://github.com/pedrobaeza
:alt: pedrobaeza
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
|maintainer-pedrobaeza|
This module is part of the `OCA/bank-statement-import <https://github.com/OCA/bank-statement-import/tree/12.0/account_bank_statement_import_move_line>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

4
account_bank_statement_import_move_line/__manifest__.py

@ -3,11 +3,12 @@
{
'name': 'Bank statement import move lines',
'version': '11.0.1.0.0',
'version': '12.0.1.0.0',
'category': 'Accounting',
'summary': 'Import journal items into bank statement',
'author': 'Tecnativa, '
'Odoo Community Association (OCA)',
'maintainers': ['pedrobaeza'],
'website': 'https://www.tecnativa.com',
'depends': [
'account',
@ -17,6 +18,7 @@
'views/account_bank_statement_view.xml',
],
'license': 'AGPL-3',
'development_status': 'Production/Stable',
'installable': True,
'auto_install': False,
}

1
account_bank_statement_import_move_line/models/account_move_line.py

@ -10,7 +10,6 @@ class AccountMoveLine(models.Model):
@api.multi
def _prepare_statement_line_vals(self, statement):
self.ensure_one()
assert statement, 'Missing statement'
amount = 0.0
if self.debit > 0:
amount = self.debit

5
account_bank_statement_import_move_line/readme/CONFIGURE.rst

@ -0,0 +1,5 @@
To configure this module, you need to:
#. Go to *Settings > Users & Companies > Users*.
#. Open the user that needs to use this feature.
#. Mark the check *Show Full Accounting Features*.

5
account_bank_statement_import_move_line/readme/CONTRIBUTORS.rst

@ -1 +1,4 @@
* Luis M. Ontalba luis.martinez@tecnativa.com>
* `Tecnativa <https://www.tecnativa.com>`_:
* Luis M. Ontalba
* Victor M.M. Torres

48
account_bank_statement_import_move_line/static/description/index.html

@ -367,25 +367,35 @@ ul.auto-toc {
!! This file is generated by oca-gen-addon-readme !!
!! 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/bank-statement-import/tree/11.0/account_bank_statement_import_move_line"><img alt="OCA/bank-statement-import" src="https://img.shields.io/badge/github-OCA%2Fbank--statement--import-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/bank-statement-import-11-0/bank-statement-import-11-0-account_bank_statement_import_move_line"><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/174/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="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.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/bank-statement-import/tree/12.0/account_bank_statement_import_move_line"><img alt="OCA/bank-statement-import" src="https://img.shields.io/badge/github-OCA%2Fbank--statement--import-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/bank-statement-import-12-0/bank-statement-import-12-0-account_bank_statement_import_move_line"><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/174/12.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>This module adds a button to bank statement form view to open a wizard to allow
filtering, selecting and importing lines form journal items into the bank
statement.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#usage" id="id1">Usage</a></li>
<li><a class="reference internal" href="#bug-tracker" id="id2">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="id3">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="id4">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="id5">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="id6">Maintainers</a></li>
<li><a class="reference internal" href="#configuration" id="id1">Configuration</a></li>
<li><a class="reference internal" href="#usage" id="id2">Usage</a></li>
<li><a class="reference internal" href="#bug-tracker" id="id3">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="id4">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="id5">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="id6">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="id7">Maintainers</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="configuration">
<h1><a class="toc-backref" href="#id1">Configuration</a></h1>
<p>To configure this module, you need to:</p>
<ol class="arabic simple">
<li>Go to <em>Settings &gt; Users &amp; Companies &gt; Users</em>.</li>
<li>Open the user that needs to use this feature.</li>
<li>Mark the check <em>Show Full Accounting Features</em>.</li>
</ol>
</div>
<div class="section" id="usage">
<h1><a class="toc-backref" href="#id1">Usage</a></h1>
<h1><a class="toc-backref" href="#id2">Usage</a></h1>
<ol class="arabic simple">
<li>Go to Invoicing &gt; Dashboard.</li>
<li>Create a new bank statement from a bank journal.</li>
@ -398,35 +408,41 @@ lines filtered by the criteria.</li>
</ol>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#id2">Bug Tracker</a></h1>
<h1><a class="toc-backref" href="#id3">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/bank-statement-import/issues">GitHub Issues</a>.
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
<a class="reference external" href="https://github.com/OCA/bank-statement-import/issues/new?body=module:%20account_bank_statement_import_move_line%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/bank-statement-import/issues/new?body=module:%20account_bank_statement_import_move_line%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>
</div>
<div class="section" id="credits">
<h1><a class="toc-backref" href="#id3">Credits</a></h1>
<h1><a class="toc-backref" href="#id4">Credits</a></h1>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#id4">Authors</a></h2>
<h2><a class="toc-backref" href="#id5">Authors</a></h2>
<ul class="simple">
<li>Tecnativa</li>
</ul>
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#id5">Contributors</a></h2>
<h2><a class="toc-backref" href="#id6">Contributors</a></h2>
<ul class="simple">
<li>Luis M. Ontalba <a class="reference external" href="mailto:luis.martinez&#64;tecnativa.com">luis.martinez&#64;tecnativa.com</a>&gt;</li>
<li><a class="reference external" href="https://www.tecnativa.com">Tecnativa</a>:<ul>
<li>Luis M. Ontalba</li>
<li>Victor M.M. Torres</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#id6">Maintainers</a></h2>
<h2><a class="toc-backref" href="#id7">Maintainers</a></h2>
<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>
<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>This module is part of the <a class="reference external" href="https://github.com/OCA/bank-statement-import/tree/11.0/account_bank_statement_import_move_line">OCA/bank-statement-import</a> project on GitHub.</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/pedrobaeza"><img alt="pedrobaeza" src="https://github.com/pedrobaeza.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/bank-statement-import/tree/12.0/account_bank_statement_import_move_line">OCA/bank-statement-import</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>
</div>

3
account_bank_statement_import_move_line/views/account_bank_statement_view.xml

@ -11,7 +11,8 @@
<button name="%(account_statement_line_create_action)d"
string="Import Journal Items" type="action"
class="oe_highlight"
attrs="{'invisible':[('state', '!=', 'open')]}"/>
attrs="{'invisible':[('state', '!=', 'open')]}"
groups="account.group_account_user"/>
</field>
</field>
</record>

20
account_bank_statement_import_move_line/wizards/account_statement_line_create.py

@ -36,13 +36,12 @@ class AccountStatementLineCreate(models.TransientModel):
@api.model
def default_get(self, field_list):
res = super(AccountStatementLineCreate, self).default_get(field_list)
context = self.env.context
assert context.get('active_model') == 'account.bank.statement',\
'active_model should be account.bank.statement'
assert context.get('active_id'), 'Missing active_id in context !'
statement = self.env[
'account.bank.statement'].browse(context['active_id'])
res = super().default_get(field_list)
active_model = self.env.context.get('active_model')
if active_model == 'account.bank.statement':
statement = self.env[active_model].browse(
self.env.context.get('active_id')).exists()
if statement:
res.update({
'target_move': 'posted',
'date_type': 'due',
@ -112,7 +111,8 @@ class AccountStatementLineCreate(models.TransientModel):
@api.multi
def create_statement_lines(self):
if self.move_line_ids:
self.move_line_ids.create_statement_line_from_move_line(
self.statement_id)
for rec in self:
if rec.move_line_ids and rec.statement_id:
rec.move_line_ids.create_statement_line_from_move_line(
rec.statement_id)
return True

2
account_bank_statement_import_move_line/wizards/account_statement_line_create_view.xml

@ -21,7 +21,7 @@
<field name="target_move" widget="radio"/>
<field name="invoice"/>
<field name="allow_blocked"/>
<label string="Click on Add All Move Lines to auto-select the move lines matching the above criteria or click on Add an item to manually select the move lines filtered by the above criteria." colspan="2"/>
<label for="populate" string="Click on Add All Move Lines to auto-select the move lines matching the above criteria or click on Add an item to manually select the move lines filtered by the above criteria." colspan="2"/>
<button name="populate" type="object" string="Add All Move Lines"/>
</group>
<group name="move_lines"

Loading…
Cancel
Save