[IMP] pre-commit: first run on whole repo

This commit is contained in:
Kevin Khao
2021-11-26 18:54:38 +03:00
parent a04b8980e1
commit 167aefee13
289 changed files with 6020 additions and 4170 deletions

View File

@@ -3,15 +3,15 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': 'Base Company Extension',
'version': '14.0.1.0.0',
'category': 'Partner',
'license': 'AGPL-3',
'summary': 'Adds capital and title on company',
'author': 'Akretion',
'website': 'http://www.akretion.com',
"name": "Base Company Extension",
"version": "14.0.1.0.0",
"category": "Partner",
"license": "AGPL-3",
"summary": "Adds capital and title on company",
"author": "Akretion",
"website": "https://github.com/OCA/odoo-usability",
# I depend on base_usability only for _report_company_legal_name()
'depends': ['base_usability'],
'data': ['company_view.xml'],
'installable': True,
"depends": ["base_usability"],
"data": ["company_view.xml"],
"installable": True,
}

View File

@@ -2,27 +2,30 @@
# @author Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models, fields
from odoo import fields, models
class ResCompany(models.Model):
_inherit = "res.company"
capital_amount = fields.Monetary(string='Capital Amount')
capital_amount = fields.Monetary(string="Capital Amount")
# in v9, title is only for contacts, not for companies
legal_type = fields.Char(
string="Legal Type", help="Type of Company, e.g. SARL, SAS, ...")
string="Legal Type", help="Type of Company, e.g. SARL, SAS, ..."
)
def _report_company_legal_name(self):
self.ensure_one()
if self.legal_type:
name = '%s %s' % (self.name, self.legal_type)
name = "%s %s" % (self.name, self.legal_type)
else:
name = self.name
return name
_sql_constraints = [(
'capital_amount_positive',
'CHECK (capital_amount >= 0)',
"The value of the field 'Capital Amount' must be positive."
)]
_sql_constraints = [
(
"capital_amount_positive",
"CHECK (capital_amount >= 0)",
"The value of the field 'Capital Amount' must be positive.",
)
]

View File

@@ -1,10 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<!--
Copyright 2014-2020 Akretion (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="view_company_form" model="ir.ui.view">
@@ -13,8 +12,8 @@
<field name="inherit_id" ref="base.view_company_form" />
<field name="arch" type="xml">
<field name="company_registry" position="after">
<field name="capital_amount"/>
<field name="legal_type"/>
<field name="capital_amount" />
<field name="legal_type" />
</field>
</field>
</record>