[REM] fleet_account: replaced by account_disallowed_expenses_fleet

Task: 2186429
This commit is contained in:
william
2020-08-19 14:22:43 +00:00
committed by wan
parent 4029b84be8
commit db9da432b7
6 changed files with 0 additions and 118 deletions
-4
View File
@@ -1,4 +0,0 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import models
-18
View File
@@ -1,18 +0,0 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Fleet - Account',
'version': '1.0',
'sequence': 165,
'category': 'Human Resources/Fleet',
'website': 'https://www.odoo.com/page/fleet',
'summary': 'Manage your accounting for fleet',
'depends': [
'fleet',
'account',
],
'data': [
'views/fleet_views.xml',
],
'application': False,
}
@@ -1,49 +0,0 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * fleet_account
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server saas~13.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-12-16 08:45+0000\n"
"PO-Revision-Date: 2019-12-16 08:45+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: fleet_account
#: model_terms:ir.ui.view,arch_db:fleet_account.fleet_vehicle_view_form_inherit_account
msgid "Accounting"
msgstr ""
#. module: fleet_account
#: model:ir.model.fields,field_description:fleet_account.field_fleet_vehicle__analytic_account_id
#: model_terms:ir.ui.view,arch_db:fleet_account.fleet_vehicle_view_form_inherit_account
msgid "Analytic Account"
msgstr ""
#. module: fleet_account
#: model:ir.model.fields,help:fleet_account.field_fleet_vehicle__analytic_account_id
msgid ""
"Analytic account to which this vehicle is linked for financial management."
msgstr ""
#. module: fleet_account
#: model_terms:ir.ui.view,arch_db:fleet_account.fleet_vehicle_view_form_inherit_account
msgid "Generate Analytic Account"
msgstr ""
#. module: fleet_account
#: code:addons/fleet_account/models/fleet_vehicle.py:0
#, python-format
msgid "Sorry, you must be at least a fleet user to make this action."
msgstr ""
#. module: fleet_account
#: model:ir.model,name:fleet_account.model_fleet_vehicle
msgid "Vehicle"
msgstr ""
-4
View File
@@ -1,4 +0,0 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import fleet_vehicle
@@ -1,22 +0,0 @@
# -*- coding:utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models, _
from odoo.exceptions import AccessError
class FleetVehicle(models.Model):
_inherit = 'fleet.vehicle'
analytic_account_id = fields.Many2one('account.analytic.account', string='Analytic Account', copy=False, ondelete='set null',
check_company=True, help="Analytic account to which this vehicle is linked for financial management.")
def action_generate_analytic_account(self):
if not self.env.user.has_group('fleet.fleet_group_user'):
raise AccessError(_("Sorry, you must be at least a fleet user to make this action."))
for vehicle in self:
analytic_account = self.env['account.analytic.account'].sudo().create([{
'name': vehicle._get_analytic_name(),
'company_id': vehicle.company_id.id or self.env.company.id,
}])
vehicle.write({'analytic_account_id': analytic_account.id})
@@ -1,21 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="fleet_vehicle_view_form_inherit_account" model="ir.ui.view">
<field name="name">fleet.vehicle.form.inherit.account</field>
<field name="model">fleet.vehicle</field>
<field name="inherit_id" ref="fleet.fleet_vehicle_view_form"/>
<field name="arch" type="xml">
<xpath expr="//group[@name='contract']" position="after">
<group string="Accounting">
<label for="analytic_account_id" string="Analytic Account"/>
<div>
<field name="analytic_account_id" class="oe_inline"/>
<button string="Generate Analytic Account" name="action_generate_analytic_account" type="object" class="btn-link oe_inline" attrs="{'invisible': [('analytic_account_id', '!=', False)]}"/>
</div>
</group>
</xpath>
</field>
</record>
</odoo>