Browse Source

[REM] easy_my_coop_recompute_coop_number: not in v12

pull/84/head
robin.keunen 5 years ago
parent
commit
f3b3dca82d
  1. 1
      easy_my_coop_recompute_coop_number/__init__.py
  2. 37
      easy_my_coop_recompute_coop_number/__openerp__.py
  3. 2
      easy_my_coop_recompute_coop_number/wizard/__init__.py
  4. 22
      easy_my_coop_recompute_coop_number/wizard/cooperator_number_wizard.py
  5. 35
      easy_my_coop_recompute_coop_number/wizard/cooperator_number_wizard.xml

1
easy_my_coop_recompute_coop_number/__init__.py

@ -1 +0,0 @@
from . import wizard

37
easy_my_coop_recompute_coop_number/__openerp__.py

@ -1,37 +0,0 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2013-2017 Open Architects Consulting SPRL.
# Copyright (C) 2018- Coop IT Easy SCRLfs.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
{
"name": "Easy My Coop Recompute Coop Number",
"version": "1.0",
"depends": ["easy_my_coop"],
"author": "Houssine BAKKALI <houssine@coopiteasy.be>",
"category": "Cooperative management",
'website': "www.coopiteasy.be",
"description": """
This module allows to recompute the cooperator number subscription
it has to be used carefully.
""",
'data': [
'wizard/cooperator_number_wizard.xml',
],
'installable': True,
'active': False,
}

2
easy_my_coop_recompute_coop_number/wizard/__init__.py

@ -1,2 +0,0 @@
# -*- coding: utf-8 -*-
from . import cooperator_number_wizard

22
easy_my_coop_recompute_coop_number/wizard/cooperator_number_wizard.py

@ -1,22 +0,0 @@
# -*- coding: utf-8 -*-
from openerp import models, fields, api
class RecomputeWizard(models.TransientModel):
_name = 'register.number.wizard'
from_number = fields.Integer(string="From number")
to_number = fields.Integer(string="To number")
@api.one
def compute_register_number(self):
obj_sequence = self.env['ir.sequence']
sub_reg_obj = self.env['subscription.register']
sequence_operation = obj_sequence.search([('name', '=', 'Register Operation')])[0]
subscription_registers = sub_reg_obj.search([('register_number_operation', '>=', self.from_number)])
for subscription_register in subscription_registers:
sub_reg_operation = sequence_operation.next_by_id()
subscription_register.write({'name': sub_reg_operation,
'register_number_operation': int(sub_reg_operation)})

35
easy_my_coop_recompute_coop_number/wizard/cooperator_number_wizard.xml

@ -1,35 +0,0 @@
<openerp>
<data>
<record id="view_register_number_wizard" model="ir.ui.view">
<field name="name">Register number wizard</field>
<field name="model">register.number.wizard</field>
<field name="arch" type="xml">
<form>
<group>
<field name="from_number" default_focus="1" />
<field name="to_number"/>
</group>
<footer>
<button name="compute_register_number" string="Compute" type="object" class="oe_highlight"/>
or
<button string="Cancel" class="oe_link" special="cancel" />
</footer>
</form>
</field>
</record>
<record id="action_register_number_wizard" model="ir.actions.act_window">
<field name="name">Recompute register number</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">register.number.wizard</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="view_id" ref="view_register_number_wizard"/>
<field name="target">new</field>
<field name="multi">True</field>
</record>
<menuitem id="menu_register_number_wizard" parent="easy_my_coop.menu_easy_my_coop_config" action="action_register_number_wizard" sequence="30" groups="easy_my_coop.group_easy_my_coop_manager"/>
</data>
</openerp>
Loading…
Cancel
Save