pep8 in crm_claim_rma

This commit is contained in:
Guewen Baconnier
2014-09-08 14:04:13 +02:00
parent f2b5bccc99
commit e094d5ada0
3 changed files with 13 additions and 8 deletions

View File

@@ -313,7 +313,7 @@ class claim_line(orm.Model):
claim_id, company_id, warehouse_id,
claim_type, claim_date, context=None):
if not claim_id and not (company_id and warehouse_id and
claim_type and claim_date):
claim_type and claim_date):
# if we have a claim_id, we get the info from there,
# otherwise we get it from the args (on creation typically)
return {}
@@ -421,7 +421,8 @@ class crm_claim(orm.Model):
def init(self, cr):
cr.execute("""
UPDATE "crm_claim" SET "number"=id::varchar WHERE ("number" is NULL)
UPDATE "crm_claim" SET "number"=id::varchar
WHERE ("number" is NULL)
OR ("number" = '/');
""")
@@ -558,7 +559,6 @@ class crm_claim(orm.Model):
invoice_lines = invoice_line_obj.browse(cr, uid, invoice_line_ids,
context=context)
def warranty_values(invoice, product):
values = {}
try:

View File

@@ -78,7 +78,8 @@ class test_lp_1282584(common.TransactionCase):
res = self.WizardMakePicking.action_create_picking(
cr, uid, [wizard_id], context=wiz_context)
self.assertEquals(res.get('res_model'), 'stock.picking.in', "Wrong model defined")
self.assertEquals(res.get('res_model'), 'stock.picking.in',
"Wrong model defined")
def test_01(self):
"""Test wizard opened view model for a new delivery
@@ -92,7 +93,9 @@ class test_lp_1282584(common.TransactionCase):
wizard_chg_qty_id = WizardChangeProductQty.create(cr, uid, {
'product_id': self.product_id,
'new_quantity': 12})
WizardChangeProductQty.change_product_qty(cr, uid, [wizard_chg_qty_id], context=wiz_context)
WizardChangeProductQty.change_product_qty(cr, uid,
[wizard_chg_qty_id],
context=wiz_context)
wiz_context = {
'active_id': self.claim_id,
@@ -105,4 +108,5 @@ class test_lp_1282584(common.TransactionCase):
res = self.WizardMakePicking.action_create_picking(
cr, uid, [wizard_id], context=wiz_context)
self.assertEquals(res.get('res_model'), 'stock.picking.out', "Wrong model defined")
self.assertEquals(res.get('res_model'), 'stock.picking.out',
"Wrong model defined")

View File

@@ -223,14 +223,15 @@ class claim_make_picking(orm.TransientModel):
},
context=context)
# Create picking lines
fmt = DEFAULT_SERVER_DATETIME_FORMAT
for wizard_claim_line in wizard.claim_line_ids:
move_obj = self.pool.get('stock.move')
move_id = move_obj.create(
cr, uid,
{'name': wizard_claim_line.product_id.name_template,
'priority': '0',
'date': time.strftime(DEFAULT_SERVER_DATETIME_FORMAT),
'date_expected': time.strftime(DEFAULT_SERVER_DATETIME_FORMAT),
'date': time.strftime(fmt),
'date_expected': time.strftime(fmt),
'product_id': wizard_claim_line.product_id.id,
'product_qty': wizard_claim_line.product_returned_quantity,
'product_uom': wizard_claim_line.product_id.uom_id.id,