[REF] account: remove unused views and model
This commit deletes all unsused views from the following models: - `account.chart.template` - `account.account.template` - `account.common.report` We also take the oppoturnity to remove ´account.common.report´. This model is unused since https://github.com/odoo/odoo/commit/b7232b14b7f2423241b24b4eef1300f1a1b425cf#diff-61c2936e0566472acce71f3bb90f47ca5a709680322621dbcb735e3e2bd92f7eL11 This is a preliminary work in order to convert form views into grid. Related commit: https://github.com/odoo/odoo/commit/c04065abd8f62c9a211c8fa824f5eecf68e61b73#diff-f292b09f5efe026c65c27c5f0175b719a5d66999cbb15832c211796617ac082dL1976 closes odoo/odoo#99810 Related: odoo/upgrade#3875 Signed-off-by: William André (wan) <wan@odoo.com>
This commit is contained in:
@@ -52,7 +52,6 @@ You could use this simplified accounting in case you work with an (external) acc
|
||||
'views/report_invoice.xml',
|
||||
'report/account_invoice_report_view.xml',
|
||||
'views/account_cash_rounding_view.xml',
|
||||
'wizard/account_report_common_view.xml',
|
||||
'views/ir_module_views.xml',
|
||||
'views/res_config_settings_views.xml',
|
||||
'views/partner_view.xml',
|
||||
|
||||
@@ -126,7 +126,6 @@ access_account_resequence,access.account.resequence.wizard,model_account_reseque
|
||||
access_validate_account_move,access.validate.account.move,model_validate_account_move,account.group_account_invoice,1,1,1,0
|
||||
access_cash_box_out,access.cash.box.out,model_cash_box_out,account.group_account_user,1,1,1,0
|
||||
access_account_move_reversal,access.account.move.reversal,model_account_move_reversal,account.group_account_invoice,1,1,1,0
|
||||
access_account_common_report,access.account.common.report,model_account_common_report,account.group_account_user,1,1,1,0
|
||||
access_account_financial_year_op,access.account.financial.year.op,model_account_financial_year_op,account.group_account_manager,1,1,1,0
|
||||
access_account_setup_bank_manual_config,access.account.setup.bank.manual.config,model_account_setup_bank_manual_config,account.group_account_manager,1,1,1,0
|
||||
access_account_invoice_send,access.account.invoice.send,model_account_invoice_send,account.group_account_invoice,1,1,1,0
|
||||
|
||||
|
@@ -2,127 +2,6 @@
|
||||
<odoo>
|
||||
<data>
|
||||
|
||||
<!-- Chart of Accounts Templates -->
|
||||
|
||||
<record id="view_account_chart_template_form" model="ir.ui.view">
|
||||
<field name="name">account.chart.template.form</field>
|
||||
<field name="model">account.chart.template</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Chart of Accounts Template">
|
||||
<group col="4">
|
||||
<field name="name"/>
|
||||
<field name="parent_id" />
|
||||
<field name="bank_account_code_prefix"/>
|
||||
<field name="cash_account_code_prefix"/>
|
||||
<field name="transfer_account_code_prefix"/>
|
||||
<field name="code_digits" />
|
||||
<field name="visible" />
|
||||
</group>
|
||||
<separator string="Default Taxes" colspan="4"/>
|
||||
<field name="tax_template_ids" colspan="4" nolabel="1"/>
|
||||
<separator string="Properties" colspan="4"/>
|
||||
<group col="4">
|
||||
<field name="property_account_receivable_id"/>
|
||||
<field name="property_account_payable_id"/>
|
||||
<field name="property_account_expense_categ_id"/>
|
||||
<field name="property_account_income_categ_id"/>
|
||||
<field name="property_account_expense_id"/>
|
||||
<field name="property_account_income_id"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_account_chart_template_seacrh" model="ir.ui.view">
|
||||
<field name="name">account.chart.template.search</field>
|
||||
<field name="model">account.chart.template</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Chart of Account Templates">
|
||||
<field name="name" string="Account Template"/>
|
||||
<field name="bank_account_code_prefix"/>
|
||||
<field name="cash_account_code_prefix"/>
|
||||
<field name="transfer_account_code_prefix"/>
|
||||
<group expand="0" string="Group By">
|
||||
<filter string="Receivable Account" name="receivalbeacc" domain="[]" context="{'group_by':'property_account_receivable_id'}"/>
|
||||
<filter string="Payable Account" name="payableacc" domain="[]" context="{'group_by':'property_account_payable_id'}"/>
|
||||
<filter string="Income Account" name="incomeacc" domain="[]" context="{'group_by':'property_account_income_categ_id'}"/>
|
||||
<filter string="Expense Account" name="expenseacc" domain="[]" context="{'group_by':'property_account_expense_categ_id'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_account_chart_template_tree" model="ir.ui.view">
|
||||
<field name="name">account.chart.template.tree</field>
|
||||
<field name="model">account.chart.template</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Chart of Accounts Template">
|
||||
<field name="name"/>
|
||||
<field name="property_account_receivable_id" invisible="1"/>
|
||||
<field name="property_account_payable_id" invisible="1"/>
|
||||
<field name="property_account_expense_categ_id" invisible="1"/>
|
||||
<field name="property_account_income_categ_id" invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record id="action_account_chart_template_form" model="ir.actions.act_window">
|
||||
<field name="name">Chart of Accounts Templates</field>
|
||||
<field name="res_model">account.chart.template</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
|
||||
|
||||
<!-- Account Templates -->
|
||||
|
||||
<record id="view_account_template_form" model="ir.ui.view">
|
||||
<field name="name">account.account.template.form</field>
|
||||
<field name="model">account.account.template</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Account Template">
|
||||
<group col="4">
|
||||
<field name="name"/>
|
||||
<field name="code"/>
|
||||
<newline/>
|
||||
<field name="account_type" widget="account_type_selection"/>
|
||||
<field name="currency_id" options="{'no_create': True}" groups="base.group_multi_currency"/>
|
||||
<field name="tag_ids" domain="[('applicability', '=', 'accounts')]" widget="many2many_tags" context="{'default_applicability': 'accounts'}"/>
|
||||
<field name="reconcile"/>
|
||||
<field name="chart_template_id"/>
|
||||
</group>
|
||||
<separator string="Default Taxes"/>
|
||||
<field name="tax_ids"/>
|
||||
<separator string="Notes"/>
|
||||
<field name="note" placeholder="Internal notes..."/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_account_template_tree" model="ir.ui.view">
|
||||
<field name="name">account.account.template.tree</field>
|
||||
<field name="model">account.account.template</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Account Template">
|
||||
<field name="code"/>
|
||||
<field name="name"/>
|
||||
<field name="account_type" invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_account_template_search" model="ir.ui.view">
|
||||
<field name="name">account.account.template.search</field>
|
||||
<field name="model">account.account.template</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Account Templates">
|
||||
<field name="name" filter_domain="['|', ('name','ilike',self), ('code','ilike',self)]" string="Account Template"/>
|
||||
<field name="account_type"/>
|
||||
<group expand="0" string="Group By">
|
||||
<filter string="Account Type" name="accounttype" domain="[]" context="{'group_by':'account_type'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Account Tax Templates -->
|
||||
|
||||
<record id="view_account_tax_template_form" model="ir.ui.view">
|
||||
|
||||
@@ -7,7 +7,6 @@ from . import account_unreconcile
|
||||
from . import account_validate_account_move
|
||||
from . import pos_box
|
||||
from . import account_move_reversal
|
||||
from . import account_report_common
|
||||
from . import account_resequence
|
||||
from . import setup_wizards
|
||||
from . import account_invoice_send
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from odoo import api, fields, models, _
|
||||
from odoo.tools.misc import get_lang
|
||||
|
||||
|
||||
class AccountCommonReport(models.TransientModel):
|
||||
_name = "account.common.report"
|
||||
_description = "Account Common Report"
|
||||
|
||||
company_id = fields.Many2one('res.company', string='Company', required=True, readonly=True, default=lambda self: self.env.company)
|
||||
journal_ids = fields.Many2many(
|
||||
comodel_name='account.journal',
|
||||
string='Journals',
|
||||
required=True,
|
||||
default=lambda self: self.env['account.journal'].search([('company_id', '=', self.company_id.id)]),
|
||||
domain="[('company_id', '=', company_id)]",
|
||||
)
|
||||
date_from = fields.Date(string='Start Date')
|
||||
date_to = fields.Date(string='End Date')
|
||||
target_move = fields.Selection([('posted', 'All Posted Entries'),
|
||||
('all', 'All Entries'),
|
||||
], string='Target Moves', required=True, default='posted')
|
||||
|
||||
@api.onchange('company_id')
|
||||
def _onchange_company_id(self):
|
||||
if self.company_id:
|
||||
self.journal_ids = self.env['account.journal'].search(
|
||||
[('company_id', '=', self.company_id.id)])
|
||||
else:
|
||||
self.journal_ids = self.env['account.journal'].search([])
|
||||
|
||||
def _build_contexts(self, data):
|
||||
result = {}
|
||||
result['journal_ids'] = 'journal_ids' in data['form'] and data['form']['journal_ids'] or False
|
||||
result['state'] = 'target_move' in data['form'] and data['form']['target_move'] or ''
|
||||
result['date_from'] = data['form']['date_from'] or False
|
||||
result['date_to'] = data['form']['date_to'] or False
|
||||
result['strict_range'] = True if result['date_from'] else False
|
||||
result['company_id'] = data['form']['company_id'][0] or False
|
||||
return result
|
||||
|
||||
def _print_report(self, data):
|
||||
raise NotImplementedError()
|
||||
|
||||
def check_report(self):
|
||||
self.ensure_one()
|
||||
data = {}
|
||||
data['ids'] = self.env.context.get('active_ids', [])
|
||||
data['model'] = self.env.context.get('active_model', 'ir.ui.menu')
|
||||
data['form'] = self.read(['date_from', 'date_to', 'journal_ids', 'target_move', 'company_id'])[0]
|
||||
used_context = self._build_contexts(data)
|
||||
data['form']['used_context'] = dict(used_context, lang=get_lang(self.env).code)
|
||||
return self.with_context(discard_logo_check=True)._print_report(data)
|
||||
@@ -1,26 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<record id="account_common_report_view" model="ir.ui.view">
|
||||
<field name="name">Common Report</field>
|
||||
<field name="model">account.common.report</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Report Options">
|
||||
<group col="4">
|
||||
<field name="target_move" widget="radio"/>
|
||||
<field name="date_from"/>
|
||||
<field name="date_to"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="journal_ids" widget="many2many_tags" options="{'no_create': True}"/>
|
||||
<field name="company_id" invisible="1"/>
|
||||
</group>
|
||||
<footer>
|
||||
<button name="check_report" string="Print" type="object" default_focus="1" class="oe_highlight" data-hotkey="q"/>
|
||||
<button string="Cancel" class="btn btn-secondary" special="cancel" data-hotkey="z" />
|
||||
</footer>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user