Skip to content

Commit

Permalink
update menu entries, small fixes and updated readme structure.
Browse files Browse the repository at this point in the history
  • Loading branch information
JordiBForgeFlow authored and Abranes committed Jun 5, 2023
1 parent cac3692 commit af3f17e
Show file tree
Hide file tree
Showing 10 changed files with 43 additions and 97 deletions.
66 changes: 0 additions & 66 deletions account_move_template/README.rst

This file was deleted.

3 changes: 0 additions & 3 deletions account_move_template/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
# Copyright 2015-2017 See manifest
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html

from . import models
from . import wizard
3 changes: 0 additions & 3 deletions account_move_template/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
# Copyright 2015-2017 See manifest
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html

from . import account_document_template
from . import account_move_template
15 changes: 15 additions & 0 deletions account_move_template/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Authors
-------

* Davide Corio <[email protected]>
* Lorenzo Battistini <[email protected]>
* Paolo Chiara <[email protected]>
* Franco Tampieri <[email protected]>

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

* Jalal ZAHID <[email protected]> (port to v10)
* Alex Comba <[email protected]> (Port to V8)
* Guewen Baconnier <[email protected]>
* Raf Ven <[email protected]> (port to v11)
9 changes: 9 additions & 0 deletions account_move_template/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
The user can configure journal entries templates, useful for recurring entries.
The amount of each template line can be computed (through python code)
or kept as user input.

If user input, when using the template, user has to fill
the amount of every input lines.

The journal entry form allows lo load, through a wizard,
the template to use and the amounts to fill.
13 changes: 13 additions & 0 deletions account_move_template/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
To create new templates:

#. Make sure that you have flagged *Show Full Accounting Features* in your
user, and that the user has belongs to the *Billing Manager* group.
#. Go to *Invoicing / Configuration / Accounting / Journal Templates* and
define there your template. You can choose to complete a line using a
defined formula, based on other lines, or by requiring the user input.

To use an existing template:

#. Go to *Invoicing / Adviser / Accounting Entries / Create Journal Entry from Template*
#. Select one of the available templates and optionally a partner.
#. Complete the entries according to the template and press *Load*
4 changes: 2 additions & 2 deletions account_move_template/view/move_template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
</record>

<record id="action_move_template_form" model="ir.actions.act_window">
<field name="name">Move Templates</field>
<field name="name">Journal Entry Templates</field>
<field name="res_model">account.move.template</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
Expand All @@ -115,6 +115,6 @@
<menuitem
action="action_move_template_form"
id="menu_action_move_template_form" sequence="300"
parent="account.menu_finance_configuration"
parent="account.account_account_menu"
groups="account.group_account_manager"/>
</odoo>
19 changes: 0 additions & 19 deletions account_move_template/wizard/__init__.py
Original file line number Diff line number Diff line change
@@ -1,20 +1 @@
##############################################################################
#
# Copyright (C) 2011 Agile Business Group sagl (<http://www.agilebg.com>)
# Copyright (C) 2011 Domsense srl (<http://www.domsense.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from . import select_template
6 changes: 3 additions & 3 deletions account_move_template/wizard/select_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html

import time
from odoo import models, fields, api
from odoo import models, fields, api, _


class WizardSelectMoveTemplate(models.TransientModel):
Expand Down Expand Up @@ -64,7 +64,7 @@ def load_template(self):
move.write({'line_ids': lines})
return {
'domain': [('id', 'in', moves.ids)],
'name': 'Entries from template: %s' % name,
'name': _('Entries from template: %s') % name,
'view_type': 'form',
'view_mode': 'tree,form',
'res_model': 'account.move',
Expand All @@ -88,7 +88,7 @@ def _prepare_line(self, line, amounts, partner_id):
'journal_id': line.journal_id.id,
'analytic_account_id': line.analytic_account_id.id,
'account_id': line.account_id.id,
'date': time.strftime('%Y-%m-%d'),
'date': fields.Date.today(),
'credit': not debit and amounts[line.sequence] or 0.0,
'debit': debit and amounts[line.sequence] or 0.0,
'partner_id': partner_id,
Expand Down
2 changes: 1 addition & 1 deletion account_move_template/wizard/select_template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,5 @@
id="action_wizard_select_template_by_move"
view_id="wizard_select_template"/>

<menuitem name="Create Move from Template" action="action_wizard_select_template" id="menu_action_wizard_select_template" sequence="10" parent="account.menu_finance_entries"/>
<menuitem name="Create Journal Entry from Template" action="action_wizard_select_template" id="menu_action_wizard_select_template" sequence="10" parent="account.menu_finance_entries_accounting_entries"/>
</odoo>

0 comments on commit af3f17e

Please sign in to comment.