Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IMP] base, account: remove l10n install banner from company #159245

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 11 additions & 0 deletions addons/account/models/company.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,17 @@ def write(self, values):

return super(ResCompany, self).write(values)

def action_config_account(self):
return {
'type': 'ir.actions.act_window',
'res_model': 'res.config.settings',
'view_mode': 'form',
'context': {
'module': 'account',
'default_company_id': self.id,
},
}

@api.model
def setting_init_bank_account_action(self):
""" Called by the 'Bank Accounts' button of the setup bar or from the Financial configuration menu."""
Expand Down
10 changes: 10 additions & 0 deletions addons/account/views/res_company_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@
<field name="message_ids"/>
</div>
</xpath>
<xpath expr="//sheet" position="before">
<field name="chart_template" invisible="1"/>
<div class="alert alert-info" role="alert" invisible="chart_template or not country_id">
Localization features are available for this country:
<button name="action_config_account"
type="object"
string="Go to Configuration Now"
class="btn btn-link p-0 align-baseline"/>
</div>
</xpath>
</field>
</record>

Expand Down
4 changes: 1 addition & 3 deletions odoo/addons/base/models/res_company.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ def _default_currency_id(self):
color = fields.Integer(compute='_compute_color', inverse='_inverse_color')
layout_background = fields.Selection([('Blank', 'Blank'), ('Geometric', 'Geometric'), ('Custom', 'Custom')], default="Blank", required=True)
layout_background_image = fields.Binary("Background Image")
# TODO: Remove uninstalled_l10n_module_ids in master
uninstalled_l10n_module_ids = fields.Many2many('ir.module.module', compute='_compute_uninstalled_l10n_module_ids')
_sql_constraints = [
('name_uniq', 'unique (name)', 'The company name must be unique!')
Expand Down Expand Up @@ -220,9 +221,6 @@ def _compute_uninstalled_l10n_module_ids(self):
for company in self:
company.uninstalled_l10n_module_ids = self.env['ir.module.module'].browse(mapping.get(company.country_id.id))

def install_l10n_modules(self):
return self.uninstalled_l10n_module_ids.button_immediate_install()

@api.model
def _get_view(self, view_id=None, view_type='form', **options):
delegated_fnames = set(self._get_company_root_delegated_field_names())
Expand Down
9 changes: 0 additions & 9 deletions odoo/addons/base/views/res_company_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,6 @@
<field name="arch" type="xml">
<form string="Company" duplicate="0">
<field name="all_child_ids" invisible="1"/>
<field name="uninstalled_l10n_module_ids" invisible="1"/>

<div class="alert alert-info" role="alert" invisible="not uninstalled_l10n_module_ids">
Localization features are available for this country:
<button name="install_l10n_modules"
type="object"
string="Install"
class="btn btn-link p-0 align-baseline"/>
</div>
<sheet>
<div class="oe_button_box" name="button_box">
<button class="oe_stat_button"
Expand Down