Ajout de fonction de confirmation de pack

This commit is contained in:
eloyoussef 2018-03-29 15:05:48 +02:00
parent 24d08c0774
commit 0a4abc795f
3 changed files with 18 additions and 6 deletions

View File

@ -20,7 +20,7 @@
'name': 'GOLEM resources pack',
'summary': 'GOLEM resources pack',
'description': ''' GOLEM resources pack ''',
'version': '10.0.0.0.1',
'version': '10.0.0.0.2',
'category': 'GOLEM',
'author': 'Youssef El Ouahby, Fabien Bourgeois',
'license': 'AGPL-3',

View File

@ -36,3 +36,14 @@ class GolemResourcePack(models.Model):
string='User', default=lambda self: self.env.user)
partner_id = fields.Many2one('res.partner', string='On behalf of',
required=True, index=True)
state = fields.Selection([('canceled', 'Canceled'),
('draft', 'Draft'),
('confirmed', 'Confirmed'),
('validated', 'Validated'),
('rejected', 'Rejected')],
default='draft')
@api.multi
def state_confirm(self):
for pack in self:
pack.reservation_ids.state_confirm()

View File

@ -52,10 +52,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<field name="model">golem.resource.pack</field>
<field name="arch" type="xml">
<form>
<!--<header>
<header>
<button name="state_confirm" type="object" string="Confirm" class="oe_highlight"
attrs="{'invisible': ['|', ('state', 'not in', 'draft'), ('id', '=', False)]}" />
<button name="state_canceled" type="object"
<!--<button name="state_canceled" type="object"
string="Cancel" states="confirmed,validated" />
<button name="state_draft" type="object" string="Set to draft"
states="canceled,confirmed,validated,rejected" />
@ -64,18 +64,19 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
groups="golem_base.group_golem_manager" />
<button name="state_rejected" type="object" string="Reject"
states="confirmed" class="oe_highlight"
groups="golem_base.group_golem_manager" />
groups="golem_base.group_golem_manager" />-->
<field name="state" widget="statusbar" />
</header>-->
</header>
<sheet>
<group>
<group name="general" string="Genaral">
<field name="id" invisible="1"/>
<field name="user_id" />
<field name="partner_id" />
<field name="note" />
</group>
</group>
<field name="reservation_ids" />
<field name="reservation_ids" context="{'default_partner_id' : partner_id}" />
</sheet>
<!--<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers" />