From fb70e9fad31f19f92d7ff105fb7f4bfd1e83a9d2 Mon Sep 17 00:00:00 2001 From: dufresnedavid Date: Thu, 23 Apr 2015 09:35:18 -0400 Subject: [PATCH 1/3] [ADD] Partner Location Auto Create --- partner_location_auto_create/README.rst | 69 +++++ partner_location_auto_create/__init__.py | 23 ++ partner_location_auto_create/__openerp__.py | 44 +++ partner_location_auto_create/i18n/fr.po | 45 +++ .../i18n/partner_location_auto_create.pot | 44 +++ .../models/__init__.py | 25 ++ .../models/res_company.py | 44 +++ .../models/res_partner.py | 156 ++++++++++ .../models/stock_location.py | 48 +++ .../tests/__init__.py | 23 ++ .../tests/test_res_partner.py | 279 ++++++++++++++++++ .../views/res_company_view.xml | 18 ++ .../views/res_partner_view.xml | 42 +++ .../views/stock_location_view.xml | 17 ++ 14 files changed, 877 insertions(+) create mode 100644 partner_location_auto_create/README.rst create mode 100644 partner_location_auto_create/__init__.py create mode 100644 partner_location_auto_create/__openerp__.py create mode 100644 partner_location_auto_create/i18n/fr.po create mode 100644 partner_location_auto_create/i18n/partner_location_auto_create.pot create mode 100644 partner_location_auto_create/models/__init__.py create mode 100644 partner_location_auto_create/models/res_company.py create mode 100644 partner_location_auto_create/models/res_partner.py create mode 100644 partner_location_auto_create/models/stock_location.py create mode 100644 partner_location_auto_create/tests/__init__.py create mode 100644 partner_location_auto_create/tests/test_res_partner.py create mode 100644 partner_location_auto_create/views/res_company_view.xml create mode 100644 partner_location_auto_create/views/res_partner_view.xml create mode 100644 partner_location_auto_create/views/stock_location_view.xml diff --git a/partner_location_auto_create/README.rst b/partner_location_auto_create/README.rst new file mode 100644 index 000000000..225c6acb9 --- /dev/null +++ b/partner_location_auto_create/README.rst @@ -0,0 +1,69 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +============================ +Partner Location Auto Create +============================ + +This module allows to create locations automatically when creating a partner. +One use case of this feature is to allow a company not only to manage the stocks +in its own warehouses, but also the warehouses of its suppliers. +For example, an hatchery manages farms. Each farm is a partner and has its own inventory. +The hatchery doesn't own the farms but manages their stocks. + +Whether the partner is a customer, a supplier or both, the proper locations will be created and +the fields property_stock_customer and property_stock_supplier will be filled automatically. + +The modules also adds a button on the partner form to view the related locations. + +Installation +============ + +To install this module, you just need to select the module and ensure yourself dependencies are available. + +Configuration +============= + +* Add users to the group "Sales Pricelists" or "Purchase Pricelists" to view the stock location properties on the partner view. +* In the company form, select the default customer and supplier locations. This will set the default parent locations for the partner locations. + +Usage +===== + +To use this module, you need to : + +- Create a partner +- Click on the locations button and add specific locations for the partner + +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/153/8.0 + + +Known issues / Roadmap +====================== + +Credits +======= + +Module developed and tested with Odoo version 8.0 + +Contributors +------------ + +* David DUFRESNE +* Sandy CARTER +* Adriana IERFINO +* Bruno JOLIVEAU + +Maintainer +---------- + +Odoo Community Association + +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 http://odoo-community.org. diff --git a/partner_location_auto_create/__init__.py b/partner_location_auto_create/__init__.py new file mode 100644 index 000000000..61467bfb8 --- /dev/null +++ b/partner_location_auto_create/__init__.py @@ -0,0 +1,23 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# This module copyright (C) 2015 Savoir-faire Linux +# (). +# +# 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 . +# +############################################################################## + +from . import models diff --git a/partner_location_auto_create/__openerp__.py b/partner_location_auto_create/__openerp__.py new file mode 100644 index 000000000..870aaebf4 --- /dev/null +++ b/partner_location_auto_create/__openerp__.py @@ -0,0 +1,44 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# This module copyright (C) 2015 Savoir-faire Linux +# (). +# +# 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 . +# +############################################################################## + +{ + 'name': 'Partner Location Auto Create', + 'version': '0.1', + 'author': 'Savoir-faire Linux,Odoo Community Association (OCA)', + 'category': 'Warehouse', + 'license': 'AGPL-3', + 'complexity': 'normal', + 'images': [], + 'website': 'http://www.savoirfairelinux.com', + 'depends': [ + 'sale_stock', + ], + 'demo': [], + 'data': [ + 'views/res_partner_view.xml', + 'views/res_company_view.xml', + 'views/stock_location_view.xml', + ], + 'test': [], + 'auto_install': False, + 'installable': True, +} diff --git a/partner_location_auto_create/i18n/fr.po b/partner_location_auto_create/i18n/fr.po new file mode 100644 index 000000000..476a435f1 --- /dev/null +++ b/partner_location_auto_create/i18n/fr.po @@ -0,0 +1,45 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * partner_location_auto_create +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-04-28 13:22+0000\n" +"PO-Revision-Date: 2015-04-28 09:25-0500\n" +"Last-Translator: David Dufresne \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: \n" +"X-Generator: Poedit 1.5.4\n" + +#. module: partner_location_auto_create +#: model:ir.model,name:partner_location_auto_create.model_res_company +msgid "Companies" +msgstr "Sociétés" + +#. module: partner_location_auto_create +#: field:res.company,default_customer_location:0 +msgid "Default Customer Location" +msgstr "Emplacement client par défaut" + +#. module: partner_location_auto_create +#: field:res.company,default_supplier_location:0 +msgid "Default Supplier Location" +msgstr "Emplacement fournisseur par défaut" + +#. module: partner_location_auto_create +#: code:addons/partner_location_auto_create/models/res_partner.py:44 +#: view:res.partner:partner_location_auto_create.view_partner_form +#: field:res.partner,location_ids:0 +#, python-format +msgid "Locations" +msgstr "Emplacements" + +#. module: partner_location_auto_create +#: model:ir.model,name:partner_location_auto_create.model_res_partner +msgid "Partner" +msgstr "Partenaire" diff --git a/partner_location_auto_create/i18n/partner_location_auto_create.pot b/partner_location_auto_create/i18n/partner_location_auto_create.pot new file mode 100644 index 000000000..5adb2cd7f --- /dev/null +++ b/partner_location_auto_create/i18n/partner_location_auto_create.pot @@ -0,0 +1,44 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * partner_location_auto_create +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-04-28 13:22+0000\n" +"PO-Revision-Date: 2015-04-28 13:22+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: partner_location_auto_create +#: model:ir.model,name:partner_location_auto_create.model_res_company +msgid "Companies" +msgstr "" + +#. module: partner_location_auto_create +#: field:res.company,default_customer_location:0 +msgid "Default Customer Location" +msgstr "" + +#. module: partner_location_auto_create +#: field:res.company,default_supplier_location:0 +msgid "Default Supplier Location" +msgstr "" + +#. module: partner_location_auto_create +#: code:addons/partner_location_auto_create/models/res_partner.py:44 +#: view:res.partner:partner_location_auto_create.view_partner_form +#: field:res.partner,location_ids:0 +#, python-format +msgid "Locations" +msgstr "" + +#. module: partner_location_auto_create +#: model:ir.model,name:partner_location_auto_create.model_res_partner +msgid "Partner" +msgstr "" diff --git a/partner_location_auto_create/models/__init__.py b/partner_location_auto_create/models/__init__.py new file mode 100644 index 000000000..67eef12e8 --- /dev/null +++ b/partner_location_auto_create/models/__init__.py @@ -0,0 +1,25 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# This module copyright (C) 2015 Savoir-faire Linux +# (). +# +# 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 . +# +############################################################################## + +from . import res_company +from . import res_partner +from . import stock_location diff --git a/partner_location_auto_create/models/res_company.py b/partner_location_auto_create/models/res_company.py new file mode 100644 index 000000000..32d751509 --- /dev/null +++ b/partner_location_auto_create/models/res_company.py @@ -0,0 +1,44 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# This module copyright (C) 2015 Savoir-faire Linux +# (). +# +# 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 . +# +############################################################################## + +from openerp import models, fields, api + + +class ResCompany(models.Model): + _inherit = 'res.company' + + default_customer_location = fields.Many2one( + 'stock.location', 'Default Customer Location', + default=lambda self: self.env.ref('stock.stock_location_customers')) + + default_supplier_location = fields.Many2one( + 'stock.location', 'Default Supplier Location', + default=lambda self: self.env.ref('stock.stock_location_suppliers')) + + @api.multi + def get_default_location(self, usage): + "Return the company's default location related to a usage type" + self.ensure_one() + + return ( + self.default_customer_location if usage == 'customer' else + self.default_supplier_location) diff --git a/partner_location_auto_create/models/res_partner.py b/partner_location_auto_create/models/res_partner.py new file mode 100644 index 000000000..1a4519a66 --- /dev/null +++ b/partner_location_auto_create/models/res_partner.py @@ -0,0 +1,156 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# This module copyright (C) 2015 Savoir-faire Linux +# (). +# +# 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 . +# +############################################################################## + +from openerp import models, fields, api, _ + + +class ResPartner(models.Model): + _inherit = 'res.partner' + + locations_count = fields.Integer( + compute='_compute_locations_count', store=False) + + location_ids = fields.One2many( + 'stock.location', 'partner_id', string='Locations') + + @api.one + @api.depends('location_ids') + def _compute_locations_count(self): + self.locations_count = len(self.location_ids) + + @api.multi + def button_locations(self): + self.ensure_one() + + res = { + 'name': _('Locations'), + 'type': 'ir.actions.act_window', + 'res_model': 'stock.location', + 'view_type': 'form', + } + + if len(self.location_ids) == 1: + res['res_id'] = self.location_ids.id + res['view_mode'] = 'form' + else: + res['domain'] = [('partner_id', '=', self.id)] + res['view_mode'] = 'tree,form' + + return res + + @api.multi + def get_main_location(self, usage): + self.ensure_one() + return self.location_ids.filtered( + lambda l: l.usage == usage and l.main_partner_location) + + @api.one + def _create_main_partner_location(self): + if self.customer and self.property_stock_customer.partner_id != self: + location_customer = ( + self.get_main_location('customer') or + self._create_main_location('customer')) + + self.write({'property_stock_customer': location_customer}) + + if self.supplier and self.property_stock_supplier.partner_id != self: + location_supplier = ( + self.get_main_location('supplier') or + self._create_main_location('supplier')) + + self.write({'property_stock_supplier': location_supplier}) + + @api.multi + def _create_main_location(self, usage): + self.ensure_one() + + parent = ( + self.get_main_location(usage) or + self.company_id.get_default_location(usage) + ) + + return self.env['stock.location'].create({ + 'name': self.name, + 'usage': usage, + 'partner_id': self.id, + 'company_id': self.company_id.id, + 'location_id': parent.id, + 'main_partner_location': True, + }) + + @api.one + def _remove_locations(self): + """ + Unlink all locations related to the partner + where no stock have been moved. + + This is required to prevent unrequired locations to + be created when a new partner is tagged as a company + by mistake. + """ + move_obj = self.env['stock.move'] + for location in self.location_ids: + moves = move_obj.search([ + '|', + ('location_id', 'child_of', location.id), + ('location_dest_id', 'child_of', location.id), + ]) + if not moves: + location.unlink() + + @api.model + def create(self, vals): + """ The first time a partner is created, a main customer + and / or supplier location is created for this partner """ + partner = super(ResPartner, self).create(vals) + + if vals.get('is_company', False): + partner._create_main_partner_location() + + return partner + + @api.multi + def write(self, vals): + if vals.get('name'): + for partner in self: + locations = partner.location_ids.filtered( + lambda l: l.name == partner.name) + locations.write({'name': vals.get('name')}) + + res = super(ResPartner, self).write(vals) + + if ( + vals.get('is_company') or + vals.get('customer') or + vals.get('supplier') + ): + for partner in self.filtered('is_company'): + partner._create_main_partner_location() + + if 'is_company' in vals and not vals['is_company']: + # When False is written to field 'is_company' + self._remove_locations() + + if 'active' in vals: + self.location_ids.write({'active': vals['active']}) + + return res diff --git a/partner_location_auto_create/models/stock_location.py b/partner_location_auto_create/models/stock_location.py new file mode 100644 index 000000000..2629fc0e8 --- /dev/null +++ b/partner_location_auto_create/models/stock_location.py @@ -0,0 +1,48 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# This module copyright (C) 2015 Savoir-faire Linux +# (). +# +# 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 . +# +############################################################################## + +from openerp import models, fields, api, _ +from openerp.exceptions import Warning + + +class StockLocation(models.Model): + _inherit = 'stock.location' + + main_partner_location = fields.Boolean( + 'Main Partner Location', + help="The root location for a partner's location for a specific " + "type.") + + @api.one + @api.constrains('partner_id', 'main_partner_location', 'usage') + def _check_main_location(self): + partner = self.partner_id + + if partner and len(partner.get_main_location(self.usage)) > 1: + raise Warning( + _('The partner %s already has a main location ' + 'of type %s.') % (partner.name, self.usage)) + + @api.onchange('partner_id', 'usage') + def _onchange_parent_location(self): + if self.partner_id: + self.location_id = self.partner_id.get_main_location(self.usage).id diff --git a/partner_location_auto_create/tests/__init__.py b/partner_location_auto_create/tests/__init__.py new file mode 100644 index 000000000..db2fcaf14 --- /dev/null +++ b/partner_location_auto_create/tests/__init__.py @@ -0,0 +1,23 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# This module copyright (C) 2015 Savoir-faire Linux +# (). +# +# 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 . +# +############################################################################## + +from . import test_res_partner diff --git a/partner_location_auto_create/tests/test_res_partner.py b/partner_location_auto_create/tests/test_res_partner.py new file mode 100644 index 000000000..3109e7219 --- /dev/null +++ b/partner_location_auto_create/tests/test_res_partner.py @@ -0,0 +1,279 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# This module copyright (C) 2015 Savoir-faire Linux +# (). +# +# 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 . +# +############################################################################## + +from openerp.tests.common import TransactionCase + + +class TestPartnerLocations(TransactionCase): + + def setUp(self): + super(TestPartnerLocations, self).setUp() + + self.partner_model = self.env['res.partner'] + self.location_model = self.env['stock.location'] + self.company_model = self.env['res.company'] + + self.company_2 = self.company_model.create({'name': 'Test Company'}) + + self.customer_location = self.env.ref('stock.stock_location_customers') + self.supplier_location = self.env.ref('stock.stock_location_suppliers') + + self.customer_location_2 = self.location_model.create({ + 'usage': 'customer', + 'name': 'Default Customer Location 2', + 'company_id': self.company_2.id, + }) + + self.supplier_location_2 = self.location_model.create({ + 'usage': 'supplier', + 'name': 'Default Supplier Location 2', + 'company_id': self.company_2.id, + }) + + self.company_2.write({ + 'default_customer_location': self.customer_location_2.id, + 'default_supplier_location': self.supplier_location_2.id, + }) + + self.customer_a = self.partner_model.create({ + 'name': 'Customer A', + 'customer': True, + 'supplier': False, + 'is_company': True, + 'company_id': self.company_2.id, + }) + + self.supplier_b = self.partner_model.create({ + 'name': 'Supplier B', + 'customer': False, + 'supplier': True, + 'is_company': True, + 'company_id': self.company_2.id, + }) + + self.partner_c = self.partner_model.create({ + 'name': 'Partner C', + 'customer': True, + 'supplier': True, + 'is_company': True, + }) + + def _create_locations(self): + self.locations = [ + self.location_model.create({ + 'partner_id': record[0].id, + 'name': record[1], + 'usage': record[2], + 'company_id': record[0].company_id.id, + }) for record in [ + (self.customer_a, 'Location A-1', 'customer'), + (self.customer_a, 'Location A-2', 'supplier'), + (self.supplier_b, 'Location B-1', 'customer'), + (self.supplier_b, 'Location B-2', 'supplier'), + (self.supplier_b, 'Location B-3', 'supplier'), + ] + ] + + self.customer_a.refresh() + self.supplier_b.refresh() + + def test_partner_inactive(self): + self._create_locations() + + self.assertEqual(len(self.customer_a.location_ids), 3) + + self.customer_a.write({'active': False}) + self.customer_a.refresh() + self.assertEqual(len(self.customer_a.location_ids), 0) + + for location in self.customer_a.location_ids: + self.assertFalse(location.active) + + def test_partner_change_name(self): + # Test with customer A + self.assertEqual( + self.customer_a.property_stock_customer.name, + 'Customer A') + + self.customer_a.property_stock_customer.write({ + 'name': 'Location A-1', + }) + + self.customer_a.write({'name': 'Customer AA'}) + + self.customer_a.refresh() + self.assertEqual( + self.customer_a.property_stock_customer.name, + 'Location A-1') + + # Test with partner C + self.assertEqual( + self.partner_c.property_stock_customer.name, + 'Partner C') + + self.partner_c.write({'name': 'Partner CC'}) + self.partner_c.refresh() + self.assertEqual( + self.partner_c.property_stock_customer.name, + 'Partner CC') + + self.assertEqual( + self.partner_c.property_stock_supplier.name, + 'Partner CC') + + def test_partner_location_parent(self): + self.assertEqual( + self.customer_a.property_stock_customer.location_id, + self.customer_location_2) + + self.assertEqual( + self.supplier_b.property_stock_supplier.location_id, + self.supplier_location_2) + + self.assertEqual( + self.partner_c.property_stock_customer.location_id, + self.customer_location) + + self.assertEqual( + self.partner_c.property_stock_supplier.location_id, + self.supplier_location) + + def test_partner_not_company(self): + """ + Partners that are not companies must not generate locations + """ + self.partner_d = self.partner_model.create({ + 'name': 'Partner D', + 'customer': True, + 'supplier': True, + 'is_company': False, + 'company_id': self.company_2.id, + }) + + self.assertEqual(len(self.partner_d.location_ids), 0) + + # If the partner becomes a company, the locations must + # be created + self.partner_d.write({'is_company': True}) + self.partner_d.refresh() + self.assertEqual(len(self.partner_d.location_ids), 2) + + def test_location_parent(self): + self.assertEqual(len(self.partner_c.location_ids), 2) + for location in self.partner_c.location_ids: + self.assertEqual(location.location_id.usage, location.usage) + + def test_count_locations(self): + self._create_locations() + self.assertEqual(len(self.customer_a.location_ids), 3) + self.assertEqual(len(self.supplier_b.location_ids), 4) + self.assertEqual(len(self.partner_c.location_ids), 2) + + def test_multi_company(self): + self._create_locations() + + self.assertEqual(len(self.customer_a.location_ids), 3) + for location in self.customer_a.location_ids: + self.assertEqual(location.company_id, self.company_2) + + def check_partner_c(self): + self.assertEqual(len(self.partner_c.location_ids), 2) + + location_c1 = self.partner_c.property_stock_customer + location_c2 = self.partner_c.property_stock_supplier + locations = self.partner_c.location_ids + + self.assertIn(location_c1, locations) + self.assertEqual(location_c1.usage, 'customer') + self.assertIn(location_c2, locations) + self.assertEqual(location_c2.usage, 'supplier') + + def test_partner_create(self): + self.assertEqual(len(self.customer_a.location_ids), 1) + location_a = self.customer_a.location_ids[0] + self.assertEqual(self.customer_a.location_ids[0].usage, 'customer') + self.assertEqual(self.customer_a.property_stock_customer, location_a) + + self.assertEqual(len(self.supplier_b.location_ids), 1) + location_b = self.supplier_b.location_ids[0] + self.assertEqual(location_b.usage, 'supplier') + self.assertEqual(self.supplier_b.property_stock_supplier, location_b) + + self.check_partner_c() + + def check_customer_a_supplier_location(self): + location_a = self.customer_a.property_stock_supplier + self.assertIn(location_a, self.customer_a.location_ids) + self.assertEqual(location_a.usage, 'supplier') + + def check_supplier_b_customer_location(self): + location_b = self.supplier_b.property_stock_customer + self.assertIn(location_b, self.supplier_b.location_ids) + self.assertEqual(location_b.usage, 'customer') + + def test_partner_write(self): + """ + Test write method when partner does not already have the required + location + """ + self.customer_a.write({'supplier': True}) + self.supplier_b.write({'customer': True}) + + self.assertEqual(len(self.customer_a.location_ids), 2) + self.check_customer_a_supplier_location() + + self.assertEqual(len(self.supplier_b.location_ids), 2) + self.check_supplier_b_customer_location() + + def test_partner_write_existing_location(self): + """ + Test write method when partner already has the required location + """ + self._create_locations() + + self.customer_a.write({'supplier': True}) + self.customer_a.refresh() + self.assertEqual(len(self.customer_a.location_ids), 4) + self.check_customer_a_supplier_location() + + self.supplier_b.write({'customer': True}) + self.supplier_b.refresh() + self.assertEqual(len(self.supplier_b.location_ids), 5) + self.check_supplier_b_customer_location() + + self.partner_c.write({'supplier': True, 'customer': True}) + self.check_partner_c() + + def test_partner_write_is_company_false(self): + """ + Test that locations related to a partner are unlinked + when a is_company is set to False + """ + self._create_locations() + + self.assertEqual(len(self.customer_a.location_ids), 3) + self.customer_a.write({ + 'supplier': True, + 'is_company': False, + }) + self.customer_a.refresh() + self.assertEqual(len(self.customer_a.location_ids), 0) diff --git a/partner_location_auto_create/views/res_company_view.xml b/partner_location_auto_create/views/res_company_view.xml new file mode 100644 index 000000000..adcce02fe --- /dev/null +++ b/partner_location_auto_create/views/res_company_view.xml @@ -0,0 +1,18 @@ + + + + + + Company Form Default Stock Locations + res.company + + + + + + + + + + + diff --git a/partner_location_auto_create/views/res_partner_view.xml b/partner_location_auto_create/views/res_partner_view.xml new file mode 100644 index 000000000..e5e0a2aef --- /dev/null +++ b/partner_location_auto_create/views/res_partner_view.xml @@ -0,0 +1,42 @@ + + + + + + Partner Form Locations + res.partner + + +
+ +
+ + + [ + ('partner_id', 'in', [id, False]), + ('usage', '=', 'customer'), + ('company_id', 'in', [company_id, False]), + ] + + + [ + ('partner_id', 'in', [id, False]), + ('usage', '=', 'supplier'), + ('company_id', 'in', [company_id, False]), + ] + +
+
+ +
+
diff --git a/partner_location_auto_create/views/stock_location_view.xml b/partner_location_auto_create/views/stock_location_view.xml new file mode 100644 index 000000000..98df17dd7 --- /dev/null +++ b/partner_location_auto_create/views/stock_location_view.xml @@ -0,0 +1,17 @@ + + + + + + stock.location.form + stock.location + + + + + + + + + + From 006fefd6856fa8b4088b1c41c847111401cf08db Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Sun, 28 Feb 2016 02:04:25 -0500 Subject: [PATCH 2/3] OCA Transbot updated translations from Transifex --- partner_location_auto_create/i18n/de.po | 87 ++++++++++++++++++++++++ partner_location_auto_create/i18n/en.po | 87 ++++++++++++++++++++++++ partner_location_auto_create/i18n/es.po | 87 ++++++++++++++++++++++++ partner_location_auto_create/i18n/fi.po | 87 ++++++++++++++++++++++++ partner_location_auto_create/i18n/fr.po | 64 ++++++++++++++---- partner_location_auto_create/i18n/sl.po | 88 +++++++++++++++++++++++++ 6 files changed, 489 insertions(+), 11 deletions(-) create mode 100644 partner_location_auto_create/i18n/de.po create mode 100644 partner_location_auto_create/i18n/en.po create mode 100644 partner_location_auto_create/i18n/es.po create mode 100644 partner_location_auto_create/i18n/fi.po create mode 100644 partner_location_auto_create/i18n/sl.po diff --git a/partner_location_auto_create/i18n/de.po b/partner_location_auto_create/i18n/de.po new file mode 100644 index 000000000..cd8dc6a2c --- /dev/null +++ b/partner_location_auto_create/i18n/de.po @@ -0,0 +1,87 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * partner_location_auto_create +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: stock-logistics-warehouse (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-02-26 14:13+0000\n" +"PO-Revision-Date: 2016-02-26 14:13+0000\n" +"Last-Translator: <>\n" +"Language-Team: German (http://www.transifex.com/oca/OCA-stock-logistics-warehouse-8-0/language/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: partner_location_auto_create +#: model:ir.model,name:partner_location_auto_create.model_res_company +msgid "Companies" +msgstr "Unternehmen" + +#. module: partner_location_auto_create +#: field:res.company,default_customer_location:0 +msgid "Default Customer Location" +msgstr "" + +#. module: partner_location_auto_create +#: field:res.company,default_supplier_location:0 +msgid "Default Supplier Location" +msgstr "" + +#. module: partner_location_auto_create +#: model:ir.model,name:partner_location_auto_create.model_stock_location +msgid "Inventory Locations" +msgstr "Bestandslagerorte" + +#. module: partner_location_auto_create +#: code:addons/partner_location_auto_create/models/res_partner.py:45 +#: view:res.partner:partner_location_auto_create.view_partner_form +#: field:res.partner,location_ids:0 +#, python-format +msgid "Locations" +msgstr "Lagerorte" + +#. module: partner_location_auto_create +#: field:stock.location,main_partner_location:0 +msgid "Main Partner Location" +msgstr "" + +#. module: partner_location_auto_create +#: model:ir.model,name:partner_location_auto_create.model_res_partner +msgid "Partner" +msgstr "Partner" + +#. module: partner_location_auto_create +#: code:addons/partner_location_auto_create/models/stock_location.py:42 +#, python-format +msgid "The partner %s already has a main location of type %s." +msgstr "" + +#. module: partner_location_auto_create +#: help:stock.location,main_partner_location:0 +msgid "The root location for a partner's location for a specific type." +msgstr "" + +#. module: partner_location_auto_create +#: view:res.partner:partner_location_auto_create.view_partner_form +msgid "" +"[\n" +" ('partner_id', 'in', [id, False]),\n" +" ('usage', '=', 'customer'),\n" +" ('company_id', 'in', [company_id, False]),\n" +" ]" +msgstr "" + +#. module: partner_location_auto_create +#: view:res.partner:partner_location_auto_create.view_partner_form +msgid "" +"[\n" +" ('partner_id', 'in', [id, False]),\n" +" ('usage', '=', 'supplier'),\n" +" ('company_id', 'in', [company_id, False]),\n" +" ]" +msgstr "" diff --git a/partner_location_auto_create/i18n/en.po b/partner_location_auto_create/i18n/en.po new file mode 100644 index 000000000..c91126d0a --- /dev/null +++ b/partner_location_auto_create/i18n/en.po @@ -0,0 +1,87 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * partner_location_auto_create +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: stock-logistics-warehouse (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-02-26 14:13+0000\n" +"PO-Revision-Date: 2016-02-26 14:13+0000\n" +"Last-Translator: OCA Transbot \n" +"Language-Team: English (http://www.transifex.com/oca/OCA-stock-logistics-warehouse-8-0/language/en/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: en\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: partner_location_auto_create +#: model:ir.model,name:partner_location_auto_create.model_res_company +msgid "Companies" +msgstr "Companies" + +#. module: partner_location_auto_create +#: field:res.company,default_customer_location:0 +msgid "Default Customer Location" +msgstr "Default Customer Location" + +#. module: partner_location_auto_create +#: field:res.company,default_supplier_location:0 +msgid "Default Supplier Location" +msgstr "Default Supplier Location" + +#. module: partner_location_auto_create +#: model:ir.model,name:partner_location_auto_create.model_stock_location +msgid "Inventory Locations" +msgstr "Inventory Locations" + +#. module: partner_location_auto_create +#: code:addons/partner_location_auto_create/models/res_partner.py:45 +#: view:res.partner:partner_location_auto_create.view_partner_form +#: field:res.partner,location_ids:0 +#, python-format +msgid "Locations" +msgstr "Locations" + +#. module: partner_location_auto_create +#: field:stock.location,main_partner_location:0 +msgid "Main Partner Location" +msgstr "Main Partner Location" + +#. module: partner_location_auto_create +#: model:ir.model,name:partner_location_auto_create.model_res_partner +msgid "Partner" +msgstr "Partner" + +#. module: partner_location_auto_create +#: code:addons/partner_location_auto_create/models/stock_location.py:42 +#, python-format +msgid "The partner %s already has a main location of type %s." +msgstr "The partner %s already has a main location of type %s." + +#. module: partner_location_auto_create +#: help:stock.location,main_partner_location:0 +msgid "The root location for a partner's location for a specific type." +msgstr "The root location for a partner's location for a specific type." + +#. module: partner_location_auto_create +#: view:res.partner:partner_location_auto_create.view_partner_form +msgid "" +"[\n" +" ('partner_id', 'in', [id, False]),\n" +" ('usage', '=', 'customer'),\n" +" ('company_id', 'in', [company_id, False]),\n" +" ]" +msgstr "[\n ('partner_id', 'in', [id, False]),\n ('usage', '=', 'customer'),\n ('company_id', 'in', [company_id, False]),\n ]" + +#. module: partner_location_auto_create +#: view:res.partner:partner_location_auto_create.view_partner_form +msgid "" +"[\n" +" ('partner_id', 'in', [id, False]),\n" +" ('usage', '=', 'supplier'),\n" +" ('company_id', 'in', [company_id, False]),\n" +" ]" +msgstr "[\n ('partner_id', 'in', [id, False]),\n ('usage', '=', 'supplier'),\n ('company_id', 'in', [company_id, False]),\n ]" diff --git a/partner_location_auto_create/i18n/es.po b/partner_location_auto_create/i18n/es.po new file mode 100644 index 000000000..2b11c8e12 --- /dev/null +++ b/partner_location_auto_create/i18n/es.po @@ -0,0 +1,87 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * partner_location_auto_create +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: stock-logistics-warehouse (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-02-26 14:13+0000\n" +"PO-Revision-Date: 2016-02-26 14:13+0000\n" +"Last-Translator: <>\n" +"Language-Team: Spanish (http://www.transifex.com/oca/OCA-stock-logistics-warehouse-8-0/language/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: partner_location_auto_create +#: model:ir.model,name:partner_location_auto_create.model_res_company +msgid "Companies" +msgstr "Compañías" + +#. module: partner_location_auto_create +#: field:res.company,default_customer_location:0 +msgid "Default Customer Location" +msgstr "" + +#. module: partner_location_auto_create +#: field:res.company,default_supplier_location:0 +msgid "Default Supplier Location" +msgstr "" + +#. module: partner_location_auto_create +#: model:ir.model,name:partner_location_auto_create.model_stock_location +msgid "Inventory Locations" +msgstr "Ubicaciones de inventario" + +#. module: partner_location_auto_create +#: code:addons/partner_location_auto_create/models/res_partner.py:45 +#: view:res.partner:partner_location_auto_create.view_partner_form +#: field:res.partner,location_ids:0 +#, python-format +msgid "Locations" +msgstr "Ubicaciones" + +#. module: partner_location_auto_create +#: field:stock.location,main_partner_location:0 +msgid "Main Partner Location" +msgstr "" + +#. module: partner_location_auto_create +#: model:ir.model,name:partner_location_auto_create.model_res_partner +msgid "Partner" +msgstr "" + +#. module: partner_location_auto_create +#: code:addons/partner_location_auto_create/models/stock_location.py:42 +#, python-format +msgid "The partner %s already has a main location of type %s." +msgstr "" + +#. module: partner_location_auto_create +#: help:stock.location,main_partner_location:0 +msgid "The root location for a partner's location for a specific type." +msgstr "" + +#. module: partner_location_auto_create +#: view:res.partner:partner_location_auto_create.view_partner_form +msgid "" +"[\n" +" ('partner_id', 'in', [id, False]),\n" +" ('usage', '=', 'customer'),\n" +" ('company_id', 'in', [company_id, False]),\n" +" ]" +msgstr "" + +#. module: partner_location_auto_create +#: view:res.partner:partner_location_auto_create.view_partner_form +msgid "" +"[\n" +" ('partner_id', 'in', [id, False]),\n" +" ('usage', '=', 'supplier'),\n" +" ('company_id', 'in', [company_id, False]),\n" +" ]" +msgstr "" diff --git a/partner_location_auto_create/i18n/fi.po b/partner_location_auto_create/i18n/fi.po new file mode 100644 index 000000000..f661e236f --- /dev/null +++ b/partner_location_auto_create/i18n/fi.po @@ -0,0 +1,87 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * partner_location_auto_create +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: stock-logistics-warehouse (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-02-26 14:13+0000\n" +"PO-Revision-Date: 2016-02-26 14:13+0000\n" +"Last-Translator: <>\n" +"Language-Team: Finnish (http://www.transifex.com/oca/OCA-stock-logistics-warehouse-8-0/language/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: partner_location_auto_create +#: model:ir.model,name:partner_location_auto_create.model_res_company +msgid "Companies" +msgstr "" + +#. module: partner_location_auto_create +#: field:res.company,default_customer_location:0 +msgid "Default Customer Location" +msgstr "" + +#. module: partner_location_auto_create +#: field:res.company,default_supplier_location:0 +msgid "Default Supplier Location" +msgstr "" + +#. module: partner_location_auto_create +#: model:ir.model,name:partner_location_auto_create.model_stock_location +msgid "Inventory Locations" +msgstr "" + +#. module: partner_location_auto_create +#: code:addons/partner_location_auto_create/models/res_partner.py:45 +#: view:res.partner:partner_location_auto_create.view_partner_form +#: field:res.partner,location_ids:0 +#, python-format +msgid "Locations" +msgstr "Paikat" + +#. module: partner_location_auto_create +#: field:stock.location,main_partner_location:0 +msgid "Main Partner Location" +msgstr "" + +#. module: partner_location_auto_create +#: model:ir.model,name:partner_location_auto_create.model_res_partner +msgid "Partner" +msgstr "" + +#. module: partner_location_auto_create +#: code:addons/partner_location_auto_create/models/stock_location.py:42 +#, python-format +msgid "The partner %s already has a main location of type %s." +msgstr "" + +#. module: partner_location_auto_create +#: help:stock.location,main_partner_location:0 +msgid "The root location for a partner's location for a specific type." +msgstr "" + +#. module: partner_location_auto_create +#: view:res.partner:partner_location_auto_create.view_partner_form +msgid "" +"[\n" +" ('partner_id', 'in', [id, False]),\n" +" ('usage', '=', 'customer'),\n" +" ('company_id', 'in', [company_id, False]),\n" +" ]" +msgstr "" + +#. module: partner_location_auto_create +#: view:res.partner:partner_location_auto_create.view_partner_form +msgid "" +"[\n" +" ('partner_id', 'in', [id, False]),\n" +" ('usage', '=', 'supplier'),\n" +" ('company_id', 'in', [company_id, False]),\n" +" ]" +msgstr "" diff --git a/partner_location_auto_create/i18n/fr.po b/partner_location_auto_create/i18n/fr.po index 476a435f1..5854d5913 100644 --- a/partner_location_auto_create/i18n/fr.po +++ b/partner_location_auto_create/i18n/fr.po @@ -1,20 +1,21 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * partner_location_auto_create -# +# * partner_location_auto_create +# +# Translators: msgid "" msgstr "" -"Project-Id-Version: Odoo Server 8.0\n" +"Project-Id-Version: stock-logistics-warehouse (8.0)\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-04-28 13:22+0000\n" -"PO-Revision-Date: 2015-04-28 09:25-0500\n" -"Last-Translator: David Dufresne \n" -"Language-Team: \n" +"POT-Creation-Date: 2016-02-26 14:13+0000\n" +"PO-Revision-Date: 2016-02-26 17:02+0000\n" +"Last-Translator: OCA Transbot \n" +"Language-Team: French (http://www.transifex.com/oca/OCA-stock-logistics-warehouse-8-0/language/fr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: \n" -"X-Generator: Poedit 1.5.4\n" +"Content-Transfer-Encoding: \n" +"Language: fr\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: partner_location_auto_create #: model:ir.model,name:partner_location_auto_create.model_res_company @@ -32,14 +33,55 @@ msgid "Default Supplier Location" msgstr "Emplacement fournisseur par défaut" #. module: partner_location_auto_create -#: code:addons/partner_location_auto_create/models/res_partner.py:44 +#: model:ir.model,name:partner_location_auto_create.model_stock_location +msgid "Inventory Locations" +msgstr "Emplacements d'inventaire" + +#. module: partner_location_auto_create +#: code:addons/partner_location_auto_create/models/res_partner.py:45 #: view:res.partner:partner_location_auto_create.view_partner_form #: field:res.partner,location_ids:0 #, python-format msgid "Locations" msgstr "Emplacements" +#. module: partner_location_auto_create +#: field:stock.location,main_partner_location:0 +msgid "Main Partner Location" +msgstr "" + #. module: partner_location_auto_create #: model:ir.model,name:partner_location_auto_create.model_res_partner msgid "Partner" msgstr "Partenaire" + +#. module: partner_location_auto_create +#: code:addons/partner_location_auto_create/models/stock_location.py:42 +#, python-format +msgid "The partner %s already has a main location of type %s." +msgstr "" + +#. module: partner_location_auto_create +#: help:stock.location,main_partner_location:0 +msgid "The root location for a partner's location for a specific type." +msgstr "" + +#. module: partner_location_auto_create +#: view:res.partner:partner_location_auto_create.view_partner_form +msgid "" +"[\n" +" ('partner_id', 'in', [id, False]),\n" +" ('usage', '=', 'customer'),\n" +" ('company_id', 'in', [company_id, False]),\n" +" ]" +msgstr "" + +#. module: partner_location_auto_create +#: view:res.partner:partner_location_auto_create.view_partner_form +msgid "" +"[\n" +" ('partner_id', 'in', [id, False]),\n" +" ('usage', '=', 'supplier'),\n" +" ('company_id', 'in', [company_id, False]),\n" +" ]" +msgstr "" diff --git a/partner_location_auto_create/i18n/sl.po b/partner_location_auto_create/i18n/sl.po new file mode 100644 index 000000000..62fe16307 --- /dev/null +++ b/partner_location_auto_create/i18n/sl.po @@ -0,0 +1,88 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * partner_location_auto_create +# +# Translators: +# Matjaž Mozetič , 2016 +msgid "" +msgstr "" +"Project-Id-Version: stock-logistics-warehouse (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-02-26 14:13+0000\n" +"PO-Revision-Date: 2016-02-27 16:56+0000\n" +"Last-Translator: Matjaž Mozetič \n" +"Language-Team: Slovenian (http://www.transifex.com/oca/OCA-stock-logistics-warehouse-8-0/language/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: partner_location_auto_create +#: model:ir.model,name:partner_location_auto_create.model_res_company +msgid "Companies" +msgstr "Družbe" + +#. module: partner_location_auto_create +#: field:res.company,default_customer_location:0 +msgid "Default Customer Location" +msgstr "Privzeta lokacija kupca" + +#. module: partner_location_auto_create +#: field:res.company,default_supplier_location:0 +msgid "Default Supplier Location" +msgstr "Privzeta lokacija dobavitelja" + +#. module: partner_location_auto_create +#: model:ir.model,name:partner_location_auto_create.model_stock_location +msgid "Inventory Locations" +msgstr "Lokacije inventarja" + +#. module: partner_location_auto_create +#: code:addons/partner_location_auto_create/models/res_partner.py:45 +#: view:res.partner:partner_location_auto_create.view_partner_form +#: field:res.partner,location_ids:0 +#, python-format +msgid "Locations" +msgstr "Lokacije" + +#. module: partner_location_auto_create +#: field:stock.location,main_partner_location:0 +msgid "Main Partner Location" +msgstr "Glavna lokacija partnerja" + +#. module: partner_location_auto_create +#: model:ir.model,name:partner_location_auto_create.model_res_partner +msgid "Partner" +msgstr "Partner" + +#. module: partner_location_auto_create +#: code:addons/partner_location_auto_create/models/stock_location.py:42 +#, python-format +msgid "The partner %s already has a main location of type %s." +msgstr "Partner %s že ima glavno lokacijo tipa %s." + +#. module: partner_location_auto_create +#: help:stock.location,main_partner_location:0 +msgid "The root location for a partner's location for a specific type." +msgstr "Temeljna lokacija za partnerjevo lokacijo določenega tipa." + +#. module: partner_location_auto_create +#: view:res.partner:partner_location_auto_create.view_partner_form +msgid "" +"[\n" +" ('partner_id', 'in', [id, False]),\n" +" ('usage', '=', 'customer'),\n" +" ('company_id', 'in', [company_id, False]),\n" +" ]" +msgstr "[\n ('partner_id', 'in', [id, False]),\n ('usage', '=', 'customer'),\n ('company_id', 'in', [company_id, False]),\n ]" + +#. module: partner_location_auto_create +#: view:res.partner:partner_location_auto_create.view_partner_form +msgid "" +"[\n" +" ('partner_id', 'in', [id, False]),\n" +" ('usage', '=', 'supplier'),\n" +" ('company_id', 'in', [company_id, False]),\n" +" ]" +msgstr "[\n ('partner_id', 'in', [id, False]),\n ('usage', '=', 'supplier'),\n ('company_id', 'in', [company_id, False]),\n ]" From 9da0bf7b78c01efc3d0c1e50e4aa9ad21d897cb4 Mon Sep 17 00:00:00 2001 From: Cyril Gaudin Date: Mon, 21 Mar 2016 14:09:55 +0100 Subject: [PATCH 3/3] [MOV] partner_location_auto_create: make module uninstallable --- partner_location_auto_create/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/partner_location_auto_create/__openerp__.py b/partner_location_auto_create/__openerp__.py index 870aaebf4..8f0845f56 100644 --- a/partner_location_auto_create/__openerp__.py +++ b/partner_location_auto_create/__openerp__.py @@ -40,5 +40,5 @@ ], 'test': [], 'auto_install': False, - 'installable': True, + 'installable': False, }