[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:
@@ -4,7 +4,7 @@
|
||||
|
||||
{
|
||||
'name': 'Base Usability',
|
||||
'version': '16.0.1.0.0',
|
||||
'version': '18.0.1.0.0',
|
||||
'category': 'Partner',
|
||||
'license': 'AGPL-3',
|
||||
'summary': 'Better usability in base module',
|
||||
@@ -21,7 +21,6 @@
|
||||
'views/ir_config_parameter.xml',
|
||||
'views/ir_module.xml',
|
||||
'views/ir_sequence.xml',
|
||||
'views/ir_property.xml',
|
||||
],
|
||||
'installable': False,
|
||||
'installable': True,
|
||||
}
|
||||
|
||||
@@ -4,4 +4,3 @@ from . import res_partner_bank
|
||||
from . import res_company
|
||||
from . import ir_mail_server
|
||||
from . import ir_model
|
||||
from . import ir_model_fields
|
||||
|
||||
@@ -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>
|
||||
# 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):
|
||||
# Start copy from native method
|
||||
smtp_from, smtp_to_list, message = self._prepare_email_message(
|
||||
message, smtp_session)
|
||||
message, smtp)
|
||||
# End copy from native method
|
||||
logger.info(
|
||||
"Sending email from '%s' to '%s' Cc '%s' Bcc '%s' "
|
||||
|
||||
@@ -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>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
@@ -9,8 +9,6 @@ class IrModel(models.Model):
|
||||
_inherit = 'ir.model'
|
||||
|
||||
@api.depends('name', 'model')
|
||||
def name_get(self):
|
||||
res = []
|
||||
def _compute_display_name(self):
|
||||
for rec in self:
|
||||
res.append((rec.id, '%s (%s)' % (rec.name, rec.model)))
|
||||
return res
|
||||
rec.display_name = f'{rec.name} ({rec.model})'
|
||||
|
||||
@@ -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
|
||||
@@ -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>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
|
||||
@@ -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>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
|
||||
@@ -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>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# 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
|
||||
from odoo.tools.misc import format_datetime
|
||||
|
||||
@@ -14,11 +14,9 @@ class ResUsers(models.Model):
|
||||
|
||||
@api.model
|
||||
def _script_partners_linked_to_users_no_company(self):
|
||||
if self.env.user.id != SUPERUSER_ID:
|
||||
self = self.sudo()
|
||||
logger.info(
|
||||
'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:
|
||||
if user.partner_id.company_id:
|
||||
user.partner_id.write({'company_id': False})
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?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>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
<field name="model">ir.config_parameter</field>
|
||||
<field name="inherit_id" ref="base.view_ir_config_list"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//tree/field[last()]" position="after">
|
||||
<field name="write_date"/>
|
||||
</xpath>
|
||||
<list position="inside">
|
||||
<field name="write_date" optional="show"/>
|
||||
</list>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?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>
|
||||
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="arch" type="xml">
|
||||
<xpath expr="//filter[@name='extra']" position="after">
|
||||
<separator/>
|
||||
<filter name="installable" string="Installable" domain="[('state', '!=', 'uninstallable')]"/>
|
||||
</xpath>
|
||||
</field>
|
||||
|
||||
@@ -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>
|
||||
@@ -1,6 +1,6 @@
|
||||
<?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>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?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>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
@@ -21,18 +21,20 @@
|
||||
</field>
|
||||
</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="model">res.country</field>
|
||||
<field name="inherit_id" ref="base.view_country_search"/>
|
||||
<field name="arch" type="xml">
|
||||
<search>
|
||||
<field name="name" filter_domain="['|', ('name', 'ilike', self), ('code', '=', self)]" string="Name or Code"/>
|
||||
<field name="name" position="after">
|
||||
<field name="code"/>
|
||||
<field name="currency_id"/>
|
||||
</field>
|
||||
<field name="phone_code" position="after">
|
||||
<group string="Group By" name="groupby">
|
||||
<filter name="currency_groupby" string="Currency" context="{'group_by': 'currency_id'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?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>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
@@ -14,10 +14,13 @@
|
||||
<field name="arch" type="xml">
|
||||
<!-- Show title not only on Contacts -->
|
||||
<xpath expr="//field[@name='child_ids']/form//field[@name='title']" position="attributes">
|
||||
<attribute name="attrs"></attribute>
|
||||
<attribute name="invisible"></attribute>
|
||||
</xpath>
|
||||
<!-- 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>
|
||||
</div>
|
||||
</field>
|
||||
@@ -39,14 +42,10 @@
|
||||
<field name="model">res.partner</field>
|
||||
<field name="inherit_id" ref="base.view_partner_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="display_name" position="after">
|
||||
<field name="complete_name" position="after">
|
||||
<field name="ref" optional="hide"/>
|
||||
</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="street" optional="hide"/>
|
||||
<field name="street2" optional="hide"/>
|
||||
<field name="zip" optional="hide"/>
|
||||
</field>
|
||||
@@ -61,7 +60,7 @@
|
||||
<field name="name" position="attributes">
|
||||
<attribute name="string">Name or Email or VAT or Reference</attribute>
|
||||
<!-- 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>
|
||||
<group name="group_by" position="inside">
|
||||
<filter name="group_industry" string="Industry" context="{'group_by': 'industry_id'}"/>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?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>
|
||||
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="arch" type="xml">
|
||||
<field name="bank_name" position="attributes">
|
||||
<attribute name="invisible">1</attribute>
|
||||
<attribute name="column_invisible">1</attribute>
|
||||
</field>
|
||||
<field name="bank_name" position="after">
|
||||
<field name="bank_id"/>
|
||||
|
||||
Reference in New Issue
Block a user