houssine
6 years ago
4 changed files with 72 additions and 9 deletions
-
1easy_my_coop/__openerp__.py
-
24easy_my_coop/wizard/update_partner_info.py
-
17easy_my_coop/wizard/validate_subscription_request.py
-
39easy_my_coop/wizard/validate_subscription_request.xml
@ -0,0 +1,17 @@ |
|||
# -*- coding: utf-8 -*- |
|||
|
|||
from openerp import api, fields, models, _ |
|||
from openerp.exceptions import UserError |
|||
|
|||
|
|||
class ValidateSubscriptionRequest(models.TransientModel): |
|||
_name = "validate.subscription.request" |
|||
_description = "Update Partner Info" |
|||
|
|||
@api.multi |
|||
def validate(self): |
|||
|
|||
subscription_requests = self.filtered(lambda record: record.state in ['draft', 'waiting']) |
|||
for subscription_request in subscription_requests: |
|||
subscription_request.validate_subscription_request |
|||
return True |
@ -0,0 +1,39 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<openerp> |
|||
<data> |
|||
<record id="view_validate_subscription_request" model="ir.ui.view"> |
|||
<field name="name">Validate subscription request</field> |
|||
<field name="model">validate.subscription.request</field> |
|||
<field name="arch" type="xml"> |
|||
<form string="Validate the subscription request"> |
|||
<p class="oe_grey"> |
|||
Validate the subscription request. |
|||
</p> |
|||
<footer> |
|||
<button name="validate" string="Validate" type="object" class="btn-primary"/> |
|||
<button string="Cancel" class="btn-default" special="cancel"/> |
|||
</footer> |
|||
</form> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="action_validate_subscription_request" model="ir.actions.act_window"> |
|||
<field name="name">Update Cooperator Info</field> |
|||
<field name="type">ir.actions.act_window</field> |
|||
<field name="res_model">validate.subscription.request</field> |
|||
<field name="view_type">form</field> |
|||
<field name="view_mode">form</field> |
|||
<field name="target">new</field> |
|||
<field name="groups_id" eval="[(4,ref('easy_my_coop.group_energiris_manager'))]"/> |
|||
</record> |
|||
|
|||
<record model="ir.values" id="validate_subscription_request"> |
|||
<field name="model_id" ref="resource.model_subscription_request" /> |
|||
<field name="name">Subscription Request</field> |
|||
<field name="key2">client_action_multi</field> |
|||
<field name="value" eval="'ir.actions.act_window,' + str(ref('action_validate_subscription_request'))" /> |
|||
<field name="key">action</field> |
|||
<field name="model">subscription.request</field> |
|||
</record> |
|||
</data> |
|||
</openerp> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue