2012-03-02 12:43:57 +00:00
# -*- coding: utf-8 -*-
##############################################################################
#
2012-04-03 08:44:25 +00:00
# OpenERP, Open Source Business Applications
# Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>).
2012-03-02 12:43:57 +00:00
#
# 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/>.
#
##############################################################################
2012-12-06 14:56:32 +00:00
from openerp . osv import fields , osv
from openerp . tools . translate import _
2012-03-02 12:43:57 +00:00
2012-03-22 11:03:58 +00:00
class purchase_config_settings ( osv . osv_memory ) :
_name = ' purchase.config.settings '
2012-03-05 09:09:23 +00:00
_inherit = ' res.config.settings '
2012-03-02 12:43:57 +00:00
_columns = {
2012-03-22 10:58:33 +00:00
' default_invoice_method ' : fields . selection (
2012-09-12 07:14:13 +00:00
[ ( ' manual ' , ' Based on purchase order lines ' ) ,
2013-01-18 07:26:42 +00:00
( ' picking ' , ' Based on incoming shipments ' ) ,
2012-09-14 07:45:36 +00:00
( ' order ' , ' Pre-generate draft invoices based on purchase orders ' ) ,
2012-09-12 07:14:13 +00:00
] , ' Default invoicing control method ' , required = True , default_model = ' purchase.order ' ) ,
' group_purchase_pricelist ' : fields . boolean ( " Manage pricelist per supplier " ,
2012-03-22 13:03:20 +00:00
implied_group = ' product.group_purchase_pricelist ' ,
2013-07-24 13:45:48 +00:00
help = ' Allows to manage different prices based on rules per category of Supplier. \n '
2013-09-17 13:08:14 +00:00
' Example: 10 % f or retailers, promotion of 5 EUR on this product, etc. ' ) ,
2012-09-12 07:14:13 +00:00
' group_uom ' : fields . boolean ( " Manage different units of measure for products " ,
2012-03-22 13:03:20 +00:00
implied_group = ' product.group_uom ' ,
2012-04-03 09:52:10 +00:00
help = """ Allows you to select and maintain different units of measure for products. """ ) ,
2014-04-15 11:29:15 +00:00
' group_costing_method ' : fields . boolean ( " Use ' Real Price ' or ' Average ' costing methods. " ,
implied_group = ' stock_account.group_inventory_valuation ' ,
2012-08-22 12:15:15 +00:00
help = """ Allows you to compute product cost price based on average cost. """ ) ,
2012-09-12 07:14:13 +00:00
' module_warning ' : fields . boolean ( " Alerts by products or supplier " ,
2013-07-24 13:45:48 +00:00
help = ' Allow to configure notification on products and trigger them when a user wants to purchase a given product or a given supplier. \n '
2013-09-17 13:08:14 +00:00
' Example: Product: this product is deprecated, do not purchase more than 5. \n '
' Supplier: don \' t forget to ask for an express delivery. ' ) ,
2012-09-12 07:14:13 +00:00
' module_purchase_double_validation ' : fields . boolean ( " Force two levels of approvals " ,
2013-07-24 13:45:48 +00:00
help = ' Provide a double validation mechanism for purchases exceeding minimum amount. \n '
2013-09-17 13:08:14 +00:00
' -This installs the module purchase_double_validation. ' ) ,
2013-06-25 09:48:37 +00:00
' module_purchase_requisition ' : fields . boolean ( " Manage calls for bids " ,
help = """ Calls for bids are used when you want to generate requests for quotations to several suppliers for a given set of products.
2012-06-25 12:34:21 +00:00
You can configure per product if you directly do a Request for Quotation
2013-06-25 09:48:37 +00:00
to one supplier or if you want a Call for Bids to compare offers from several suppliers . """ ),
' group_advance_purchase_requisition ' : fields . boolean ( " Choose from several bids in a call for bids " ,
2013-05-29 15:43:05 +00:00
implied_group = ' purchase.group_advance_bidding ' ,
2013-06-25 09:48:37 +00:00
help = """ In the process of a public bidding, you can compare the bid lines and choose for each requested product from which bid you
buy which quantity """ ),
2012-09-17 10:01:52 +00:00
' module_purchase_analytic_plans ' : fields . boolean ( ' Use multiple analytic accounts on purchase orders ' ,
2013-09-17 13:08:14 +00:00
help = ' Allows the user to maintain several analysis plans. These let you split lines on a purchase order between several accounts and analytic plans. \n '
' -This installs the module purchase_analytic_plans. ' ) ,
2012-09-17 10:01:52 +00:00
' group_analytic_account_for_purchases ' : fields . boolean ( ' Analytic accounting for purchases ' ,
implied_group = ' purchase.group_analytic_accounting ' ,
help = " Allows you to specify an analytic account on purchase orders. " ) ,
2013-12-04 07:34:02 +00:00
' module_stock_dropshipping ' : fields . boolean ( " Manage dropshipping " ,
2013-12-03 13:44:48 +00:00
help = ' \n Creates the dropship route and add more complex tests '
' -This installs the module stock_dropshipping. ' ) ,
2012-03-02 12:43:57 +00:00
}
_defaults = {
2014-04-07 10:44:02 +00:00
' default_invoice_method ' : ' order ' ,
2012-03-02 12:43:57 +00:00
}
2013-03-22 12:43:33 +00:00
def onchange_purchase_analytic_plans ( self , cr , uid , ids , module_purchase_analytic_plans , context = None ) :
""" change group_analytic_account_for_purchases following module_purchase_analytic_plans """
if not module_purchase_analytic_plans :
return { }
return { ' value ' : { ' group_analytic_account_for_purchases ' : module_purchase_analytic_plans } }
2012-05-09 13:58:56 +00:00
2012-03-29 14:21:21 +00:00
class account_config_settings ( osv . osv_memory ) :
_inherit = ' account.config.settings '
_columns = {
2012-09-12 07:14:13 +00:00
' module_purchase_analytic_plans ' : fields . boolean ( ' Use multiple analytic accounts on orders ' ,
2013-09-17 13:08:14 +00:00
help = ' Allows the user to maintain several analysis plans. These let you split lines on a purchase order between several accounts and analytic plans. \n '
' -This installs the module purchase_analytic_plans. ' ) ,
2012-09-12 07:14:13 +00:00
' group_analytic_account_for_purchases ' : fields . boolean ( ' Analytic accounting for purchases ' ,
2012-03-29 14:21:21 +00:00
implied_group = ' purchase.group_analytic_accounting ' ,
help = " Allows you to specify an analytic account on purchase orders. " ) ,
}
2012-06-25 12:34:21 +00:00
2012-06-08 11:56:39 +00:00
def onchange_purchase_analytic_plans ( self , cr , uid , ids , module_purchase_analytic_plans , context = None ) :
2012-06-25 12:34:21 +00:00
""" change group_analytic_account_for_purchases following module_purchase_analytic_plans """
2013-03-22 09:58:45 +00:00
if not module_purchase_analytic_plans :
return { }
2012-06-25 12:34:21 +00:00
return { ' value ' : { ' group_analytic_account_for_purchases ' : module_purchase_analytic_plans } }
2012-03-29 14:21:21 +00:00
2012-03-22 10:58:33 +00:00
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: