robin.keunen
5 years ago
9 changed files with 102 additions and 8 deletions
-
1easy_my_coop_connector/__init__.py
-
1easy_my_coop_connector/__manifest__.py
-
8easy_my_coop_connector/models/subscription_request.py
-
11easy_my_coop_connector/models/subscription_request_adapter.py
-
10easy_my_coop_connector/tests/test_subscription_request.py
-
13easy_my_coop_connector/views/menus.xml
-
1easy_my_coop_connector/wizards/__init__.py
-
23easy_my_coop_connector/wizards/emc_history_import_sr.py
-
42easy_my_coop_connector/wizards/emc_history_import_sr.xml
@ -1 +1,2 @@ |
|||
from . import models |
|||
from . import wizards |
@ -0,0 +1 @@ |
|||
from . import emc_history_import_sr |
@ -0,0 +1,23 @@ |
|||
# Copyright 2020 Coop IT Easy SCRL fs |
|||
# Robin Keunen <robin@coopiteasy.be> |
|||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). |
|||
|
|||
from odoo import api, fields, models |
|||
|
|||
|
|||
class EMCHistoryImportSR(models.TransientModel): |
|||
_name = "emc.history.import.sr" |
|||
_description = "emc.history.import.sr" |
|||
|
|||
name = fields.Char("Name", default="Import History") |
|||
date_from = fields.Date(string="Date From", required=True) |
|||
date_to = fields.Date(string="Date To", required=True) |
|||
|
|||
@api.multi |
|||
def import_subscription_button(self): |
|||
self.env["subscription.request"].fetch_subscription_requests( |
|||
date_from=self.date_from, date_to=self.date_to |
|||
) |
|||
|
|||
action = self.env.ref("easy_my_coop.subscription_request_action") |
|||
return action.read()[0] |
@ -0,0 +1,42 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<openerp> |
|||
<data> |
|||
<record id="emc_history_import_sr_view_form" model="ir.ui.view"> |
|||
<field name="name">emc_history_import_sr_view_form</field> |
|||
<field name="model">emc.history.import.sr</field> |
|||
<field name="arch" type="xml"> |
|||
<form string="emc_history_import_sr_form"> |
|||
<sheet> |
|||
<group> |
|||
<field name="date_from"/> |
|||
<field name="date_to"/> |
|||
</group> |
|||
<footer> |
|||
<button name="import_subscription_button" |
|||
string="Import Subscription History" |
|||
type="object" |
|||
class="btn-primary"/> |
|||
<button string="Cancel" class="btn-default" |
|||
special="cancel"/> |
|||
</footer> |
|||
</sheet> |
|||
</form> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="emc_history_import_action" model="ir.actions.act_window"> |
|||
<field name="name">Import Subscription Request History</field> |
|||
<field name="type">ir.actions.act_window</field> |
|||
<field name="res_model">emc.history.import.sr</field> |
|||
<field name="view_mode">form</field> |
|||
</record> |
|||
|
|||
<!-- <act_window id="action_aged_partner_balance_wizard"--> |
|||
<!-- name="Aged Partner Balance"--> |
|||
<!-- res_model="aged.partner.balance.wizard"--> |
|||
<!-- view_type="form"--> |
|||
<!-- view_mode="form"--> |
|||
<!-- view_id="aged_partner_balance_wizard"--> |
|||
<!-- target="new"/>--> |
|||
</data> |
|||
</openerp> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue