This commit is contained in:
michel 2017-11-24 10:05:18 +01:00
parent cad38216de
commit 3c68ea83d5
6 changed files with 83 additions and 6 deletions

View File

@ -26,5 +26,5 @@
'application': True,
'installable': True,
'data': [],
'depends': ['coworking_coworker', 'coworking_event']
'depends': ['coworking_coworker'] #'coworking_event']
}

View File

@ -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']
}

View File

@ -1,2 +1,2 @@
# -*- coding: utf-8 -*-
from . import coworker
from . import res_partner, coworker

View File

@ -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'),

View File

@ -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()

View File

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Form -->
<record id="view_form_res_partner" model="ir.ui.view">
<field name="name">Res_partner Form</field>
<field name="model">coworking.res_partner</field>
<field name="inherit_id" ref ="coworking_res_partner.view_form_coworker" />
<field name="arch" type="xml">
<form string="Res_partner">
<sheet>
<group name="group_top">
<group name="group_left">
<field name="contact_image" widget="image" class="oe_avatar"/>
<field name="contact_date" />
<field name="full_name" />
<field name="name" />
<field name="firstname" />
<field name="coworker_type" />
<field name="company_name" />
<field name="job" />
</group>
<group name="group_right">
<field name="street" />
<field name="contact_zip" />
<field name="city" />
<field name="full_contact_adress" />
<field name="gsm" />
<field name="phone_number" />
<field name="email" />
<field name="url" />
<field name="is_done" />
<field name="is_active" readonly="1" />
</group>
</group>
<groupe>
<notebook>
<page string="Note" name="note">
<field name="note" />
</page>
</notebook>
</groupe>
</sheet>
</form>
</field>
</record>
</odoo>