Skip to content

Commit

Permalink
Merge PR #20 into 14.0
Browse files Browse the repository at this point in the history
Signed-off-by andhit-r
  • Loading branch information
ssi-bot committed Oct 4, 2024
2 parents 78b2f78 + 55fac7b commit 895d158
Show file tree
Hide file tree
Showing 9 changed files with 173 additions and 0 deletions.
48 changes: 48 additions & 0 deletions ssi_partner_company_capital/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
.. 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

===========================
Company Capital Information
===========================


Installation
============

To install this module, you need to:

1. Clone the branch 14.0 of the repository https://github.com/open-synergy/ssi-partner
2. Add the path to this repository in your configuration (addons-path)
3. Update the module list
4. Go to menu *Setting -> Modules -> Local Modules*
5. Search For *Company Capital Information*
6. Install the module

Bug Tracker
===========

Bugs are tracked on `GitHub Issues
<https://github.com/open-synergy/ssi-partner/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.


Credits
=======

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

* Michael Viriyananda <viriyananda.michael@gmail.com>
* Andhitia Rama <andhitia.r@gmail.com>

Maintainer
----------

.. image:: https://simetri-sinergi.id/logo.png
:alt: PT. Simetri Sinergi Indonesia
:target: https://simetri-sinergi.id.com

This module is maintained by the PT. Simetri Sinergi Indonesia.
5 changes: 5 additions & 0 deletions ssi_partner_company_capital/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright 2024 OpenSynergy Indonesia
# Copyright 2024 PT. Simetri Sinergi Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import models
21 changes: 21 additions & 0 deletions ssi_partner_company_capital/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2023 OpenSynergy Indonesia
# Copyright 2023 PT. Simetri Sinergi Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Company Capital Information",
"version": "14.0.1.0.0",
"website": "https://simetri-sinergi.id",
"author": "PT. Simetri Sinergi Indonesia, OpenSynergy Indonesia",
"license": "AGPL-3",
"installable": True,
"application": False,
"depends": [
"ssi_master_data_mixin",
"ssi_partner",
],
"data": [
"security/ir.model.access.csv",
"views/res_partner_views.xml",
],
"demo": [],
}
8 changes: 8 additions & 0 deletions ssi_partner_company_capital/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copyright 2024 OpenSynergy Indonesia
# Copyright 2024 PT. Simetri Sinergi Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import (
res_partner,
company_shareholder,
)
33 changes: 33 additions & 0 deletions ssi_partner_company_capital/models/company_shareholder.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright 2023 OpenSynergy Indonesia
# Copyright 2023 PT. Simetri Sinergi Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import fields, models


class CompanyShareholder(models.Model):
_name = "company.shareholder"
_description = "Company Shareholder"
_order = "partner_id, sequence, id"

partner_id = fields.Many2one(
string="Partner",
comodel_name="res.partner",
required=True,
ondelete="cascade",
)
sequence = fields.Integer(
string="Sequence",
required=True,
default=10,
)
shareholder_id = fields.Many2one(
string="Shareholder",
comodel_name="res.partner",
required=True,
)
number_of_share = fields.Integer(
string="Num. Of Share",
required=True,
default=1,
)
17 changes: 17 additions & 0 deletions ssi_partner_company_capital/models/res_partner.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2024 OpenSynergy Indonesia
# Copyright 2024 PT. Simetri Sinergi Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).


from odoo import fields, models


class ResPartner(models.Model):
_name = "res.partner"
_inherit = "res.partner"

shareholder_ids = fields.One2many(
string="Shareholders",
comodel_name="company.shareholder",
inverse_name="partner_id",
)
3 changes: 3 additions & 0 deletions ssi_partner_company_capital/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_company_shareholder_configurator,company.shareholder - configurator,model_company_shareholder,ssi_partner.contacts_configurator_group,1,1,1,1
access_company_shareholder_all,company.shareholder - all,model_company_shareholder,,1,0,0,0
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 38 additions & 0 deletions ssi_partner_company_capital/views/res_partner_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record model="ir.ui.view" id="res_partner_view_form">
<field name="name">res.partner form - Creditor Debtor</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form" />
<field name="arch" type="xml">
<xpath expr="//page[@name='sales_purchases']" position="after">
<page
name="capital"
string="Capital"
attrs="{'invisible': [('is_company','=',False)]}"
>
<field name="shareholder_ids">
<tree editable="bottom">
<field name="sequence" widget="handle" />
<field
name="shareholder_id"
domain="[('parent_id','=',False),('id','!=',parent.id)]"
/>
<field name="number_of_share" />
</tree>
<form>
<group name="shareholder_1" colspan="4" col="2">
<field name="sequence" />
<field
name="shareholder_id"
domain="[('parent_id','=',False),('id','!=',parent.id)]"
/>
<field name="number_of_share" />
</group>
</form>
</field>
</page>
</xpath>
</field>
</record>
</odoo>

0 comments on commit 895d158

Please sign in to comment.