[IMP] pre-commit: first run on whole repo
This commit is contained in:
@@ -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,
|
||||
}
|
||||
|
||||
@@ -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.",
|
||||
)
|
||||
]
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user