[IMP] website_crm_partner_assign: allow archiving partner activation

Currently, for the better first user experience, few partner activation
levels are available by default (added in data files). Since there is no
way to archive it, the only way to not use them in your production is to
delete it. But it means that on each migration, it will be restored.

To improve that, this commit introduces 'active' field in the activation
levels so that one can easily archive them if they are of no use, and
this way they won't be again created every time when db is migrated.

This commit also adds a search view with 'Archived' filter to see the
archived activation levels easily.

taskID-2753985

closes odoo/odoo#84401

Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
This commit is contained in:
Umesh Gupta
2022-02-23 10:02:04 +00:00
parent 59ea46c97e
commit 0e601ebeb9
3 changed files with 14 additions and 1 deletions
@@ -5,7 +5,7 @@
'name': 'Resellers',
'category': 'Website/Website',
'summary': 'Publish your resellers/partners and forward leads to them',
'version': '1.1',
'version': '1.2',
'description': """
This module allows to publish your resellers/partners on your website and to forward incoming leads/opportunities to them.
@@ -11,3 +11,4 @@ class ResPartnerActivation(models.Model):
sequence = fields.Integer('Sequence')
name = fields.Char('Name', required=True)
active = fields.Boolean(default=True)
@@ -21,10 +21,22 @@
<tree string="Activation" editable="bottom">
<field name="sequence" widget="handle"/>
<field name="name"/>
<field name="active" widget="boolean_toggle"/>
</tree>
</field>
</record>
<record id="res_partner_activation_view_search" model="ir.ui.view">
<field name="name">res.partner.activation.view.search</field>
<field name="model">res.partner.activation</field>
<field name="arch" type="xml">
<search string="Activation">
<field name="name" string="Partner Activation"/>
<filter string="Archived" name="inactive" domain="[('active', '=', False)]"/>
</search>
</field>
</record>
<record model="ir.actions.act_window" id="res_partner_activation_act">
<field name="name">Partner Activations</field>
<field name="res_model">res.partner.activation</field>