[MIG] base_usability_akretion, base_partner_ref, partner_tree_default_account, partner_tree_default_base, partner_tree_default_contacts to v18

This commit is contained in:
Alexis de Lattre
2024-12-25 01:50:21 +01:00
parent 47cf7389cc
commit f9f06d83e2
27 changed files with 73 additions and 163 deletions

View File

@@ -1,10 +1,10 @@
# Copyright 2017-2023 Akretion France (https://www.akretion.com) # Copyright 2017-2024 Akretion France (https://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com> # @author Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{ {
'name': 'Base Partner Reference', 'name': 'Base Partner Reference',
'version': '16.0.1.0.0', 'version': '18.0.1.0.0',
'category': 'Partner', 'category': 'Partner',
'license': 'AGPL-3', 'license': 'AGPL-3',
'summary': "Improve usage of partner's Internal Reference", 'summary': "Improve usage of partner's Internal Reference",
@@ -23,5 +23,5 @@ Base Partner Reference
'depends': ['base'], 'depends': ['base'],
'data': ['views/res_partner.xml'], 'data': ['views/res_partner.xml'],
'post_init_hook': 'update_partner_display_name', 'post_init_hook': 'update_partner_display_name',
'installable': False, 'installable': True,
} }

View File

@@ -23,51 +23,24 @@ class ResPartner(models.Model):
def _compute_display_name(self): def _compute_display_name(self):
super()._compute_display_name() super()._compute_display_name()
def _get_name(self): def _get_complete_name(self):
partner = self self.ensure_one()
name = partner.name or '' displayed_types = self._complete_name_displayed_types
type_description = dict(self._fields['type']._description_selection(self.env))
name = self.name or ''
# START modif of native method # START modif of native method
if partner.ref: if self.ref:
name = "[%s] %s" % (partner.ref, name) name = "[%s] %s" % (self.ref, name)
# END modif of native method # END modif of native method
if partner.company_name or partner.parent_id: if self.company_name or self.parent_id:
if not name and partner.type in ['invoice', 'delivery', 'other']: if not name and self.type in displayed_types:
name = dict(self.fields_get( name = type_description[self.type]
['type'])['type']['selection'])[partner.type] if not self.is_company:
if not partner.is_company: name = f"{self.commercial_company_name or self.sudo().parent_id.name}, {name}"
# START modif of native name_get() method # START modif of native method
company_name = partner.commercial_company_name or\ if self.parent_id.ref:
partner.sudo().parent_id.name name = f"[{self.parent_id.ref}] {name}"
if partner.parent_id.ref: # END modif of native method
company_name = "[%s] %s" % (partner.parent_id.ref, company_name)
name = "%s, %s" % (company_name, name)
# END modif of native name_get() method
if self._context.get('show_address_only'):
name = partner._display_address(without_company=True)
if self._context.get('show_address'):
name = name + "\n" + partner._display_address(without_company=True)
name = re.sub(r'\s+\n', '\n', name)
if self._context.get('partner_show_db_id'):
name = "%s (%s)" % (name, partner.id)
if self._context.get('address_inline'):
splitted_names = name.split("\n")
name = ", ".join([n for n in splitted_names if n.strip()])
if self._context.get('show_email') and partner.email:
name = "%s <%s>" % (name, partner.email)
if self._context.get('html_format'):
name = name.replace('\n', '<br/>')
if self._context.get('show_vat') and partner.vat:
name = "%s %s" % (name, partner.vat)
return name.strip() return name.strip()
@api.model # native _rec_names_search contains "ref", so no need to inherit name_search()
def name_search(self, name='', args=None, operator='ilike', limit=100):
if args is None:
args = []
if name and operator == 'ilike':
recs = self.search([('ref', '=', name)] + args, limit=limit)
if recs:
rec_childs = self.search([('id', 'child_of', recs.ids)])
return rec_childs.name_get()
return super().name_search(name=name, args=args, operator=operator, limit=limit)

View File

