-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ADD] ssi_account_journal_m2o_configurator_mixin
- Loading branch information
Showing
7 changed files
with
146 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg | ||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html | ||
:alt: License: AGPL-3 | ||
|
||
=========================================== | ||
account.journal Many2one Configurator Mixin | ||
=========================================== | ||
|
||
|
||
Installation | ||
============ | ||
|
||
To install this module, you need to: | ||
|
||
1. Clone the branch 14.0 of the repository https://github.com/open-synergy/ssi-financial-accounting | ||
2. Add the path to this repository in your configuration (addons-path) | ||
3. Update the module list (Must be on developer mode) | ||
4. Go to menu *Apps -> Apps -> Main Apps* | ||
5. Search For *account.journal Many2one Configurator Mixin* | ||
6. Install the module | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues | ||
<https://github.com/open-synergy/ssi-financial-accounting/issues>`_. In case of trouble, please | ||
check there if your issue has already been reported. If you spotted it first, | ||
help us smash it by providing detailed and welcomed feedback. | ||
|
||
|
||
Credits | ||
======= | ||
|
||
Contributors | ||
------------ | ||
|
||
* Andhitia Rama <andhitia.r@gmail.com> | ||
|
||
Maintainer | ||
---------- | ||
|
||
.. image:: https://simetri-sinergi.id/logo.png | ||
:alt: PT. Simetri Sinergi Indonesia | ||
:target: https://simetri-sinergi.id | ||
|
||
This module is maintained by the PT. Simetri Sinergi Indonesia. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Copyright 2022 OpenSynergy Indonesia | ||
# Copyright 2022 PT. Simetri Sinergi Indonesia | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from . import ( | ||
models, | ||
) |
16 changes: 16 additions & 0 deletions
16
ssi_account_journal_m2o_configurator_mixin/__manifest__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Copyright 2023 OpenSynergy Indonesia | ||
# Copyright 2023 PT. Simetri Sinergi Indonesia | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
{ | ||
"name": "account.journal Many2one Configurator Mixin", | ||
"version": "14.0.1.0.0", | ||
"website": "https://simetri-sinergi.id", | ||
"author": "OpenSynergy Indonesia, PT. Simetri Sinergi Indonesia", | ||
"license": "AGPL-3", | ||
"installable": True, | ||
"depends": ["account", "ssi_decorator"], | ||
"data": [ | ||
"templates/account_journal_m2_configurator_templates.xml", | ||
], | ||
} |
7 changes: 7 additions & 0 deletions
7
ssi_account_journal_m2o_configurator_mixin/models/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Copyright 2022 OpenSynergy Indonesia | ||
# Copyright 2022 PT. Simetri Sinergi Indonesia | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from . import ( | ||
mixin_account_journal_m2o_configurator, | ||
) |
47 changes: 47 additions & 0 deletions
47
ssi_account_journal_m2o_configurator_mixin/models/mixin_account_journal_m2o_configurator.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Copyright 2022 OpenSynergy Indonesia | ||
# Copyright 2022 PT. Simetri Sinergi Indonesia | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import fields, models | ||
|
||
from odoo.addons.ssi_decorator import ssi_decorator | ||
|
||
|
||
class MixinAccountJournalM2OConfigurator(models.AbstractModel): | ||
_name = "mixin.account_journal_m2o_configurator" | ||
_inherit = [ | ||
"mixin.decorator", | ||
] | ||
_description = "account.journal Many2one Configurator Mixin" | ||
|
||
_account_journal_m2o_configurator_insert_form_element_ok = False | ||
_account_journal_m2o_configurator_form_xpath = False | ||
|
||
journal_selection_method = fields.Selection( | ||
default="domain", | ||
selection=[("manual", "Manual"), ("domain", "Domain"), ("code", "Python Code")], | ||
string="Journal Selection Method", | ||
required=True, | ||
) | ||
journal_ids = fields.Many2many( | ||
comodel_name="account.journal", | ||
string="Journals", | ||
) | ||
journal_domain = fields.Text(default="[]", string="Journal Domain") | ||
journal_python_code = fields.Text( | ||
default="result = []", string="Journal Python Code" | ||
) | ||
|
||
@ssi_decorator.insert_on_form_view() | ||
def _account_journal_m2o_configurator_insert_form_element(self, view_arch): | ||
# TODO | ||
template_xml = "ssi_account_journal_m2o_configurator_mixin." | ||
template_xml += "account_journal_m2o_configurator_template" | ||
if self._account_journal_m2o_configurator_insert_form_element_ok: | ||
view_arch = self._add_view_element( | ||
view_arch=view_arch, | ||
qweb_template_xml_id=template_xml, | ||
xpath=self._account_journal_m2o_configurator_form_xpath, | ||
position="inside", | ||
) | ||
return view_arch |
Binary file added
BIN
+47.2 KB
ssi_account_journal_m2o_configurator_mixin/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions
23
...nt_journal_m2o_configurator_mixin/templates/account_journal_m2_configurator_templates.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<odoo> | ||
<template id="account_journal_m2o_configurator_template"> | ||
<group name="journal_1" col="2" colspan="4" string="Journal"> | ||
<field name="journal_selection_method" /> | ||
<field | ||
name="journal_ids" | ||
attrs="{'invisible':[('journal_selection_method','!=','manual')]}" | ||
/> | ||
<field | ||
name="journal_domain" | ||
widget="domain" | ||
options="{'model': 'account.journal', 'in_dialog': True}" | ||
attrs="{'invisible':[('journal_selection_method','!=','domain')]}" | ||
/> | ||
<field | ||
name="journal_python_code" | ||
widget="ace" | ||
attrs="{'invisible':[('journal_selection_method','!=','code')]}" | ||
/> | ||
</group> | ||
</template> | ||
</odoo> |