Browse Source

[BACKPORT] mass_sorting from 10.0 to 8.0

pull/1302/head
Sylvain LE GAL 7 years ago
parent
commit
e3e5079673
  1. 2
      mass_sorting/__openerp__.py
  2. 4
      mass_sorting/demo/function.xml
  3. 4
      mass_sorting/demo/mass_sort_config.xml
  4. 4
      mass_sorting/demo/mass_sort_config_line.xml
  5. 6
      mass_sorting/models/mass_sort_config.py
  6. 4
      mass_sorting/models/mass_sort_config_line.py
  7. 5
      mass_sorting/models/mass_sort_wizard.py
  8. 2
      mass_sorting/models/mass_sort_wizard_line.py
  9. 4
      mass_sorting/views/menu.xml
  10. 4
      mass_sorting/views/view_mass_sort_config.xml
  11. 4
      mass_sorting/views/view_mass_sort_wizard.xml

2
mass_sorting/__manifest__.py → mass_sorting/__openerp__.py

@ -6,7 +6,7 @@
{
'name': 'Mass Sorting',
'version': "10.0.1.0.0",
'version': "8.0.1.0.0",
'author': 'GRAP,Odoo Community Association (OCA)',
'summary': 'Sort any models by any fields list',
'category': 'Tools',

4
mass_sorting/demo/function.xml

@ -5,8 +5,8 @@ Copyright (C) 2016-Today GRAP (http://www.grap.coop)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
-->
<odoo noupdate="1">
<openerp><data noupdate="1">
<function model="mass.sort.config" name="create_action" eval="[ref('mass_sort_config_demo')]"/>
</odoo>
</data></openerp>

4
mass_sorting/demo/mass_sort_config.xml

@ -5,7 +5,7 @@ Copyright (C) 2016-Today GRAP (http://www.grap.coop)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
-->
<odoo>
<openerp><data>
<record id="mass_sort_config_demo" model="mass.sort.config">
<field name="name">Self Mass Sort Demo</field>
@ -13,4 +13,4 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
<field name="one2many_field_id" ref="mass_sorting.field_mass_sort_config_line_ids"/>
</record>
</odoo>
</data></openerp>

4
mass_sorting/demo/mass_sort_config_line.xml

@ -5,7 +5,7 @@ Copyright (C) 2016-Today GRAP (http://www.grap.coop)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
-->
<odoo>
<openerp><data>
<record id="mass_sort_config_demo_line_1" model="mass.sort.config.line">
<field name="config_id" ref="mass_sort_config_demo"/>
@ -17,4 +17,4 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
<field name="field_id" ref="mass_sorting.field_mass_sort_config_line_desc"/>
</record>
</odoo>
</data></openerp>

6
mass_sorting/models/mass_sort_config.py

@ -5,8 +5,8 @@
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import _, api, fields, models
from odoo.exceptions import ValidationError
from openerp import _, api, fields, models
from openerp.exceptions import ValidationError
class MassSortConfig(models.Model):
@ -74,10 +74,12 @@ class MassSortConfig(models.Model):
" you uncheck 'Allow Custom Setting'."))
# Overload Section
@api.multi
def unlink(self):
self.unlink_action()
return super(MassSortConfig, self).unlink()
@api.multi
def copy(self, default=None):
default = default or {}
default.update({

4
mass_sorting/models/mass_sort_config_line.py

@ -3,8 +3,8 @@
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import _, api, fields, models
from odoo.exceptions import ValidationError
from openerp import _, api, fields, models
from openerp.exceptions import ValidationError
class MassSortConfigLine(models.Model):

5
mass_sorting/models/mass_sort_wizard.py

@ -3,8 +3,8 @@
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import _, api, fields, models
from odoo.exceptions import ValidationError
from openerp import _, api, fields, models
from openerp.exceptions import ValidationError
class MassSortWizard(models.TransientModel):
@ -72,6 +72,7 @@ class MassSortWizard(models.TransientModel):
"Please Select at least one Sorting Criteria."))
# Action Section
@api.multi
def button_apply(self):
self.ensure_one()
wizard = self

2
mass_sorting/models/mass_sort_wizard_line.py

@ -3,7 +3,7 @@
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import fields, models
from openerp import fields, models
class TransientModelLine(models.TransientModel):

4
mass_sorting/views/menu.xml

@ -5,10 +5,10 @@ Copyright (C) 2016-Today GRAP (http://www.grap.coop)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
-->
<odoo>
<openerp><data>
<menuitem id="menu_mass_sort_config"
action="action_mass_sort_config"
parent="base.menu_custom" sequence="30"/>
</odoo>
</data></openerp>

4
mass_sorting/views/view_mass_sort_config.xml

@ -5,7 +5,7 @@ Copyright (C) 2016-Today GRAP (http://www.grap.coop)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
-->
<odoo>
<openerp><data>
<record id="view_mass_sort_config_search" model="ir.ui.view">
<field name="model">mass.sort.config</field>
@ -65,4 +65,4 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
</field>
</record>
</odoo>
</data></openerp>

4
mass_sorting/views/view_mass_sort_wizard.xml

@ -5,7 +5,7 @@ Copyright (C) 2016-Today GRAP (http://www.grap.coop)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
-->
<odoo>
<openerp><data>
<record id="view_mass_sort_wizard_form" model="ir.ui.view">
<field name="model">mass.sort.wizard</field>
@ -34,4 +34,4 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
</field>
</record>
</odoo>
</data></openerp>
Loading…
Cancel
Save