@@ -2,11 +2,8 @@
# @author: Alexis de Lattre <alexis.delattre@akretion.com> # @author: Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, SUPERUSER_ID
def update_partner_display_name(env):
def update_partner_display_name(cr, registry):
env = api.Environment(cr, SUPERUSER_ID, {})
partners = env['res.partner'].with_context(active_test=False).search( partners = env['res.partner'].with_context(active_test=False).search(
[('ref', '!=', False)]) [('ref', '!=', False)])
partners.write({'invalidate_display_name': True}) partners.write({'invalidate_display_name': True})

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
Copyright 2017-2023 Akretion France (http://www.akretion.com/) Copyright 2017-2024 Akretion France (https://www.akretion.com/)
@author: Alexis de Lattre <alexis.delattre@akretion.com> @author: Alexis de Lattre <alexis.delattre@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
--> -->
@@ -13,9 +13,9 @@
<field name="inherit_id" ref="base.view_partner_form"/> <field name="inherit_id" ref="base.view_partner_form"/>
<field name="priority">1000</field> <!-- inherit after l10n_fr --> <field name="priority">1000</field> <!-- inherit after l10n_fr -->
<field name="arch" type="xml"> <field name="arch" type="xml">
<field name="vat" position="before"> <div class="o_address_format" position="after">
<field name="ref"/> <field name="ref"/>
</field> </div>
<xpath expr="//page[@name='sales_purchases']//field[@name='ref']" position="attributes"> <xpath expr="//page[@name='sales_purchases']//field[@name='ref']" position="attributes">
<attribute name="invisible">1</attribute> <attribute name="invisible">1</attribute>
</xpath> </xpath>

View File

@@ -4,7 +4,7 @@
{ {
'name': 'Base Usability', 'name': 'Base Usability',
'version': '16.0.1.0.0', 'version': '18.0.1.0.0',
'category': 'Partner', 'category': 'Partner',
'license': 'AGPL-3', 'license': 'AGPL-3',
'summary': 'Better usability in base module', 'summary': 'Better usability in base module',
@@ -21,7 +21,6 @@
'views/ir_config_parameter.xml', 'views/ir_config_parameter.xml',
'views/ir_module.xml', 'views/ir_module.xml',
'views/ir_sequence.xml', 'views/ir_sequence.xml',
'views/ir_property.xml',
], ],
'installable': False, 'installable': True,
} }

View File

@@ -4,4 +4,3 @@ from . import res_partner_bank
from . import res_company from . import res_company
from . import ir_mail_server from . import ir_mail_server
from . import ir_model from . import ir_model
from . import ir_model_fields

View File

