Skip to content

Commit

Permalink
Merge pull request #10 from eLBati/7.0_pep8_fix
Browse files Browse the repository at this point in the history
PEP8 fix
  • Loading branch information
pedrobaeza committed Aug 7, 2014
2 parents ae30c9d + dab683c commit 6ef5ea8
Show file tree
Hide file tree
Showing 100 changed files with 1,038 additions and 729 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ env:
virtualenv:
system_site_packages: true

before_install:
- git clone https://github.com/OCA/product-attribute $HOME/product-attribute -b 7.0

install:
- git clone https://github.com/OCA/maintainer-quality-tools.git ${HOME}/maintainer-quality-tools
- export PATH=${HOME}/maintainer-quality-tools/travis:${PATH}
Expand Down
4 changes: 2 additions & 2 deletions account_invoice_reorder_lines/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
Expand All @@ -18,5 +18,5 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
#
from . import invoice
7 changes: 4 additions & 3 deletions account_invoice_reorder_lines/__openerp__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
Expand All @@ -18,13 +18,14 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
#
{
'name': 'Invoice lines with sequence number',
'version': '0.1',
'category': 'Generic Modules/Accounting',
'description': '''
Provide a new field on the invoice line form, allowing to manage the lines order.
Provide a new field on the invoice line form, allowing to manage the lines
order.
''',
'author': 'Tiny',
'website': 'http://www.openerp.com',
Expand Down
4 changes: 2 additions & 2 deletions account_invoice_reorder_lines/invoice.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
Expand All @@ -18,7 +18,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
#
from openerp.osv import orm


Expand Down
9 changes: 4 additions & 5 deletions mail_quotation/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2012 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
#
Expand All @@ -15,7 +15,6 @@
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
#
##############################################################################

36 changes: 18 additions & 18 deletions mail_quotation/__openerp__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2012 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
#
Expand All @@ -15,26 +15,26 @@
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
#
##############################################################################

{
"name" : "Mail quotation",
"version" : "0.1",
"author" : "Savoir-faire Linux",
"website" : "http://www.savoirfairelinux.com",
"license" : "AGPL-3",
"category" : "Mail",
"description" : """
This module adds a server action, an email template and a button on the sales order form to
send quotation by email.
"name": "Mail quotation",
"version": "0.1",
"author": "Savoir-faire Linux",
"website": "http://www.savoirfairelinux.com",
"license": "AGPL-3",
"category": "Mail",
"description": """
This module adds a server action, an email template and a button on the
sales order form to send quotation by email.
""",
"images" : [],
"depends" : ["sale"],
"demo" : [],
"test" : [],
"data" : [
"images": [],
"depends": ["sale"],
"demo": [],
"test": [],
"data": [
"quotation_action_data.xml",
"sale_order_view.xml",
],
Expand Down
4 changes: 2 additions & 2 deletions partner_prepayment/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# Author: Guewen Baconnier
# Copyright 2013 Camptocamp SA
Expand All @@ -17,6 +17,6 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
#

from . import model
4 changes: 2 additions & 2 deletions partner_prepayment/__openerp__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# Copyright 2013 Camptocamp SA
#
Expand All @@ -16,7 +16,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
#

{'name': 'Partner Prepayment',
'version': '1.0',
Expand Down
4 changes: 2 additions & 2 deletions partner_prepayment/model/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# Author: Guewen Baconnier
# Copyright 2013 Camptocamp SA
Expand All @@ -17,7 +17,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
#

from . import res_partner
from . import sale
7 changes: 4 additions & 3 deletions partner_prepayment/model/res_partner.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# Author: Guewen Baconnier
# Copyright 2013 Camptocamp SA
Expand All @@ -17,7 +17,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
#

from openerp.osv import orm, fields

Expand All @@ -33,6 +33,7 @@ class res_partner(orm.Model):
}

def _commercial_fields(self, cr, uid, context=None):
fields = super(res_partner, self)._commercial_fields(cr, uid, context=context)
fields = super(res_partner, self)._commercial_fields(
cr, uid, context=context)
fields.append('use_prepayment')
return fields
4 changes: 2 additions & 2 deletions partner_prepayment/model/sale.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# Author: Guewen Baconnier
# Copyright 2013 Camptocamp SA
Expand All @@ -17,7 +17,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
#

from openerp.osv import orm

Expand Down
4 changes: 2 additions & 2 deletions pricelist_share_companies/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# Author: Joël Grand-Guillaume
# Copyright 2010 Camptocamp SA
Expand All @@ -17,6 +17,6 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
#
import pricelist
import company
49 changes: 29 additions & 20 deletions pricelist_share_companies/__openerp__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# Author: Joël Grand-Guillaume
# Copyright 2010 Camptocamp SA
Expand All @@ -17,33 +17,42 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
#

{
'name' : 'Share pricelist between compagnies, not product',
'version' : '1.0',
'category' : 'Generic Modules/Projects & Services',
'description':
'''
In OpenERP, product prices (cost, list) are expressed in the currency of the price_type (by default the same than your company currency).
'name': 'Share pricelist between compagnies, not product',
'version': '1.0',
'category': 'Generic Modules/Projects & Services',
'description':
'''
In OpenERP, product prices (cost, list) are expressed in the currency of
the price_type (by default the same than your company currency).
The idea here is to have the same products between compagnies (with each one their own currency through different price_type and different costs) but
only one pricelist for all. For that purpose, we add a company_id on price_type object and a rule to separate them for each company. This way,
the price computation of pricelist will take the right price_type currency as based price.
The idea here is to have the same products between compagnies (with each one
their own currency through different price_type and different costs) but
only one pricelist for all. For that purpose, we add a company_id on price_type
object and a rule to separate them for each company. This way,
the price computation of pricelist will take the right price_type currency as
based price.
Concretely, to have a different cost price for a second company, you have to :
- Create a new standard price on product.template
- Create a new 'Price Type' on this new field, with the desired currency and assigned to the new currency
- Create a new 'Price Type' on this new field, with the desired currency and
assigned to the new currency
- Assign the existing 'Cost Price' to your main company
- On the setup of each company, in the 'Configuration''s Tab, select the product field used for the cost
- On the setup of each company, in the 'Configuration''s Tab, select
the product field used for the cost
The Price Type used is the first one found for the cost field configured on the company. To ensure the right Price Type
is selected, you have to put the company on the Price Types, and according to the security rule created, you will have access
The Price Type used is the first one found for the cost field configured on
the company. To ensure the right Price Type
is selected, you have to put the company on the Price Types, and according to
the security rule created, you will have access
only to the right Price Type.
Example:
I create a product A. it has 2 fields for cost prices : Cost Price and Cost Price CH
I create a product A. it has 2 fields for cost prices : Cost Price and
Cost Price CH
Price type Sale company A : Cost Price / EUR
Price type Sale company B : Cost Price CH / CHF
Expand All @@ -56,15 +65,15 @@
''',
'author' : 'Camptocamp',
'author': 'Camptocamp',
'website': 'http://camptocamp.com',
'depends' : ['product',],
'data' : [
'depends': ['product', ],
'data': [
'pricelist_view.xml',
'company_view.xml',
'security/pricelist_security.xml',
],
'demo' : [],
'demo': [],
'test': [],
'installable': True,
'auto_install': False,
Expand Down
19 changes: 13 additions & 6 deletions pricelist_share_companies/company.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# Author: Guewen Baconnier
# Copyright 2011 Camptocamp SA
Expand All @@ -17,10 +17,12 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
#
from openerp.osv import orm, fields


class ResCompany(orm.Model):

'''Override company to add the fields to use for the prices'''
_inherit = 'res.company'

Expand All @@ -29,18 +31,23 @@ def _price_field_get(self, cr, uid, context=None):
context = {}
mf = self.pool.get('ir.model.fields')
ids = mf.search(cr, uid,
[('model','in', (('product.product'),('product.template'))),
('ttype','=','float')],
[
('model', 'in', (
('product.product'), ('product.template')
)),
('ttype', '=', 'float')],
context=context)
res = [(False, '')]
for field in mf.browse(cr, uid, ids, context=context):
res.append((field.name, field.field_description))
return res

_columns = {
'standard_price_field': fields.selection(_price_field_get, 'Field for Cost Price', size=32,
'standard_price_field': fields.selection(
_price_field_get, 'Field for Cost Price', size=32,
required=True,
help="If a field is selected, it will be used instead of the \"standard_price\" field"
help="If a field is selected, it will be used instead of the "
"\"standard_price\" field"
"on the search of a Cost Price's Price Type.")
}

Expand Down
Loading

0 comments on commit 6ef5ea8

Please sign in to comment.