Skip to content

Commit

Permalink
Merge pull request OCA#31 from guewen/profiles-and-travis
Browse files Browse the repository at this point in the history
Travis and profiles configuration
  • Loading branch information
guewen committed Feb 3, 2015
2 parents 21d8e41 + 43748cd commit b1a7fb1
Show file tree
Hide file tree
Showing 56 changed files with 736 additions and 278 deletions.
48 changes: 48 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
language: python

python:
- "2.7"

# specific_fct and stockit_synchro fail because they install product_multi_ean
# and point_of_sale and point_of_sale can no longer create products with
# product_multi_ean...
# Thus they are not tested until a solution is found
env:
-
- RUNTESTS=1 EXCLUDE=last_sale_price,specific_fct,stockit_synchro
- RUNTESTS=1 INCLUDE=last_sale_price

cache:
directories:
- ${HOME}/.eggs-cache

virtualenv:
system_site_packages: true

before_install:
- echo -e "Host bazaar.launchpad.net\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
- echo -e "Host bazaar.camptocamp.net\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
- mkdir ~/.bazaar
- echo -e "[DEFAULT]\nlaunchpad_username = camptocamp-business-robot\n" > ~/.bazaar/bazaar.conf
- echo -e "[Launchpad]\nhost = .launchpad.net\nuser = camptocamp-business-robot\n" > ~/.bazaar/authentication.conf
- echo -e "[c2cbazaar]\nhost = bazaar.camptocamp.net\nuser = openerp\n" >> ~/.bazaar/authentication.conf
- git config --global user.name "TravisCI"
- git config --global user.email "travis@camptocamp.com"
- pip install -q flake8 flake8-debugger flake8-print coverage
- sudo apt-get -q -y install expect-dev # provides unbuffer utility
- mkdir ${HOME}/.buildout
- echo -e "[buildout]\neggs-directory = "${HOME}"/.eggs-cache\n" > ~/.buildout/default.cfg

install:
- echo -e "[buildout]\nextends = profiles/travis.cfg\n" > ${TRAVIS_BUILD_DIR}/buildout.cfg
- ${TRAVIS_BUILD_DIR}/bootstrap.sh
- ${TRAVIS_BUILD_DIR}/bin/buildout

before_script:
- export DB_NAME=$(grep db_name ${TRAVIS_BUILD_DIR}/etc/openerp.cfg | cut -d ' ' -f 3)
- export DB_USER=$(grep db_user ${TRAVIS_BUILD_DIR}/etc/openerp.cfg | cut -d ' ' -f 3)
- export DB_PASS=$(grep db_password ${TRAVIS_BUILD_DIR}/etc/openerp.cfg | cut -d ' ' -f 3)

script:
- if [ -z "$RUNTESTS" ] ; then flake8 ${TRAVIS_BUILD_DIR}/specific-parts/specific-addons --exclude=__init__.py; fi
- if [ -n "$RUNTESTS" ] ; then ./test_server; fi
6 changes: 3 additions & 3 deletions bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function create_virtualenv() {
then
echo "reusing existing virtualenv"
else
${virtualenv} ${options} sandbox
${virtualenv} ${options} --no-site-packages sandbox
if [ -z ${options} ]
then
./sandbox/bin/pip uninstall -y setuptools
Expand All @@ -54,9 +54,9 @@ function create_virtualenv() {
}

function ensure_cfg(){
if [ ! -a buildout.cfg ]
if [ ! -e buildout.cfg ]
then
if [ -a $1 ]
if [ -e $1 ]
then
(cat <<EOF
[buildout]
Expand Down
8 changes: 3 additions & 5 deletions profiles/dev.cfg
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
[buildout]
extends = ../common.cfg
# Uncomment the following lines in the "trunk" configuration file to activate
# the development tools:
extensions += gp.vcsdevelop
parts +=
rununittests

[erp_global]
instance = trunk
instance = dev

[openerp]
options.log_level = debug
options.running_env = dev
options.xmlrpc_port = 8501
options.db_password = openerp_trunk_debonix
options.db_password = openerp_dev_debonix

openerp_command_name = oe
test_script_name = runtests
with_devtools = true
options.admin_login_password = toto
options.admin_login_password = admin

[auto_run]
start_on_boot = no
Expand Down
21 changes: 21 additions & 0 deletions profiles/travis.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[buildout]
extends = ../common.cfg

[erp_global]
instance = travis

[openerp]
options.log_level = test
options.running_env = travis
options.xmlrpc_port = 8069
options.workers = 0
options.without_demo = False

options.admin_login_password = admin

with_devtools = true
test_script_name = runtests
openerp_command_name = oe

[auto_run]
start_on_boot = no
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
{'name' : 'Balance on lines',
{'name': 'Balance on lines',
'summary': 'Display balance totals in move line view',
'version' : '1.1',
'author' : 'Camptocamp',
'maintainter' : 'Camptocamp',
'version': '1.1',
'author': 'Camptocamp',
'maintainter': 'Camptocamp',
'category': 'Accounting',
'depends' : ['account'],
'depends': ['account'],
'description': """
Balance for a line
==================
Expand All @@ -41,12 +41,11 @@
* Yannick Vaucher <yannick.vaucher@camptocamp.com>
""",
'website': 'http://www.camptocamp.com',
'data': [
'account_move_line_view.xml',
],
'data': ['account_move_line_view.xml',
],
'tests': [],
'installable': True,
'auto_install': False,
'license': 'AGPL-3',
'application': False,
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
#
##############################################################################


def migrate(cr, version):
"""
On first install, compute all stored balance with SQL for performance
"""
if not version:
cr.execute("UPDATE account_move_line SET line_balance = debit - credit"
" WHERE line_balance IS NULL")

" WHERE line_balance IS NULL")
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@
'installable': True,
'auto_install': False,
'license': 'AGPL-3',
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,3 @@ def _opposite_matchers(self, cr, uid, rec, move_line, context=None):
refs.append(lname)
refs += ["%s%s" % (s, lname) for s in prefixes]
yield ('ref', refs)

Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ def _get_all_rec_method(self, cr, uid, context=None):
_get_all_rec_method(cr, uid, context=context)
methods += [
('easy.reconcile.advanced.tid',
'Advanced. Partner and Ref with TID')
'Advanced. Partner and Ref with TID')
]
return methods
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@
],
'data': [],
'installable': True
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ def _line(self):
return line



class ChronopostFileGenerator(CarrierFileGenerator):

@classmethod
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ class stock_picking(orm.Model):
}

def write(self, cr, uid, ids, vals, context=None):
#cash on delivery must only apply on the first packing
# cash on delivery must only apply on the first packing
if 'backorder_id' in vals:
vals['cash_on_delivery_amount'] = 0.0
vals['cash_on_delivery_amount_untaxed'] = 0.0
return super(stock_picking, self).write(
cr, uid, ids, vals, context=context)
return super(stock_picking, self).write(cr, uid, ids,
vals, context=context)


class stock_picking_out(orm.Model):
Expand All @@ -72,7 +72,7 @@ class stock_picking_out(orm.Model):
}

def write(self, cr, uid, ids, vals, context=None):
#cash on delivery must only apply on the first packing
# cash on delivery must only apply on the first packing
if 'backorder_id' in vals:
vals['cash_on_delivery_amount'] = 0.0
vals['cash_on_delivery_amount_untaxed'] = 0.0
Expand Down
14 changes: 7 additions & 7 deletions specific-parts/specific-addons/import_tracking/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@
#
##############################################################################

