Port base_company_extension to new API

This commit is contained in:
Alexis de Lattre
2015-10-29 14:03:21 +01:00
parent 7c7ea430cb
commit b1bb108585
4 changed files with 19 additions and 37 deletions

View File

@@ -1,23 +1,3 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Base Company Extension module for OpenERP/Odoo
# Copyright (C) 2014 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
# -*- coding: utf-8 -*-
from . import company

View File

@@ -1,8 +1,8 @@
# -*- encoding: utf-8 -*-
# -*- coding: utf-8 -*-
##############################################################################
#
# Base Company Extension module for OpenERP/Odoo
# Copyright (C) 2014 Akretion (http://www.akretion.com)
# Base Company Extension module for Odoo
# Copyright (C) 2014-2015 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
#
# This program is free software: you can redistribute it and/or modify
@@ -31,7 +31,11 @@
Base Company Extension
======================
This module adds a field *Capital Amount* on the Company form, and adds a related field for title.
This module adds 2 fields on the Company :
* *Capital Amount*
* *Legal Form* (technical name: title, configured as a related field of res.partner)
""",
'author': 'Akretion',
'website': 'http://www.akretion.com',

View File

@@ -1,8 +1,8 @@
# -*- encoding: utf-8 -*-
# -*- coding: utf-8 -*-
##############################################################################
#
# Base Company Extension module for OpenERP/Odoo
# Copyright (C) 2014 Akretion (http://www.akretion.com)
# Base Company Extension module for Odoo
# Copyright (C) 2014-2015 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
#
# This program is free software: you can redistribute it and/or modify
@@ -20,18 +20,16 @@
#
##############################################################################
from openerp.osv import orm, fields
from openerp import models, fields
class res_company(orm.Model):
class ResCompany(models.Model):
_inherit = "res.company"
_columns = {
'capital_amount': fields.integer('Capital Amount'),
'title': fields.related(
'partner_id', 'title', type='many2one',
relation='res.partner.title', string='Legal Form'),
}
capital_amount = fields.Integer(string='Capital Amount')
title = fields.Many2one(
'res.partner.title', related='partner_id.title',
string='Legal Form')
_sql_constraints = [(
'capital_amount_positive',

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2014 Akretion (http://www.akretion.com/)
Copyright (C) 2014-2015 Akretion (http://www.akretion.com/)
@author Alexis de Lattre <alexis.delattre@akretion.com>
The licence is in the file __openerp__.py
-->