|
|
@ -1,26 +1,8 @@ |
|
|
|
# -*- coding: utf-8 -*- |
|
|
|
############################################################################## |
|
|
|
# |
|
|
|
# OpenERP, Open Source Management Solution |
|
|
|
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). |
|
|
|
# Copyright (C) 2013 initOS GmbH & Co. KG (<http://www.initos.com>). |
|
|
|
# Author Thomas Rehn <thomas.rehn at initos.com> |
|
|
|
# Copyright (C) 2016 Camptocamp SA (<http://www.camptocamp.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/>. |
|
|
|
# |
|
|
|
############################################################################## |
|
|
|
# Copyright 2004-2009 Tiny SPRL (<http://tiny.be>). |
|
|
|
# Copyright 2013 initOS GmbH & Co. KG (<http://www.initos.com>). |
|
|
|
# Copyright 2016 Tecnativa - Vicent Cubells |
|
|
|
# Copyright 2016 Camptocamp - Akim Juillerat (<http://www.camptocamp.com>). |
|
|
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|
|
|
|
|
|
|
from odoo import api, models, exceptions, _ |
|
|
|
|
|
|
@ -53,7 +35,6 @@ class ResPartner(models.Model): |
|
|
|
if not vals.get('ref') and partner._needsRef(vals) and \ |
|
|
|
not partner.ref: |
|
|
|
vals['ref'] = self._get_next_ref(vals=vals) |
|
|
|
|
|
|
|
super(ResPartner, partner).write(vals) |
|
|
|
return True |
|
|
|
|
|
|
@ -62,9 +43,6 @@ class ResPartner(models.Model): |
|
|
|
""" |
|
|
|
Checks whether a sequence value should be assigned to a partner's 'ref' |
|
|
|
|
|
|
|
:param cr: database cursor |
|
|
|
:param uid: current user id |
|
|
|
:param id: id of the partner object |
|
|
|
:param vals: known field values of the partner object |
|
|
|
:return: true iff a sequence value should be assigned to the\ |
|
|
|
partner's 'ref' |
|
|
|