@@ -1,4 +1,4 @@
# Copyright 2015-2022 Akretion France (http://www.akretion.com/) # Copyright 2015-2024 Akretion France (https://www.akretion.com/)
# @author: Alexis de Lattre <alexis.delattre@akretion.com> # @author: Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
@@ -19,7 +19,7 @@ class IrMailServer(models.Model):
smtp_debug=False, smtp_session=None): smtp_debug=False, smtp_session=None):
# Start copy from native method # Start copy from native method
smtp_from, smtp_to_list, message = self._prepare_email_message( smtp_from, smtp_to_list, message = self._prepare_email_message(
message, smtp_session) message, smtp)
# End copy from native method # End copy from native method
logger.info( logger.info(
"Sending email from '%s' to '%s' Cc '%s' Bcc '%s' " "Sending email from '%s' to '%s' Cc '%s' Bcc '%s' "

View File

@@ -1,4 +1,4 @@
# Copyright 2019-2022 Akretion France (http://www.akretion.com/) # Copyright 2019-2024 Akretion France (https://www.akretion.com/)
# @author: Alexis de Lattre <alexis.delattre@akretion.com> # @author: Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
@@ -9,8 +9,6 @@ class IrModel(models.Model):
_inherit = 'ir.model' _inherit = 'ir.model'
@api.depends('name', 'model') @api.depends('name', 'model')
def name_get(self): def _compute_display_name(self):
res = []
for rec in self: for rec in self:
res.append((rec.id, '%s (%s)' % (rec.name, rec.model))) rec.display_name = f'{rec.name} ({rec.model})'
return res

View File

@@ -1,16 +0,0 @@
# Copyright 2024 Akretion France (http://www.akretion.com/)
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, models
class IrModelFields(models.Model):
_inherit = 'ir.model.fields'
@api.depends('name', 'field_description')
def name_get(self):
res = []
for rec in self:
res.append((rec.id, '%s (%s)' % (rec.field_description, rec.name)))
return res

View File

@@ -1,4 +1,4 @@
# Copyright 2015-2022 Akretion France (http://www.akretion.com/) # Copyright 2015-2024 Akretion France (https://www.akretion.com/)
# @author: Alexis de Lattre <alexis.delattre@akretion.com> # @author: Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

View File

@@ -1,4 +1,4 @@
# Copyright 2015-2022 Akretion France (http://www.akretion.com/) # Copyright 2015-2024 Akretion France (https://www.akretion.com/)
# @author: Alexis de Lattre <alexis.delattre@akretion.com> # @author: Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

View File

@@ -1,4 +1,4 @@
# Copyright 2015-2022 Akretion France (http://www.akretion.com/) # Copyright 2015-2024 Akretion France (https://www.akretion.com/)
# @author: Alexis de Lattre <alexis.delattre@akretion.com> # @author: Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

View File

@@ -2,7 +2,7 @@
# @author: Alexis de Lattre <alexis.delattre@akretion.com> # @author: Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, fields, models, SUPERUSER_ID from odoo import api, fields, models
import logging import logging
from odoo.tools.misc import format_datetime from odoo.tools.misc import format_datetime
@@ -14,11 +14,9 @@ class ResUsers(models.Model):
@api.model @api.model
def _script_partners_linked_to_users_no_company(self): def _script_partners_linked_to_users_no_company(self):
if self.env.user.id != SUPERUSER_ID:
self = self.sudo()
logger.info( logger.info(
'START to set company_id=False on partners related to users') 'START to set company_id=False on partners related to users')
users = self.with_context(active_test=False).search([]) users = self.sudo().with_context(active_test=False).search([])
for user in users: for user in users:
if user.partner_id.company_id: if user.partner_id.company_id:
user.partner_id.write({'company_id': False}) user.partner_id.write({'company_id': False})

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
Copyright 2016-2022 Akretion France (http://www.akretion.com/) Copyright 2016-2024 Akretion France (https://www.akretion.com/)
@author: Alexis de Lattre <alexis.delattre@akretion.com> @author: Alexis de Lattre <alexis.delattre@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
--> -->

View File

@@ -6,9 +6,9 @@
<field name="model">ir.config_parameter</field> <field name="model">ir.config_parameter</field>
<field name="inherit_id" ref="base.view_ir_config_list"/> <field name="inherit_id" ref="base.view_ir_config_list"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//tree/field[last()]" position="after"> <list position="inside">
<field name="write_date"/> <field name="write_date" optional="show"/>
</xpath> </list>
</field> </field>
</record> </record>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
Copyright 2015-2022 Akretion France (http://www.akretion.com/) Copyright 2015-2024 Akretion France (https://www.akretion.com/)
@author: Alexis de Lattre <alexis.delattre@akretion.com> @author: Alexis de Lattre <alexis.delattre@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
--> -->
@@ -13,6 +13,7 @@
<field name="inherit_id" ref="base.view_module_filter"/> <field name="inherit_id" ref="base.view_module_filter"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//filter[@name='extra']" position="after"> <xpath expr="//filter[@name='extra']" position="after">
<separator/>
<filter name="installable" string="Installable" domain="[('state', '!=', 'uninstallable')]"/> <filter name="installable" string="Installable" domain="[('state', '!=', 'uninstallable')]"/>
</xpath> </xpath>
</field> </field>

View File

@@ -1,40 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2022 Akretion France (http://www.akretion.com/)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<odoo>
<record id="ir_property_view_tree" model="ir.ui.view">
<field name="model">ir.property</field>
<field name="inherit_id" ref="base.ir_property_view_tree"/>
<field name="arch" type="xml">
<field name="type" position="after">
<field name="value_reference" optional="show"/>
<field name="value_integer" optional="hide"/>
<field name="value_float" optional="hide"/>
<field name="value_datetime" optional="hide"/>
<field name="value_text" optional="hide"/>
</field>
<field name="type" position="attributes">
<attribute name="optional">hide</attribute>
</field>
</field>
</record>
<record id="ir_property_view_search" model="ir.ui.view">
<field name="model">ir.property</field>
<field name="inherit_id" ref="base.ir_property_view_search"/>
<field name="arch" type="xml">
<search position="inside">
<group name="groupby">
<filter name="field_groupby" string="Field" context="{'group_by': 'fields_id'}"/>
<filter name="company_groupby" string="Company" context="{'group_by': 'company_id'}"/>
</group>
</search>
</field>
</record>
</odoo>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
Copyright 2022 Akretion France (http://www.akretion.com/) Copyright 2022-2024 Akretion France (https://www.akretion.com/)
@author: Alexis de Lattre <alexis.delattre@akretion.com> @author: Alexis de Lattre <alexis.delattre@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
--> -->

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
Copyright 2015-2022 Akretion France (http://www.akretion.com/) Copyright 2015-2024 Akretion France (https://www.akretion.com/)
@author: Alexis de Lattre <alexis.delattre@akretion.com> @author: Alexis de Lattre <alexis.delattre@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
--> -->
@@ -21,18 +21,20 @@
</field> </field>
</record> </record>
<record id="res_country_search" model="ir.ui.view"> <record id="view_country_search" model="ir.ui.view">
<field name="name">base_usability.res.country.search</field> <field name="name">base_usability.res.country.search</field>
<field name="model">res.country</field> <field name="model">res.country</field>
<field name="inherit_id" ref="base.view_country_search"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<search> <field name="name" position="after">
<field name="name" filter_domain="['|', ('name', 'ilike', self), ('code', '=', self)]" string="Name or Code"/>
<field name="code"/> <field name="code"/>
<field name="currency_id"/> <field name="currency_id"/>
</field>
<field name="phone_code" position="after">
<group string="Group By" name="groupby"> <group string="Group By" name="groupby">
<filter name="currency_groupby" string="Currency" context="{'group_by': 'currency_id'}"/> <filter name="currency_groupby" string="Currency" context="{'group_by': 'currency_id'}"/>
</group> </group>
</search> </field>
</field> </field>
</record> </record>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
Copyright 2014-2022 Akretion (http://www.akretion.com/) Copyright 2014-2024 Akretion (https://www.akretion.com/)
@author: Alexis de Lattre <alexis.delattre@akretion.com> @author: Alexis de Lattre <alexis.delattre@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
--> -->
@@ -14,10 +14,13 @@
<field name="arch" type="xml"> <field name="arch" type="xml">
<!-- Show title not only on Contacts --> <!-- Show title not only on Contacts -->
<xpath expr="//field[@name='child_ids']/form//field[@name='title']" position="attributes"> <xpath expr="//field[@name='child_ids']/form//field[@name='title']" position="attributes">
<attribute name="attrs"></attribute> <attribute name="invisible"></attribute>
</xpath> </xpath>
<!-- Show double VAT partner even when not in editable mode --> <!-- Show double VAT partner even when not in editable mode -->
<div attrs="{'invisible': [('same_vat_partner_id', '=', False)]}" position="attributes"> <div name="warning_tax" position="attributes">
<attribute name="class">alert alert-warning</attribute>
</div>
<div name="warning_company" position="attributes">
<attribute name="class">alert alert-warning</attribute> <attribute name="class">alert alert-warning</attribute>
</div> </div>
</field> </field>
@@ -39,14 +42,10 @@
<field name="model">res.partner</field> <field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_tree"/> <field name="inherit_id" ref="base.view_partner_tree"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<field name="display_name" position="after"> <field name="complete_name" position="after">
<field name="ref" optional="hide"/> <field name="ref" optional="hide"/>
</field> </field>
<field name="phone" position="after">
<field name="mobile" optional="show" widget="phone" class="o_force_ltr"/>
</field>
<field name="city" position="before"> <field name="city" position="before">
<field name="street" optional="hide"/>
<field name="street2" optional="hide"/> <field name="street2" optional="hide"/>
<field name="zip" optional="hide"/> <field name="zip" optional="hide"/>
</field> </field>
@@ -61,7 +60,7 @@
<field name="name" position="attributes"> <field name="name" position="attributes">
<attribute name="string">Name or Email or VAT or Reference</attribute> <attribute name="string">Name or Email or VAT or Reference</attribute>
<!-- for 'ref', change '=' to 'start with' --> <!-- for 'ref', change '=' to 'start with' -->
<attribute name="filter_domain">['|', '|', '|', '|', ('display_name', 'ilike', self), ('ref', '=ilike', self + '%'), ('email', 'ilike', self), ('vat', 'ilike', self), ('company_registry', 'ilike', self)]</attribute> <attribute name="filter_domain">['|', '|', '|', '|', ('complete_name', 'ilike', self), ('ref', '=ilike', self + '%'), ('email', 'ilike', self), ('vat', 'ilike', self), ('company_registry', 'ilike', self)]</attribute>
</field> </field>
<group name="group_by" position="inside"> <group name="group_by" position="inside">
<filter name="group_industry" string="Industry" context="{'group_by': 'industry_id'}"/> <filter name="group_industry" string="Industry" context="{'group_by': 'industry_id'}"/>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
Copyright 2018-2022 Akretion (http://www.akretion.com/) Copyright 2018-2024 Akretion (https://www.akretion.com/)
@author: Alexis de Lattre <alexis.delattre@akretion.com> @author: Alexis de Lattre <alexis.delattre@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
--> -->
@@ -12,7 +12,7 @@
<field name="inherit_id" ref="base.view_partner_bank_tree"/> <field name="inherit_id" ref="base.view_partner_bank_tree"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<field name="bank_name" position="attributes"> <field name="bank_name" position="attributes">
<attribute name="invisible">1</attribute> <attribute name="column_invisible">1</attribute>
</field> </field>
<field name="bank_name" position="after"> <field name="bank_name" position="after">
<field name="bank_id"/> <field name="bank_id"/>

View File

@@ -5,7 +5,7 @@
{ {
'name': 'Partner Tree Default - Account', 'name': 'Partner Tree Default - Account',
'version': '16.0.1.0.0', 'version': '18.0.1.0.0',
'category': 'Partner', 'category': 'Partner',
'license': 'AGPL-3', 'license': 'AGPL-3',
'summary': 'Tree view by default instead of kanban for partners', 'summary': 'Tree view by default instead of kanban for partners',
@@ -21,5 +21,5 @@ This module has been written by Alexis de Lattre <alexis.delattre@akretion.com>
'website': 'http://www.akretion.com', 'website': 'http://www.akretion.com',
'depends': ['account'], 'depends': ['account'],
'data': ['views/res_partner.xml'], 'data': ['views/res_partner.xml'],
'installable': False, 'installable': True,
} }

View File

@@ -8,11 +8,11 @@
<odoo> <odoo>
<record id="account.res_partner_action_customer" model="ir.actions.act_window"> <record id="account.res_partner_action_customer" model="ir.actions.act_window">
<field name="view_mode">tree,form,kanban</field> <field name="view_mode">list,form,kanban</field>
</record> </record>
<record id="account.res_partner_action_supplier" model="ir.actions.act_window"> <record id="account.res_partner_action_supplier" model="ir.actions.act_window">
<field name="view_mode">tree,form,kanban</field> <field name="view_mode">list,form,kanban</field>
</record> </record>
</odoo> </odoo>

View File

@@ -5,7 +5,7 @@
{ {
'name': 'Partner Tree Default - Base', 'name': 'Partner Tree Default - Base',
'version': '16.0.1.0.0', 'version': '18.0.1.0.0',
'category': 'Partner', 'category': 'Partner',
'license': 'AGPL-3', 'license': 'AGPL-3',
'summary': 'Tree view by default instead of kanban for partners', 'summary': 'Tree view by default instead of kanban for partners',
@@ -18,8 +18,8 @@ With this module, when you select a *Customer* or *Vendors* menu entry, you will
This module has been written by Alexis de Lattre <alexis.delattre@akretion.com> from Akretion. This module has been written by Alexis de Lattre <alexis.delattre@akretion.com> from Akretion.
""", """,
'author': 'Akretion', 'author': 'Akretion',
'website': 'http://www.akretion.com', 'website': 'https://github.com/akretion/odoo-usability',
'depends': ['base'], 'depends': ['base'],
'data': ['views/res_partner.xml'], 'data': ['views/res_partner.xml'],
'installable': False, 'installable': True,
} }

View File

@@ -8,7 +8,7 @@
<odoo> <odoo>
<record id="base.action_partner_form" model="ir.actions.act_window"> <record id="base.action_partner_form" model="ir.actions.act_window">
<field name="view_mode">tree,form,kanban</field> <field name="view_mode">list,form,kanban</field>
</record> </record>
<record id="base.action_partner_tree_view1" model="ir.actions.act_window.view"> <record id="base.action_partner_tree_view1" model="ir.actions.act_window.view">
@@ -17,7 +17,7 @@
<record id="base.action_partner_customer_form" model="ir.actions.act_window"> <record id="base.action_partner_customer_form" model="ir.actions.act_window">
<field name="view_mode">tree,form,kanban</field> <field name="view_mode">list,form,kanban</field>
</record> </record>
<record id="base.action_partner_customer_form_view2" model="ir.actions.act_window.view"> <!-- Stupid XMLID, it's a tree --> <record id="base.action_partner_customer_form_view2" model="ir.actions.act_window.view"> <!-- Stupid XMLID, it's a tree -->
@@ -25,7 +25,7 @@
</record> </record>
<record id="base.action_partner_supplier_form" model="ir.actions.act_window"> <record id="base.action_partner_supplier_form" model="ir.actions.act_window">
<field name="view_mode">tree,form,kanban</field> <field name="view_mode">list,form,kanban</field>
</record> </record>
<record id="base.action_partner_vendor_form_view2" model="ir.actions.act_window.view"> <!-- Stupid XMLID, it's a tree --> <record id="base.action_partner_vendor_form_view2" model="ir.actions.act_window.view"> <!-- Stupid XMLID, it's a tree -->

View File

@@ -5,7 +5,7 @@
{ {
'name': 'Partner Tree Default - Contacts', 'name': 'Partner Tree Default - Contacts',
'version': '16.0.1.0.0', 'version': '18.0.1.0.0',
'category': 'Partner', 'category': 'Partner',
'license': 'AGPL-3', 'license': 'AGPL-3',
'summary': 'Tree view by default instead of kanban for partners', 'summary': 'Tree view by default instead of kanban for partners',
@@ -21,5 +21,5 @@ This module has been written by Alexis de Lattre <alexis.delattre@akretion.com>
'website': 'http://www.akretion.com', 'website': 'http://www.akretion.com',
'depends': ['contacts'], 'depends': ['contacts'],
'data': ['views/res_partner.xml'], 'data': ['views/res_partner.xml'],
'installable': False, 'installable': True,
} }

View File

@@ -8,7 +8,7 @@
<odoo> <odoo>
<record id="contacts.action_contacts" model="ir.actions.act_window"> <record id="contacts.action_contacts" model="ir.actions.act_window">
<field name="view_mode">tree,form,kanban,activity</field> <field name="view_mode">list,form,kanban,activity</field>
</record> </record>
<record id="contacts.action_contacts_view_tree" model="ir.actions.act_window.view"> <record id="contacts.action_contacts_view_tree" model="ir.actions.act_window.view">