Minor update

This commit is contained in:
Alexis de Lattre
2016-10-13 17:06:48 +02:00
parent 64e08b93de
commit c492904e2b
3 changed files with 5 additions and 26 deletions

View File

@@ -174,7 +174,9 @@ class AccountInvoiceLine(orm.Model):
# We write standard_price_company_currency even on supplier invoice/refunds
# because we don't have access to the 'type' of the invoice
def create(self, cr, uid, vals, context=None):
if vals.get('product_id'):
if (
vals.get('product_id') and
'standard_price_company_currency' not in vals):
pp = self.pool['product.product'].browse(
cr, uid, vals['product_id'], context=context)
std_price = pp.standard_price

View File

@@ -1,23 +0,0 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Base Partner Always Multi Contacts module for OpenERP
# 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/>.
#
##############################################################################

View File

@@ -30,12 +30,12 @@ class ProductTemplate(orm.Model):
if pt.intrastat_type == 'product' and pt.type == 'service':
raise orm.except_orm(
_("Error"),
_("On the product %s, you cannot set Product Type to "
_("On the product '%s', you cannot set Product Type to "
"'Service' and Intrastat Type to 'Product'.") % pt.name)
if pt.intrastat_type == 'service' and pt.type == 'product':
raise orm.except_orm(
_("Error"),
_("On the product %s, you cannot set Intrastat Type to "
_("On the product '%s', you cannot set Intrastat Type to "
"'Service' and Product Type to 'Stockable product' "
"(but you can set Product Type to 'Consumable' or "
"'Service').") % pt.name)