-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #68 from onesteinbv/16.0-add-membership_group
[Add] Added modules membership_group and mass_mailing_membership_group modules and refactored other membership modules
- Loading branch information
Showing
111 changed files
with
2,342 additions
and
483 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 |
---|---|---|
|
@@ -25,4 +25,5 @@ | |
"data/mailing_contact_demo.xml", | ||
"data/res_partner_demo.xml", | ||
], | ||
"auto_install": True, | ||
} |
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
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 |
---|---|---|
@@ -1 +1 @@ | ||
from . import models | ||
from . import models |
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 |
---|---|---|
@@ -1 +1 @@ | ||
from . import res_partner | ||
from . import res_partner |
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
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
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
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
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
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
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
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 |
---|---|---|
@@ -1,22 +1,20 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<odoo> | ||
<data noupdate="1"> | ||
<odoo noupdate="1"> | ||
|
||
<record id="demo_hr_department_section_1" model="hr.department"> | ||
<record id="demo_hr_department_group_1" model="hr.department"> | ||
<field name="name">Executive Board</field> | ||
</record> | ||
|
||
<record id="demo_hr_department_section_2" model="hr.department"> | ||
<record id="demo_hr_department_group_2" model="hr.department"> | ||
<field name="name">Marketing Team</field> | ||
</record> | ||
|
||
<record id="demo_hr_department_section_3" model="hr.department"> | ||
<record id="demo_hr_department_group_3" model="hr.department"> | ||
<field name="name">Finance Committee</field> | ||
</record> | ||
|
||
<record id="demo_hr_department_section_4" model="hr.department"> | ||
<record id="demo_hr_department_group_4" model="hr.department"> | ||
<field name="name">Youth Club</field> | ||
</record> | ||
|
||
</data> | ||
</odoo> |
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 |
---|---|---|
@@ -1,15 +1,13 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<odoo> | ||
<data noupdate="1"> | ||
<odoo noupdate="1"> | ||
|
||
<record id="employee_demo_member_1" model="hr.employee"> | ||
<field name="name">John Doe</field> | ||
<field name="user_id" ref="user_demo_member_1"/> | ||
<field name="department_id" ref="demo_hr_department_section_1"/> | ||
<field name="department_id" ref="demo_hr_department_group_1"/> | ||
<field name="job_id" ref="job_member"/> | ||
<field name="employee_type">member</field> | ||
<field name="category_ids" eval="[(6, 0, [ref('hr.employee_category_4')])]"/> | ||
</record> | ||
|
||
</data> | ||
</odoo> |
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 |
---|---|---|
@@ -1,10 +1,8 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<odoo> | ||
<data noupdate="1"> | ||
<odoo noupdate="1"> | ||
|
||
<record id="job_member" model="hr.job"> | ||
<field name="name">Member</field> | ||
</record> | ||
|
||
</data> | ||
</odoo> |
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 |
---|---|---|
@@ -1,14 +1,12 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<odoo> | ||
<data noupdate="1"> | ||
<odoo noupdate="1"> | ||
|
||
<record id="user_demo_member_1" model="res.users"> | ||
<field name="partner_id" ref="membership_section.demo_member_1"/> | ||
<field name="partner_id" ref="membership_group.demo_member_1"/> | ||
<field name="login">demo_member</field> | ||
<field name="password">demo_member</field> | ||
<field name="company_id" ref="base.main_company"/> | ||
<field name="groups_id" eval="[Command.set([ref('base.group_user'), ref('base.group_partner_manager'), ref('base.group_allow_export')])]"/> | ||
</record> | ||
|
||
</data> | ||
</odoo> |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
from . import hr_department | ||
from . import hr_employee_base | ||
from . import hr_employee | ||
from . import membership_section | ||
from . import membership_group |
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
from odoo import fields, models | ||
|
||
|
||
class HRDepartment(models.AbstractModel): | ||
class HRDepartment(models.Model): | ||
_inherit = "hr.department" | ||
|
||
section_id = fields.Many2one("membership.section") | ||
membership_group_id = fields.Many2one("membership.group") |
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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
from odoo import fields, models | ||
|
||
|
||
class HREmployee(models.AbstractModel): | ||
class HREmployee(models.Model): | ||
_inherit = "hr.employee" | ||
|
||
section_membership_ids = fields.One2many( | ||
related="user_partner_id.section_membership_ids" | ||
membership_group_member_ids = fields.One2many( | ||
related="user_partner_id.membership_group_member_ids" | ||
) |
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,36 @@ | ||
from odoo import api, fields, models | ||
|
||
|
||
class MembershipGroup(models.AbstractModel): | ||
_inherit = "membership.group" | ||
|
||
department_id = fields.Many2one( | ||
"hr.department", | ||
compute="_compute_department", | ||
inverse="_inverse_department", | ||
store=True, | ||
readonly=False, | ||
) | ||
|
||
department_ids = fields.One2many( | ||
"hr.department", "membership_group_id", string="Departments" | ||
) | ||
|
||
@api.depends("department_ids") | ||
def _compute_department(self): | ||
for membership_group in self: | ||
membership_group.department_id = ( | ||
membership_group.department_ids | ||
and membership_group.department_ids[0] | ||
or False | ||
) | ||
|
||
def _inverse_department(self): | ||
hr_department_obj = self.env["hr.department"] | ||
for membership_group in self: | ||
if membership_group.department_ids: | ||
department = hr_department_obj.browse( | ||
membership_group.department_ids[0].id | ||
) | ||
department.membership_group_id = False | ||
membership_group.department_id.membership_group_id = membership_group |
This file was deleted.
Oops, something went wrong.
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 @@ | ||
from . import test_membership_hr |
Oops, something went wrong.