Skip to content

Commit

Permalink
Merge pull request #201 from gurneyalex/7.0-fix-travis
Browse files Browse the repository at this point in the history
[FIX] don't rename parameters in product_id_change
  • Loading branch information
pedrobaeza committed Aug 28, 2015
2 parents 66e782b + 79fa66f commit 4788be3
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 22 deletions.
23 changes: 10 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
language: python
sudo: false
cache: pip

Expand All @@ -7,27 +8,23 @@ addons:
- expect-dev # provides unbuffer utility
- python-lxml # because pip installation is slow

language: python

python:
- "2.7"

env:
global:
- VERSION="7.0" TESTS="0" LINT_CHECK="0" TRANSIFEX="0"
matrix:
- LINT_CHECK=1
# exclude tests of modules which doesn't depends on sale_stock
- VERSION="7.0" ODOO_REPO="odoo/odoo" EXCLUDE="last_sale_price"
- VERSION="7.0" ODOO_REPO="odoo/odoo" INCLUDE="last_sale_price"

- VERSION="7.0" ODOO_REPO="OCA/OCB" EXCLUDE="last_sale_price"
- VERSION="7.0" ODOO_REPO="OCA/OCB" INCLUDE="last_sale_price"
- TESTS=1 ODOO_REPO="odoo/odoo" EXCLUDE="last_sale_price"
- TESTS=1 ODOO_REPO="odoo/odoo" INCLUDE="last_sale_price"
- TESTS=1 ODOO_REPO="OCA/OCB" EXCLUDE="last_sale_price"
- TESTS=1 ODOO_REPO="OCA/OCB" INCLUDE="last_sale_price"

virtualenv:
system_site_packages: true

before_install:
- git clone https://github.com/OCA/product-attribute $HOME/product-attribute -b ${VERSION}
- git clone https://github.com/OCA/purchase-workflow $HOME/purchase-workflow -b ${VERSION}
- git clone https://github.com/OCA/server-tools.git $HOME/server-tools -b ${VERSION}

install:
- git clone https://github.com/OCA/maintainer-quality-tools.git ${HOME}/maintainer-quality-tools
- export PATH=${HOME}/maintainer-quality-tools/travis:${PATH}
Expand All @@ -37,4 +34,4 @@ script:
- travis_run_tests

after_success:
coveralls
- travis_after_tests_success
3 changes: 3 additions & 0 deletions oca_dependencies.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
product-attribute
purchase-workflow
server-tools
8 changes: 4 additions & 4 deletions sale_line_description/sale.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@ class sale_order_line(orm.Model):
_inherit = "sale.order.line"

def product_id_change(
self, cr, uid, ids, pricelist, product_id, qty=0,
self, cr, uid, ids, pricelist, product, qty=0,
uom=False, qty_uos=0, uos=False, name='', partner_id=False,
lang=False, update_tax=True, date_order=False, packaging=False,
fiscal_position=False, flag=False, context=None
):
res = super(sale_order_line, self).product_id_change(
cr, uid, ids, pricelist, product_id, qty=qty, uom=uom,
cr, uid, ids, pricelist, product, qty=qty, uom=uom,
qty_uos=qty_uos, uos=uos, name='', partner_id=partner_id,
lang=lang, update_tax=update_tax, date_order=date_order,
packaging=packaging, fiscal_position=fiscal_position,
flag=flag, context=context
)
if product_id:
if product:
user = self.pool.get('res.users').browse(
cr, uid, uid, context=context)
user_groups = [g.id for g in user.groups_id]
Expand All @@ -51,7 +51,7 @@ def product_id_change(
if group_id in user_groups:
product_obj = self.pool.get('product.product')
product = product_obj.browse(
cr, uid, product_id, context=context)
cr, uid, product, context=context)
if (
product and
product.description and
Expand Down
10 changes: 5 additions & 5 deletions sale_line_quantity_properties_based/sale_order_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ class SaleOrderLine(orm.Model):
_inherit = 'sale.order.line'

def product_id_change(
self, cr, uid, ids, pricelist, product_id, qty=0,
self, cr, uid, ids, pricelist, product, qty=0,
uom=False, qty_uos=0, uos=False, name='', partner_id=False,
lang=False, update_tax=True, date_order=False, packaging=False,
fiscal_position=False, flag=False, context=None
):
res = super(SaleOrderLine, self).product_id_change(
cr, uid, ids, pricelist, product_id, qty=qty,
cr, uid, ids, pricelist, product, qty=qty,
uom=uom, qty_uos=qty_uos, uos=uos,
name=name, partner_id=partner_id,
lang=lang, update_tax=update_tax,
Expand All @@ -49,9 +49,9 @@ def product_id_change(
prop_ctx = context.copy()
if 'lang' in prop_ctx:
del prop_ctx['lang']
if product_id and property_ids and qty_uos:
if product and property_ids and qty_uos:
product = self.pool['product.product'].browse(
cr, uid, product_id, context=context)
cr, uid, product, context=context)
if product.quantity_formula_id:
prop_dict = {}
prop_pool = self.pool['mrp.property']
Expand All @@ -75,7 +75,7 @@ def product_id_change(
'uid': uid,
'properties': prop_dict,
'qty_uos': qty_uos,
'product_id': product_id,
'product_id': product.id,
}
try:
exec product.quantity_formula_id.formula_text in localdict
Expand Down

0 comments on commit 4788be3

Please sign in to comment.