Browse Source
Ajout d'un wizard pour créer un nouvel enfant directement chez le travailleur. Correction de qq mots qui étaient encore en français
pull/13/head
Ajout d'un wizard pour créer un nouvel enfant directement chez le travailleur. Correction de qq mots qui étaient encore en français
pull/13/head
EliseDup
9 years ago
8 changed files with 138 additions and 69 deletions
-
1beesdoo_base/__openerp__.py
-
13beesdoo_base/models/partner.py
-
31beesdoo_base/views/partner.xml
-
2beesdoo_base/wizard/__init__.py
-
2beesdoo_base/wizard/member_card.py
-
22beesdoo_base/wizard/partner.py
-
6beesdoo_base/wizard/views/member_card.xml
-
22beesdoo_base/wizard/views/partner.xml
@ -1,2 +1,2 @@ |
|||||
import member_card |
|
||||
|
import member_card, partner |
||||
|
|
@ -0,0 +1,22 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
from openerp import models, fields, api |
||||
|
|
||||
|
class NewEaterWizard(models.TransientModel): |
||||
|
""" |
||||
|
A transient model for the creation of a eater related to a worker. |
||||
|
""" |
||||
|
_name = 'eater.new.wizard' |
||||
|
|
||||
|
def _get_default_partner(self): |
||||
|
return self.env.context['active_id'] |
||||
|
|
||||
|
first_name = fields.Char('First Name', required=True) |
||||
|
last_name = fields.Char('Last Name', required=True) |
||||
|
email = fields.Char('Email') |
||||
|
|
||||
|
partner_id = fields.Many2one('res.partner', default=_get_default_partner) |
||||
|
|
||||
|
@api.one |
||||
|
def create_new_eater(self): |
||||
|
client = self.partner_id.sudo() |
||||
|
client._new_eater(self.first_name, self.last_name, self.email) |
@ -0,0 +1,22 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<odoo> |
||||
|
<!-- New eater generation wizard --> |
||||
|
<record id="Eater Wizard" model="ir.ui.view"> |
||||
|
<field name="name">New Eater Wizard</field> |
||||
|
<field name="model">eater.new.wizard</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<form string="Create a new eater"> |
||||
|
<group> |
||||
|
<field name="first_name" /> |
||||
|
<field name="last_name" /> |
||||
|
<field name="email" /> |
||||
|
</group> |
||||
|
<footer> |
||||
|
<button type="object" name="create_new_eater" string="Create" |
||||
|
class="oe_highlight" /> |
||||
|
<button special="cancel" string="Cancel" /> |
||||
|
</footer> |
||||
|
</form> |
||||
|
</field> |
||||
|
</record> |
||||
|
</odoo> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue