diff --git a/coworking_app/__manifest__.py b/coworking_app/__manifest__.py index 3a363af..811b791 100644 --- a/coworking_app/__manifest__.py +++ b/coworking_app/__manifest__.py @@ -26,5 +26,5 @@ 'application': True, 'installable': True, 'data': [], - 'depends': ['coworking_coworker', 'coworking_event'] + 'depends': ['coworking_coworker'] #'coworking_event'] } diff --git a/coworking_coworker/__manifest__.py b/coworking_coworker/__manifest__.py index 5050e10..8d521d4 100644 --- a/coworking_coworker/__manifest__.py +++ b/coworking_coworker/__manifest__.py @@ -25,8 +25,8 @@ 'license': 'AGPL-3', 'application': False, 'installable': True, - 'data': ['security/ir.model.access.csv', - 'views/coworking_menu.xml', - 'views/coworker_views.xml'], + # 'data': ['security/ir.model.access.csv', + # 'views/coworking_menu.xml', + # 'views/coworker_views.xml'], 'depends': ['coworking_base'] } diff --git a/coworking_coworker/models/__init__.py b/coworking_coworker/models/__init__.py index 4e351f4..1aa466c 100644 --- a/coworking_coworker/models/__init__.py +++ b/coworking_coworker/models/__init__.py @@ -1,2 +1,2 @@ # -*- coding: utf-8 -*- -from . import coworker +from . import res_partner, coworker diff --git a/coworking_coworker/models/coworker.py b/coworking_coworker/models/coworker.py index 7852413..0f4153a 100644 --- a/coworking_coworker/models/coworker.py +++ b/coworking_coworker/models/coworker.py @@ -14,7 +14,6 @@ class Coworker(models.Model): contact_date = fields.Date(default=fields.Date.context_today) full_name = fields.Char(compute='_compute_full_name', store=True, index=True) - name = fields.Char(required=True) firstname = fields.Char('First name', required=True) coworker_type = fields.Selection([('staffer', 'Staffer'), diff --git a/coworking_coworker/models/res_partner.py b/coworking_coworker/models/res_partner.py new file mode 100644 index 0000000..1947e84 --- /dev/null +++ b/coworking_coworker/models/res_partner.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- + +""" Coworker module """ + +from odoo import models, fields, api, _ +from odoo.exceptions import ValidationError + +class ResPartner(models.Model): + """ Coworker model """ + _inherit = 'res.partner' + + name = fields.Char(required=True) + + company_ids = fields.One2many( + string="Company", + comodel_name="res.partner", + inverse_name="parent_id", + ) + + +#Adress fields + street = fields.Char() + zip = fields.Char() + city = fields.Char() + + phone = fields.Char() + mobile = fields.Char('GSM') + email = fields.Char() + url = fields.Char('URL') + comment = fields.Text() diff --git a/coworking_coworker/views/res_partner_views.xml b/coworking_coworker/views/res_partner_views.xml new file mode 100644 index 0000000..16d73ac --- /dev/null +++ b/coworking_coworker/views/res_partner_views.xml @@ -0,0 +1,48 @@ + + + + + + Res_partner Form + coworking.res_partner + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ +