Skip to content

Commit

Permalink
[REL] Migration: sale_stock_multic_fix to 11.0
Browse files Browse the repository at this point in the history
* [FIX] Update readme and manifest
* [FIX] remove api.multi in constrains method
* [FIX] change the if statament to filtered
  • Loading branch information
nicomacr committed Oct 18, 2018
1 parent 00d5275 commit d8f2ae2
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 33 deletions.
37 changes: 17 additions & 20 deletions sale_stock_multic_fix/README.rst
@@ -1,5 +1,13 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
.. |company| replace:: ADHOC SA

.. |company_logo| image:: https://raw.githubusercontent.com/ingadhoc/maintainer-tools/master/resources/adhoc-logo.png
:alt: ADHOC SA
:target: https://www.adhoc.com.ar

.. |icon| image:: https://raw.githubusercontent.com/ingadhoc/maintainer-tools/master/resources/adhoc-icon.png

.. image:: https://img.shields.io/badge/license-AGPL--3-blue.png
:target: https://www.gnu.org/licenses/agpl
:alt: License: AGPL-3

==============================
Expand All @@ -13,14 +21,14 @@ Installation

To install this module, you need to:

#. Do this ...
#. Only need to install the module

Configuration
=============

To configure this module, you need to:

#. Go to ...
#. Nothing to configure

Usage
=====
Expand All @@ -31,21 +39,13 @@ 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.adhoc.com.ar/

.. repo_id is available in https://github.com/OCA/maintainer-tools/blob/master/tools/repos_with_ids.txt
.. branch is "8.0" for example
Known issues / Roadmap
======================

* ...
:target: http://runbot.adhoc.com.ar/

Bug Tracker
===========

Bugs are tracked on `GitHub Issues
<https://github.com/ingadhoc/{project_repo}/issues>`_. In case of trouble, please
<https://github.com/ingadhoc/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.

Expand All @@ -55,19 +55,16 @@ Credits
Images
------

* ADHOC SA: `Icon <http://fotos.subefotos.com/83fed853c1e15a8023b86b2b22d6145bo.png>`_.
* |company| |icon|

Contributors
------------


Maintainer
----------

.. image:: http://fotos.subefotos.com/83fed853c1e15a8023b86b2b22d6145bo.png
:alt: Odoo Community Association
:target: https://www.adhoc.com.ar
|company_logo|

This module is maintained by the ADHOC SA.
This module is maintained by the |company|.

To contribute to this module, please visit https://www.adhoc.com.ar.
Empty file modified sale_stock_multic_fix/__init__.py 100755 → 100644
Empty file.
12 changes: 6 additions & 6 deletions sale_stock_multic_fix/__manifest__.py
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar)
Expand All @@ -19,16 +18,17 @@
#
##############################################################################
{
'name': 'Sale-Stock Multi Company Fixes',
'version': '11.0.1.0.0',
'author': 'ADHOC SA',
'website': 'www.adhoc.com.ar',
'license': 'AGPL-3',
'category': 'Accounting & Finance',
'depends': [
'sale_stock'
],
'data': [
],
'demo': [],
'depends': ['sale_stock'],
'installable': False,
'name': 'Sale-Stock Multi Company Fixes',
'test': [],
'version': '11.0.1.0.0',
'installable': True,
}
Empty file modified sale_stock_multic_fix/models/__init__.py 100755 → 100644
Empty file.
13 changes: 6 additions & 7 deletions sale_stock_multic_fix/models/sale_order.py
Expand Up @@ -9,12 +9,11 @@
class SaleOrder(models.Model):
_inherit = "sale.order"

@api.multi
@api.constrains('company_id', 'warehouse_id')
def check_company(self):
for rec in self:
warehouse_id_company = rec.warehouse_id.company_id
if warehouse_id_company and warehouse_id_company != rec.company_id:
raise ValidationError(_(
'The warehouse company must be the same as the sale '
'order company'))
for rec in self.filtered(
lambda s: s.warehouse_id and s.warehouse_id.company_id !=
s.company_id):
raise ValidationError(_(
'The warehouse company must be the same as the sale '
'order company'))

0 comments on commit d8f2ae2

Please sign in to comment.