add procurement for service

This commit is contained in:
ivan deng
2018-07-20 15:17:53 +08:00
parent fa0081c605
commit 747dcdd216
33 changed files with 1431 additions and 0 deletions

View File

@@ -0,0 +1,83 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
======================
Subcontracted services
======================
This module allows a user to indicate that a service is subcontracted.
It provides the ability to create purchases from procurement processes.
This is a base module, upon specific modules for sale / manufacuturing, modules
will need to rely on. By itself it does not provide any function to the end user.
Possible uses of this module can be:
* Add subcontracted services to BOMs. When a manufacturing order is created a
PO is triggered for the service to be subcontracted. See
* Add subcontracted services to sales order. When the SO is confirmed, it
creates a PO for the service.
Configuration
=============
To configure this module, you need to:
#. Configure your service product with the flag
``property_subcontracted_service`` in product form if this product should
trigger a procurement.
#. Add supplier in your product form.
#. Additionally and despite a predefined rule is created in each warehouse,
you can configure the 'Subcontracting_service procurement rule' for each
warehouse through 'Inventory / Configuration / Warehouse Management /
Warehouse'.
Usage
=====
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/142/11.0
Bug Tracker
===========
Bugs are tracked on `GitHub Issues
<https://github.com/OCA/purchase-workflow/issues>`_. In case of trouble, please
check there if your issue has already been reported. If you spotted it first,
help us smash it by providing detailed and welcomed feedback.
Credits
=======
Images
------
* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.png>`_.
Contributors
------------
* Damien Crier <damien.crier@camptocamp.com>
* Jordi Ballester Alomar <jordi.ballester@eficent.com>
* Lois Rilo <lois.rilo@eficent.com>
Maintainer
----------
.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org
This module is maintained by the OCA.
OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
To contribute to this module, please visit https://odoo-community.org.

View File

@@ -0,0 +1,3 @@
from . import models
from .init_hook import post_init_hook

View File

@@ -0,0 +1,24 @@
# Author: Damien Crier
# Copyright 2017 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
# base on Camptocamp, Odoo Community Association (OCA)
{
"name": 'App procurement for service, Subcontracted service',
"summary": 'procurement for service, Subcontracted service, base on oca Subcontracted service',
"version": "11.0.1.0.0",
"category": "Purchase",
"website": "http://www.sunpop.cn/",
"author": "Sunpop.cn",
"license": "AGPL-3",
"application": False,
"installable": True,
"depends": [
"purchase",
],
"data": [
'views/product_template.xml',
'views/warehouse.xml',
],
"post_init_hook": "post_init_hook",
}

View File

@@ -0,0 +1,55 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * app_procurement_for_service
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-06-22 02:44+0000\n"
"PO-Revision-Date: 2017-06-22 02:44+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n"
"Language-Team: Catalan (https://www.transifex.com/oca/teams/23907/ca/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: ca\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_procurement_order
msgid "Procurement"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_product_product
msgid "Product"
msgstr "Producte"
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_product_template
msgid "Product Template"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model.fields,field_description:app_procurement_for_service.field_product_product_property_app_procurement_for_service
#: model:ir.model.fields,field_description:app_procurement_for_service.field_product_template_property_app_procurement_for_service
msgid "Subcontracted Service"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.ui.view,arch_db:app_procurement_for_service.view_warehouse
msgid "Subcontracting"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model.fields,field_description:app_procurement_for_service.field_stock_warehouse_subcontracting_service_proc_rule_id
msgid "Subcontracting Service Procurement Rule"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_stock_warehouse
msgid "Warehouse"
msgstr ""

View File

@@ -0,0 +1,55 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * app_procurement_for_service
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-06-22 02:44+0000\n"
"PO-Revision-Date: 2017-06-22 02:44+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n"
"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: de\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_procurement_order
msgid "Procurement"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_product_product
msgid "Product"
msgstr "Produkt"
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_product_template
msgid "Product Template"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model.fields,field_description:app_procurement_for_service.field_product_product_property_app_procurement_for_service
#: model:ir.model.fields,field_description:app_procurement_for_service.field_product_template_property_app_procurement_for_service
msgid "Subcontracted Service"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.ui.view,arch_db:app_procurement_for_service.view_warehouse
msgid "Subcontracting"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model.fields,field_description:app_procurement_for_service.field_stock_warehouse_subcontracting_service_proc_rule_id
msgid "Subcontracting Service Procurement Rule"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_stock_warehouse
msgid "Warehouse"
msgstr ""

View File

@@ -0,0 +1,55 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * app_procurement_for_service
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-06-22 02:44+0000\n"
"PO-Revision-Date: 2017-06-22 02:44+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n"
"Language-Team: Greek (Greece) (https://www.transifex.com/oca/teams/23907/el_GR/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: el_GR\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_procurement_order
msgid "Procurement"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_product_product
msgid "Product"
msgstr "Προϊόν"
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_product_template
msgid "Product Template"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model.fields,field_description:app_procurement_for_service.field_product_product_property_app_procurement_for_service
#: model:ir.model.fields,field_description:app_procurement_for_service.field_product_template_property_app_procurement_for_service
msgid "Subcontracted Service"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.ui.view,arch_db:app_procurement_for_service.view_warehouse
msgid "Subcontracting"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model.fields,field_description:app_procurement_for_service.field_stock_warehouse_subcontracting_service_proc_rule_id
msgid "Subcontracting Service Procurement Rule"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_stock_warehouse
msgid "Warehouse"
msgstr ""

View File

@@ -0,0 +1,55 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * app_procurement_for_service
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-06-22 02:44+0000\n"
"PO-Revision-Date: 2017-06-22 02:44+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n"
"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: es\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_procurement_order
msgid "Procurement"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_product_product
msgid "Product"
msgstr "Producto"
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_product_template
msgid "Product Template"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model.fields,field_description:app_procurement_for_service.field_product_product_property_app_procurement_for_service
#: model:ir.model.fields,field_description:app_procurement_for_service.field_product_template_property_app_procurement_for_service
msgid "Subcontracted Service"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.ui.view,arch_db:app_procurement_for_service.view_warehouse
msgid "Subcontracting"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model.fields,field_description:app_procurement_for_service.field_stock_warehouse_subcontracting_service_proc_rule_id
msgid "Subcontracting Service Procurement Rule"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_stock_warehouse
msgid "Warehouse"
msgstr ""

View File

@@ -0,0 +1,55 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * app_procurement_for_service
#
# Translators:
# Henry Garcia <henry@yaroslab.com>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-07-15 06:42+0000\n"
"PO-Revision-Date: 2017-07-15 06:42+0000\n"
"Last-Translator: Henry Garcia <henry@yaroslab.com>, 2017\n"
"Language-Team: Spanish (Peru) (https://www.transifex.com/oca/teams/23907/es_PE/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: es_PE\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_procurement_order
msgid "Procurement"
msgstr "Aquisiciones"
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_product_product
msgid "Product"
msgstr "Producto"
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_product_template
msgid "Product Template"
msgstr "Plantilla de producto"
#. module: app_procurement_for_service
#: model:ir.model.fields,field_description:app_procurement_for_service.field_product_product_property_app_procurement_for_service
#: model:ir.model.fields,field_description:app_procurement_for_service.field_product_template_property_app_procurement_for_service
msgid "Subcontracted Service"
msgstr "Servicio subcontratado"
#. module: app_procurement_for_service
#: model:ir.ui.view,arch_db:app_procurement_for_service.view_warehouse
msgid "Subcontracting"
msgstr "Subcontratación"
#. module: app_procurement_for_service
#: model:ir.model.fields,field_description:app_procurement_for_service.field_stock_warehouse_subcontracting_service_proc_rule_id
msgid "Subcontracting Service Procurement Rule"
msgstr "Regla de Adquisición de Servicios de Subcontratación"
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_stock_warehouse
msgid "Warehouse"
msgstr "Almacén"

View File

@@ -0,0 +1,55 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * app_procurement_for_service
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-06-22 02:44+0000\n"
"PO-Revision-Date: 2017-06-22 02:44+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n"
"Language-Team: Finnish (https://www.transifex.com/oca/teams/23907/fi/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: fi\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_procurement_order
msgid "Procurement"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_product_product
msgid "Product"
msgstr "Tuote"
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_product_template
msgid "Product Template"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model.fields,field_description:app_procurement_for_service.field_product_product_property_app_procurement_for_service
#: model:ir.model.fields,field_description:app_procurement_for_service.field_product_template_property_app_procurement_for_service
msgid "Subcontracted Service"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.ui.view,arch_db:app_procurement_for_service.view_warehouse
msgid "Subcontracting"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model.fields,field_description:app_procurement_for_service.field_stock_warehouse_subcontracting_service_proc_rule_id
msgid "Subcontracting Service Procurement Rule"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_stock_warehouse
msgid "Warehouse"
msgstr ""

View File

@@ -0,0 +1,55 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * app_procurement_for_service
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-06-22 02:44+0000\n"
"PO-Revision-Date: 2017-06-22 02:44+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n"
"Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: fr\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_procurement_order
msgid "Procurement"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_product_product
msgid "Product"
msgstr "Produit"
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_product_template
msgid "Product Template"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model.fields,field_description:app_procurement_for_service.field_product_product_property_app_procurement_for_service
#: model:ir.model.fields,field_description:app_procurement_for_service.field_product_template_property_app_procurement_for_service
msgid "Subcontracted Service"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.ui.view,arch_db:app_procurement_for_service.view_warehouse
msgid "Subcontracting"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model.fields,field_description:app_procurement_for_service.field_stock_warehouse_subcontracting_service_proc_rule_id
msgid "Subcontracting Service Procurement Rule"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_stock_warehouse
msgid "Warehouse"
msgstr ""

View File

@@ -0,0 +1,55 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * app_procurement_for_service
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-06-22 02:44+0000\n"
"PO-Revision-Date: 2017-06-22 02:44+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n"
"Language-Team: French (France) (https://www.transifex.com/oca/teams/23907/fr_FR/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: fr_FR\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_procurement_order
msgid "Procurement"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_product_product
msgid "Product"
msgstr "Produit"
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_product_template
msgid "Product Template"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model.fields,field_description:app_procurement_for_service.field_product_product_property_app_procurement_for_service
#: model:ir.model.fields,field_description:app_procurement_for_service.field_product_template_property_app_procurement_for_service
msgid "Subcontracted Service"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.ui.view,arch_db:app_procurement_for_service.view_warehouse
msgid "Subcontracting"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model.fields,field_description:app_procurement_for_service.field_stock_warehouse_subcontracting_service_proc_rule_id
msgid "Subcontracting Service Procurement Rule"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_stock_warehouse
msgid "Warehouse"
msgstr ""

View File

@@ -0,0 +1,55 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * app_procurement_for_service
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-06-22 02:44+0000\n"
"PO-Revision-Date: 2017-06-22 02:44+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n"
"Language-Team: Galician (https://www.transifex.com/oca/teams/23907/gl/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: gl\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_procurement_order
msgid "Procurement"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_product_product
msgid "Product"
msgstr "Produto"
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_product_template
msgid "Product Template"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model.fields,field_description:app_procurement_for_service.field_product_product_property_app_procurement_for_service
#: model:ir.model.fields,field_description:app_procurement_for_service.field_product_template_property_app_procurement_for_service
msgid "Subcontracted Service"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.ui.view,arch_db:app_procurement_for_service.view_warehouse
msgid "Subcontracting"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model.fields,field_description:app_procurement_for_service.field_stock_warehouse_subcontracting_service_proc_rule_id
msgid "Subcontracting Service Procurement Rule"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_stock_warehouse
msgid "Warehouse"
msgstr ""

View File

@@ -0,0 +1,55 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * app_procurement_for_service
#
# Translators:
# Bole <bole@dajmi5.com>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-07-11 12:53+0000\n"
"PO-Revision-Date: 2017-07-11 12:53+0000\n"
"Last-Translator: Bole <bole@dajmi5.com>, 2017\n"
"Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: hr\n"
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_procurement_order
msgid "Procurement"
msgstr "Nabava"
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_product_product
msgid "Product"
msgstr "Proizvod"
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_product_template
msgid "Product Template"
msgstr "Predložak proizvoda"
#. module: app_procurement_for_service
#: model:ir.model.fields,field_description:app_procurement_for_service.field_product_product_property_app_procurement_for_service
#: model:ir.model.fields,field_description:app_procurement_for_service.field_product_template_property_app_procurement_for_service
msgid "Subcontracted Service"
msgstr "Usluga podizvođača"
#. module: app_procurement_for_service
#: model:ir.ui.view,arch_db:app_procurement_for_service.view_warehouse
msgid "Subcontracting"
msgstr "Podizvođenje"
#. module: app_procurement_for_service
#: model:ir.model.fields,field_description:app_procurement_for_service.field_stock_warehouse_subcontracting_service_proc_rule_id
msgid "Subcontracting Service Procurement Rule"
msgstr "Pravilo nabave usluge podizvođača"
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_stock_warehouse
msgid "Warehouse"
msgstr "Skladište"

View File

@@ -0,0 +1,55 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * app_procurement_for_service
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-06-22 02:44+0000\n"
"PO-Revision-Date: 2017-06-22 02:44+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n"
"Language-Team: Croatian (Croatia) (https://www.transifex.com/oca/teams/23907/hr_HR/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: hr_HR\n"
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_procurement_order
msgid "Procurement"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_product_product
msgid "Product"
msgstr "Proizvod"
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_product_template
msgid "Product Template"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model.fields,field_description:app_procurement_for_service.field_product_product_property_app_procurement_for_service
#: model:ir.model.fields,field_description:app_procurement_for_service.field_product_template_property_app_procurement_for_service
msgid "Subcontracted Service"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.ui.view,arch_db:app_procurement_for_service.view_warehouse
msgid "Subcontracting"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model.fields,field_description:app_procurement_for_service.field_stock_warehouse_subcontracting_service_proc_rule_id
msgid "Subcontracting Service Procurement Rule"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_stock_warehouse
msgid "Warehouse"
msgstr ""

View File

@@ -0,0 +1,55 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * app_procurement_for_service
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-06-22 02:44+0000\n"
"PO-Revision-Date: 2017-06-22 02:44+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n"
"Language-Team: Italian (https://www.transifex.com/oca/teams/23907/it/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: it\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_procurement_order
msgid "Procurement"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_product_product
msgid "Product"
msgstr "Prodotto"
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_product_template
msgid "Product Template"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model.fields,field_description:app_procurement_for_service.field_product_product_property_app_procurement_for_service
#: model:ir.model.fields,field_description:app_procurement_for_service.field_product_template_property_app_procurement_for_service
msgid "Subcontracted Service"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.ui.view,arch_db:app_procurement_for_service.view_warehouse
msgid "Subcontracting"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model.fields,field_description:app_procurement_for_service.field_stock_warehouse_subcontracting_service_proc_rule_id
msgid "Subcontracting Service Procurement Rule"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_stock_warehouse
msgid "Warehouse"
msgstr ""

View File

@@ -0,0 +1,55 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * app_procurement_for_service
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-06-22 02:44+0000\n"
"PO-Revision-Date: 2017-06-22 02:44+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n"
"Language-Team: Dutch (https://www.transifex.com/oca/teams/23907/nl/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: nl\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_procurement_order
msgid "Procurement"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_product_product
msgid "Product"
msgstr "Product"
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_product_template
msgid "Product Template"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model.fields,field_description:app_procurement_for_service.field_product_product_property_app_procurement_for_service
#: model:ir.model.fields,field_description:app_procurement_for_service.field_product_template_property_app_procurement_for_service
msgid "Subcontracted Service"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.ui.view,arch_db:app_procurement_for_service.view_warehouse
msgid "Subcontracting"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model.fields,field_description:app_procurement_for_service.field_stock_warehouse_subcontracting_service_proc_rule_id
msgid "Subcontracting Service Procurement Rule"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_stock_warehouse
msgid "Warehouse"
msgstr ""

View File

@@ -0,0 +1,56 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * app_procurement_for_service
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2017
# Peter Hageman <hageman.p@gmail.com>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-06-24 06:31+0000\n"
"PO-Revision-Date: 2017-06-24 06:31+0000\n"
"Last-Translator: Peter Hageman <hageman.p@gmail.com>, 2017\n"
"Language-Team: Dutch (Netherlands) (https://www.transifex.com/oca/teams/23907/nl_NL/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: nl_NL\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_procurement_order
msgid "Procurement"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_product_product
msgid "Product"
msgstr "Product"
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_product_template
msgid "Product Template"
msgstr "Productsjabloon"
#. module: app_procurement_for_service
#: model:ir.model.fields,field_description:app_procurement_for_service.field_product_product_property_app_procurement_for_service
#: model:ir.model.fields,field_description:app_procurement_for_service.field_product_template_property_app_procurement_for_service
msgid "Subcontracted Service"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.ui.view,arch_db:app_procurement_for_service.view_warehouse
msgid "Subcontracting"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model.fields,field_description:app_procurement_for_service.field_stock_warehouse_subcontracting_service_proc_rule_id
msgid "Subcontracting Service Procurement Rule"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_stock_warehouse
msgid "Warehouse"
msgstr "Magazijn"

View File

@@ -0,0 +1,55 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * app_procurement_for_service
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-06-22 02:44+0000\n"
"PO-Revision-Date: 2017-06-22 02:44+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n"
"Language-Team: Portuguese (https://www.transifex.com/oca/teams/23907/pt/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: pt\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_procurement_order
msgid "Procurement"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_product_product
msgid "Product"
msgstr "Produto"
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_product_template
msgid "Product Template"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model.fields,field_description:app_procurement_for_service.field_product_product_property_app_procurement_for_service
#: model:ir.model.fields,field_description:app_procurement_for_service.field_product_template_property_app_procurement_for_service
msgid "Subcontracted Service"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.ui.view,arch_db:app_procurement_for_service.view_warehouse
msgid "Subcontracting"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model.fields,field_description:app_procurement_for_service.field_stock_warehouse_subcontracting_service_proc_rule_id
msgid "Subcontracting Service Procurement Rule"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_stock_warehouse
msgid "Warehouse"
msgstr ""

View File

@@ -0,0 +1,55 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * app_procurement_for_service
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-06-22 02:44+0000\n"
"PO-Revision-Date: 2017-06-22 02:44+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n"
"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/teams/23907/pt_BR/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: pt_BR\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_procurement_order
msgid "Procurement"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_product_product
msgid "Product"
msgstr "Produto"
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_product_template
msgid "Product Template"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model.fields,field_description:app_procurement_for_service.field_product_product_property_app_procurement_for_service
#: model:ir.model.fields,field_description:app_procurement_for_service.field_product_template_property_app_procurement_for_service
msgid "Subcontracted Service"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.ui.view,arch_db:app_procurement_for_service.view_warehouse
msgid "Subcontracting"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model.fields,field_description:app_procurement_for_service.field_stock_warehouse_subcontracting_service_proc_rule_id
msgid "Subcontracting Service Procurement Rule"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_stock_warehouse
msgid "Warehouse"
msgstr ""

View File

@@ -0,0 +1,55 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * app_procurement_for_service
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-06-22 02:44+0000\n"
"PO-Revision-Date: 2017-06-22 02:44+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n"
"Language-Team: Romanian (https://www.transifex.com/oca/teams/23907/ro/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: ro\n"
"Plural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1));\n"
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_procurement_order
msgid "Procurement"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_product_product
msgid "Product"
msgstr "Produs"
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_product_template
msgid "Product Template"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model.fields,field_description:app_procurement_for_service.field_product_product_property_app_procurement_for_service
#: model:ir.model.fields,field_description:app_procurement_for_service.field_product_template_property_app_procurement_for_service
msgid "Subcontracted Service"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.ui.view,arch_db:app_procurement_for_service.view_warehouse
msgid "Subcontracting"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model.fields,field_description:app_procurement_for_service.field_stock_warehouse_subcontracting_service_proc_rule_id
msgid "Subcontracting Service Procurement Rule"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_stock_warehouse
msgid "Warehouse"
msgstr ""

View File

@@ -0,0 +1,55 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * app_procurement_for_service
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-06-22 02:44+0000\n"
"PO-Revision-Date: 2017-06-22 02:44+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n"
"Language-Team: Slovenian (https://www.transifex.com/oca/teams/23907/sl/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: sl\n"
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n"
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_procurement_order
msgid "Procurement"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_product_product
msgid "Product"
msgstr "Proizvod"
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_product_template
msgid "Product Template"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model.fields,field_description:app_procurement_for_service.field_product_product_property_app_procurement_for_service
#: model:ir.model.fields,field_description:app_procurement_for_service.field_product_template_property_app_procurement_for_service
msgid "Subcontracted Service"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.ui.view,arch_db:app_procurement_for_service.view_warehouse
msgid "Subcontracting"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model.fields,field_description:app_procurement_for_service.field_stock_warehouse_subcontracting_service_proc_rule_id
msgid "Subcontracting Service Procurement Rule"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_stock_warehouse
msgid "Warehouse"
msgstr ""

View File

@@ -0,0 +1,55 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * app_procurement_for_service
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-06-22 02:44+0000\n"
"PO-Revision-Date: 2017-06-22 02:44+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n"
"Language-Team: Vietnamese (Viet Nam) (https://www.transifex.com/oca/teams/23907/vi_VN/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: vi_VN\n"
"Plural-Forms: nplurals=1; plural=0;\n"
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_procurement_order
msgid "Procurement"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_product_product
msgid "Product"
msgstr "Sản phẩm"
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_product_template
msgid "Product Template"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model.fields,field_description:app_procurement_for_service.field_product_product_property_app_procurement_for_service
#: model:ir.model.fields,field_description:app_procurement_for_service.field_product_template_property_app_procurement_for_service
msgid "Subcontracted Service"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.ui.view,arch_db:app_procurement_for_service.view_warehouse
msgid "Subcontracting"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model.fields,field_description:app_procurement_for_service.field_stock_warehouse_subcontracting_service_proc_rule_id
msgid "Subcontracting Service Procurement Rule"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_stock_warehouse
msgid "Warehouse"
msgstr ""

View File

@@ -0,0 +1,55 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * app_procurement_for_service
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-06-22 02:44+0000\n"
"PO-Revision-Date: 2017-06-22 02:44+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n"
"Language-Team: Chinese (China) (https://www.transifex.com/oca/teams/23907/zh_CN/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: zh_CN\n"
"Plural-Forms: nplurals=1; plural=0;\n"
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_procurement_order
msgid "Procurement"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_product_product
msgid "Product"
msgstr "产品"
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_product_template
msgid "Product Template"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model.fields,field_description:app_procurement_for_service.field_product_product_property_app_procurement_for_service
#: model:ir.model.fields,field_description:app_procurement_for_service.field_product_template_property_app_procurement_for_service
msgid "Subcontracted Service"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.ui.view,arch_db:app_procurement_for_service.view_warehouse
msgid "Subcontracting"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model.fields,field_description:app_procurement_for_service.field_stock_warehouse_subcontracting_service_proc_rule_id
msgid "Subcontracting Service Procurement Rule"
msgstr ""
#. module: app_procurement_for_service
#: model:ir.model,name:app_procurement_for_service.model_stock_warehouse
msgid "Warehouse"
msgstr ""

View File

@@ -0,0 +1,17 @@
# Author: Damien Crier
# Copyright 2017 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import SUPERUSER_ID
from odoo.api import Environment
def post_init_hook(cr, pool):
env = Environment(cr, SUPERUSER_ID, {})
create_warehouse_procurement_rules(env)
def create_warehouse_procurement_rules(env):
warehouses = env['stock.warehouse'].with_context(
active_test=False).search([])
warehouses._set_subcontracting_service_proc_rule()

View File

@@ -0,0 +1,4 @@
from . import product
from . import procurement
from . import warehouse

View File

@@ -0,0 +1,26 @@
# # Author: Damien Crier
# # Copyright 2017 Camptocamp SA
# # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
#
from odoo import api, models
class ProcurementGroup(models.Model):
_inherit = "procurement.group"
@api.model
def _is_subcontracted_service(self, product_id):
return (product_id.type == 'service' and
product_id.property_subcontracted_service or
False)
@api.model
def _get_rule(self, product_id, location_id, values):
res = super()._get_rule(product_id, location_id, values)
if not res:
if self._is_subcontracted_service(product_id):
rule_id = location_id.get_warehouse().\
subcontracting_service_proc_rule_id
if rule_id:
return rule_id
return res

View File

@@ -0,0 +1,13 @@
# Author: Damien Crier
# Copyright 2017 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import fields, models
class ProductTemplate(models.Model):
_inherit = 'product.template'
property_subcontracted_service = fields.Boolean(
string="Subcontracted Service",
company_dependent=True)

View File

@@ -0,0 +1,51 @@
# Copyright 2017 Eficent Business and IT Consulting Services S.L.
# (http://www.eficent.com)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import api, fields, models
class StockWarehouse(models.Model):
_inherit = 'stock.warehouse'
subcontracting_service_proc_rule_id = fields.Many2one(
comodel_name='procurement.rule',
string="Subcontracting Service Procurement Rule"
)
def _get_buy_route(self):
return self.env.ref('purchase.route_warehouse0_buy',
raise_if_not_found=False).id
@api.multi
def _get_vals_for_proc_rule_subcontracting(self):
self.ensure_one()
picking_type = self.env['stock.picking.type'].search(
[('code', '=', 'incoming'),
('warehouse_id', '=', self.id)
],
limit=1
)
return {'name': '%s: Subcontracting service rule' % self.name,
'company_id': self.company_id.id,
'action': 'buy',
'picking_type_id': picking_type.id,
'route_id': self._get_buy_route(),
}
@api.multi
def _set_subcontracting_service_proc_rule(self):
for rec in self:
if rec.subcontracting_service_proc_rule_id:
continue
vals = rec._get_vals_for_proc_rule_subcontracting()
rule = self.env['procurement.rule'].create(vals)
rec.subcontracting_service_proc_rule_id = rule.id
return True
@api.model
@api.returns('self', lambda value: value.id)
def create(self, vals):
res = super(StockWarehouse, self).create(vals)
res._set_subcontracting_service_proc_rule()
return res

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

View File

@@ -0,0 +1,2 @@
from . import test_subcontracted_service

View File

@@ -0,0 +1,73 @@
# Author: Damien Crier
# Copyright 2017 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo.tests.common import TransactionCase
from odoo import fields
class TestSubcontractedService(TransactionCase):
def setUp(self):
super(TestSubcontractedService, self).setUp()
self.procurement_group_obj = self.env['procurement.group']
self.obj_warehouse = self.env['stock.warehouse']
# 1. find a supplier
self.supplier = self.env.ref('base.res_partner_1')
# 2. create a service product unconfigured
values = {'name': 'Service Subcontracted',
'type': 'service',
'seller_ids': [(0, 0, {
'name': self.supplier.id,
'price': 100.0,
})]
}
self.pdt_service = self.env['product.product'].create(values)
# 3. create a test warehouse
self.test_wh = self.obj_warehouse.create({
'name': 'Test WH',
'code': 'T',
})
# 4. find a customer
self.customer = self.env['res.partner'].search(
[('customer', '=', True)],
limit=1
)
def test_wh_procurement_rule(self):
"""Tests if the procurement rule for subcontracting services is
assigned properly to the warehouse."""
wh = self.test_wh
self.assertNotEqual(wh.subcontracting_service_proc_rule_id, False,
'Subcontracting Service Rule not assigned to the '
'Warehouse.')
picking_wh = wh.subcontracting_service_proc_rule_id.\
picking_type_id.warehouse_id
self.assertEqual(picking_wh, wh, 'Rule wrongly configured.')
def test_subcontracted_service_procurement(self):
"""Test if the subcontracting service procurement rule is correctly
assigned when creating a procurement for a subcontracted service
product."""
values = {
'warehouse_id': self.test_wh,
'company_id': self.test_wh.company_id,
'date_planned': fields.Date.today(),
'group_id': self.test_wh.
subcontracting_service_proc_rule_id.group_id,
}
self.pdt_service.property_subcontracted_service = True
self.procurement_group_obj.run(
self.pdt_service, 1,
self.pdt_service.uom_id,
self.test_wh.lot_stock_id, 'test', 'test', values)
po_line = self.env['purchase.order.line'].search(
[('product_id', '=', self.pdt_service.id)], limit=1)
self.assertEqual(len(po_line), 1)
self.assertEqual(po_line.product_qty, 1)
self.assertEqual(po_line.product_uom, self.pdt_service.uom_id)
self.assertEqual(po_line.order_id.group_id,
self.test_wh.
subcontracting_service_proc_rule_id.group_id)
self.assertEqual(po_line.company_id, self.test_wh.company_id)

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="product_template_subcontracted_service_view_form" model="ir.ui.view">
<field name="name">product_template_subcontracted_service_view_form</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_form_view"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='type']" position="after">
<field name="property_subcontracted_service" attrs="{'invisible': [('type', '!=', 'service')]}"/>
</xpath>
</field>
</record>
</odoo>

View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2017 Eficent Business and IT Consulting Services S.L.
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<odoo>
<record id="view_warehouse" model="ir.ui.view">
<field name="name">stock.warehouse.form</field>
<field name="model">stock.warehouse</field>
<field name="inherit_id" ref="stock.view_warehouse"/>
<field name="arch" type="xml">
<xpath expr="//notebook/page[1]" position="inside">
<group name="subcontracting" string="Subcontracting">
<field name="subcontracting_service_proc_rule_id"/>
</group>
</xpath>
</field>
</record>
</odoo>