Skip to content

Commit

Permalink
porting stock_production_lot_multi_company to 10
Browse files Browse the repository at this point in the history
  • Loading branch information
eLBati committed Jul 19, 2017
1 parent c6fbbe1 commit 27572f3
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 17 deletions.
11 changes: 6 additions & 5 deletions stock_production_lot_multi_company/README.rst
Expand Up @@ -28,7 +28,7 @@ To use this module, you need to:

.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/133/8.0
:target: https://runbot.odoo-community.org/runbot/133/10.0

For further information, please visit:

Expand All @@ -42,10 +42,10 @@ Known issues / Roadmap
Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/multi-company/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed feedback
`here <https://github.com/OCA/multi-company/issues/new?body=module:%20stock_production_lot_multi_company%0Aversion:%208.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Bugs are tracked on `GitHub Issues
<https://github.com/OCA/multi-company/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
=======
Expand All @@ -56,6 +56,7 @@ Contributors
* Ainara Galdona <ainaragaldona@avanzosc.es>
* Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>
* Ana Juaristi <anajuarist@avanzosc.es>
* Lorenzo Battistini <lorenzo.battistini@agilebg.com>

Maintainer
----------
Expand Down
11 changes: 5 additions & 6 deletions stock_production_lot_multi_company/__manifest__.py
@@ -1,13 +1,12 @@
# -*- coding: utf-8 -*-
#############################################################################
# (c) 2015 Ainara Galdona - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
#############################################################################
# Copyright 2015 Ainara Galdona - AvanzOSC
# Copyright 2017 Lorenzo Battistini - Agile Business Group
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Stock Production Lot Multi Company",
"summary": "Make serial numbers multi-company aware",
"version": "8.0.1.0.0",
"version": "10.0.0.1.0",
"category": "Stock",
"license": "AGPL-3",
"author": "OdooMRP team, "
Expand All @@ -21,5 +20,5 @@
"security/stock_production_lot_security.xml",
"views/stock_production_lot_view.xml",
],
'installable': False,
'installable': True,
}
Expand Up @@ -2,7 +2,7 @@
# (c) 2015 Ainara Galdona - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html

from openerp import fields, models
from odoo import fields, models


class StockProductionLot(models.Model):
Expand All @@ -11,8 +11,7 @@ class StockProductionLot(models.Model):

def _default_company_id(self):
company_model = self.env['res.company']
company_id = company_model._company_default_get('stock.production.lot')
return company_model.browse(company_id)
return company_model._company_default_get('stock.production.lot')

company_id = fields.Many2one(
comodel_name='res.company', string='Company', change_default=True,
Expand Down
Expand Up @@ -2,8 +2,8 @@
# (c) 2015 Ainara Galdona - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html

from openerp.osv.orm import except_orm
from openerp.tests.common import TransactionCase
from odoo.exceptions import AccessError
from odoo.tests.common import TransactionCase


class TestStockProductionLotMultiCompany(TransactionCase):
Expand Down Expand Up @@ -102,7 +102,7 @@ def test_lot_multicomp_creation(self):
'multicompany company user.')

def test_error_lot_creation(self):
with self.assertRaises(except_orm):
with self.assertRaises(AccessError):
self.lot_model.sudo(self.second_user.id).create(
{'name': 'ERRORLOT',
'product_id': self.second_comp_product.id,
Expand Down

0 comments on commit 27572f3

Please sign in to comment.