{'name' : 'Import Tracking Numbers',
'version' : '1.0',
'author' : 'Camptocamp',
{'name': 'Import Tracking Numbers',
'version': '1.0',
'author': 'Camptocamp',
'maintainer': 'Camptocamp',
'license': 'AGPL-3',
'category': 'Generic Modules/Warehouse',
'complexity': "normal", # easy, normal, expert
'depends' : ['delivery',
'stock',
],
'depends': ['delivery',
'stock',
],
'description': """
Custom module to import tracking references on packings
""",
Expand All @@ -41,4 +41,4 @@
'tests': [],
'installable': True,
'auto_install': False,
}
}
9 changes: 6 additions & 3 deletions specific-parts/specific-addons/import_tracking/stock.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,12 @@ def import_tracking_references(self, cr, uid, ids, context=None):
context=context)
except Exception as err:
local_cr.rollback()
_logger.exception("Tracking file %s could not be imported", filepath)
message = (_("Tracking file %s could not be imported due to: %s") %
(filepath, err))
_logger.exception(
"Tracking file %s could not be imported",
filepath
)
message = (_("Tracking file %s could not be "
"imported due to: %s") % (filepath, err))
self._post_import_tracking_error_message(
cr, uid, message, context=context)
continue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
],
'description': """
THIS MODULE IS NO LONGER USED. IT IS STILL THERE SO IT COULD BE UNINSTALLED PROPERLY
THIS MODULE IS NO LONGER USED. IT IS STILL THERE SO IT COULD BE
UNINSTALLED PROPERLY
Picking Priority on Payment Method
Expand All @@ -47,4 +48,4 @@
'test': [],
'installable': True,
'auto_install': False,
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@
"version": "1.0",
"depends": ["base"],
"author": "Camptocamp",
"description": """This module provides a file store for classical configuration by environnement file pattern into OpenERP provided by server_environment.
It is ment to be used by server_environment module. Please look at this module for more info and doc.
"description": """This module provides a file store for classical
configuration by environnement file pattern into OpenERP provided by
server_environment. It is meant to be used by server_environment
module. Please look at this module for more info and doc.
""",
"website": "http://www.camptocamp.com",
"category": "Tools",
Expand Down
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[res_company.1]
sftp_invoice_host =
sftp_invoice_port =
sftp_invoice_user =
sftp_invoice_password =
sftp_invoice_path =
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[magento_backend.debonix]
location =
username =
password =

[sale_shop.Main Website Store]
allow_magento_notification = 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[outgoing_mail.smtp_debonix]
smtp_host =
smtp_port = 465
smtp_user =
smtp_pass =
smtp_encryption = none

[incoming_mail.imap_debonix]
server =
port = 993
type = imap
is_ssl = 1
attach = 0
original = 0
user =
password =
2 changes: 2 additions & 0 deletions specific-parts/specific-addons/specific_fct/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
'server_environment',
'import_tracking',
'base_partner_merge',
'product_multi_ean',
'point_of_sale',
],
'author': 'Camptocamp',
'description': """Code customisation module
Expand Down
6 changes: 4 additions & 2 deletions specific-parts/specific-addons/specific_fct/company.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@
try:
from server_environment import serv_config
except ImportError:
logging.getLogger('openerp.module').warning('server_environment not available in addons path. '
'specific_fct will not be usable')
logging.getLogger('openerp.module').warning(
'server_environment not available in addons path. '
'specific_fct will not be usable'
)

_logger = logging.getLogger(__name__)

Expand Down
1 change: 0 additions & 1 deletion specific-parts/specific-addons/specific_fct/partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,3 @@ def copy(self, cr, uid, id, default=None, context=None):

return super(ResPartner, self).copy(
cr, uid, id, default=default, context=context)

2 changes: 1 addition & 1 deletion specific-parts/specific-addons/specific_fct/product.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class product_supplierinfo(orm.Model):
_inherit = "product.supplierinfo"

def create(self, cr, uid, vals, context=None):
if not vals.get('origin_country_id',False):
if not vals.get('origin_country_id', False):
supplier_id = vals['name']
partner_obj = self.pool['res.partner']
origin_country = partner_obj.read(cr, uid,
Expand Down
15 changes: 7 additions & 8 deletions specific-parts/specific-addons/specific_fct/purchase.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ def unlink(self, cr, uid, ids, context=None):
"""
procurement_ids_to_cancel = []
for line in self.browse(cr, uid, ids, context=context):
# if line.state not in ['draft', 'cancel']:
# raise osv.except_osv(
# _('Invalid Action!'),
# _('Cannot delete a purchase order line'
# ' which is in state \'%s\'.')
# % (line.state,)
# )
# if line.state not in ['draft', 'cancel']:
# raise osv.except_osv(
# _('Invalid Action!'),
# _('Cannot delete a purchase order line'
# ' which is in state \'%s\'.')
# % (line.state,)
# )
if line.move_dest_id:
procurement_ids_to_cancel.extend(
procurement.id for procurement
Expand Down Expand Up @@ -84,4 +84,3 @@ class purchase_order_line(orm.Model):
_columns = {
'sequence': fields.integer('Sequence'),
}

Loading

0 comments on commit b1a7fb1

Please sign in to comment.