mirror of
https://github.com/OCA/rma.git
synced 2025-02-16 17:11:47 +02:00
Merge pull request #5 from jgrandguillaume/7.0-fix-travis-tests
Applying little fixes and PEP8 to make travis green
This commit is contained in:
@@ -43,7 +43,7 @@ It mainly contains the following features:
|
|||||||
* product refund
|
* product refund
|
||||||
* access to related customer data (orders, invoices, refunds, picking
|
* access to related customer data (orders, invoices, refunds, picking
|
||||||
in/out) from a claim
|
in/out) from a claim
|
||||||
* use the OpenERP chatter within team like in opportunity (reply to refer to
|
* use the OpenERP chatter within team like in opportunity (reply to refer to
|
||||||
the team, not a person)
|
the team, not a person)
|
||||||
|
|
||||||
Using this module makes the logistic flow of return this way:
|
Using this module makes the logistic flow of return this way:
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ class account_invoice(orm.Model):
|
|||||||
raise orm.except_orm(
|
raise orm.except_orm(
|
||||||
_('Error !'),
|
_('Error !'),
|
||||||
_('A refund has already been created for this claim !'))
|
_('A refund has already been created for this claim !'))
|
||||||
return [(0, 0, line) for line in new_lines]
|
return [(0, 0, l) for l in new_lines]
|
||||||
|
|
||||||
def _prepare_refund(self, cr, uid, invoice, date=None, period_id=None,
|
def _prepare_refund(self, cr, uid, invoice, date=None, period_id=None,
|
||||||
description=None, journal_id=None, context=None):
|
description=None, journal_id=None, context=None):
|
||||||
|
|||||||
@@ -333,11 +333,17 @@ class claim_line(orm.Model):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
#TODO add the option to split the claim_line in order to manage the same
|
# TODO add the option to split the claim_line in order to manage the same
|
||||||
# product separately
|
# product separately
|
||||||
class crm_claim(orm.Model):
|
class crm_claim(orm.Model):
|
||||||
_inherit = 'crm.claim'
|
_inherit = 'crm.claim'
|
||||||
|
|
||||||
|
def init(self, cr):
|
||||||
|
cr.execute("""
|
||||||
|
UPDATE "crm_claim" SET "number"=id::varchar WHERE ("number" is NULL)
|
||||||
|
OR ("number" = '/');
|
||||||
|
""")
|
||||||
|
|
||||||
def _get_sequence_number(self, cr, uid, context=None):
|
def _get_sequence_number(self, cr, uid, context=None):
|
||||||
seq_obj = self.pool.get('ir.sequence')
|
seq_obj = self.pool.get('ir.sequence')
|
||||||
res = seq_obj.get(cr, uid, 'crm.claim.rma', context=context) or '/'
|
res = seq_obj.get(cr, uid, 'crm.claim.rma', context=context) or '/'
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ class claim_make_picking(orm.TransientModel):
|
|||||||
}
|
}
|
||||||
|
|
||||||
def _get_claim_lines(self, cr, uid, context):
|
def _get_claim_lines(self, cr, uid, context):
|
||||||
#TODO use custom states to show buttons of this wizard or not instead
|
# TODO use custom states to show buttons of this wizard or not instead
|
||||||
# of raise an error
|
# of raise an error
|
||||||
if context is None:
|
if context is None:
|
||||||
context = {}
|
context = {}
|
||||||
@@ -163,7 +163,6 @@ class claim_make_picking(orm.TransientModel):
|
|||||||
p_type = 'out'
|
p_type = 'out'
|
||||||
write_field = 'move_out_id'
|
write_field = 'move_out_id'
|
||||||
note = 'RMA picking out'
|
note = 'RMA picking out'
|
||||||
view_xml_id = 'stock_picking_form'
|
|
||||||
else:
|
else:
|
||||||
p_type = 'in'
|
p_type = 'in'
|
||||||
write_field = 'move_in_id'
|
write_field = 'move_in_id'
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
##############################################################################
|
##############################################################################
|
||||||
#
|
#
|
||||||
# Copyright 2013 Camptocamp
|
# Copyright 2013 Camptocamp
|
||||||
# Copyright 2009-2013 Akretion,
|
# Copyright 2009-2013 Akretion,
|
||||||
# Author: Emmanuel Samyn, Raphaël Valyi, Sébastien Beau, Joel Grand-Guillaume
|
# Author: Emmanuel Samyn, Raphaël Valyi, Sébastien Beau, Joel Grand-Guillaume
|
||||||
#
|
#
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
@@ -20,5 +20,4 @@
|
|||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
from . import stock
|
from . import stock
|
||||||
from . import wizard
|
from . import wizard
|
||||||
|
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
##############################################################################
|
##############################################################################
|
||||||
#
|
#
|
||||||
# Copyright 2013 Camptocamp
|
# Copyright 2013 Camptocamp
|
||||||
# Copyright 2009-2013 Akretion,
|
# Copyright 2009-2013 Akretion,
|
||||||
# Author: Emmanuel Samyn, Raphaël Valyi, Sébastien Beau, Joel Grand-Guillaume
|
# Author: Emmanuel Samyn, Raphaël Valyi, Sébastien Beau, Joel Grand-Guillaume
|
||||||
#
|
#
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
@@ -51,15 +51,14 @@ Using this module make the logistic flow of return a bit more complexe:
|
|||||||
WARNING: Use with caution, this module is currently not yet completely debugged and is waiting his author to be.
|
WARNING: Use with caution, this module is currently not yet completely debugged and is waiting his author to be.
|
||||||
|
|
||||||
""",
|
""",
|
||||||
'images': [],
|
'images': [],
|
||||||
'demo': [],
|
'demo': [],
|
||||||
'data': [
|
'data': ['wizard/claim_make_picking_from_picking_view.xml',
|
||||||
'wizard/claim_make_picking_from_picking_view.xml',
|
'wizard/claim_make_picking_view.xml',
|
||||||
'wizard/claim_make_picking_view.xml',
|
'stock_view.xml',
|
||||||
'stock_view.xml',
|
'stock_data.xml',
|
||||||
'stock_data.xml',
|
'claim_rma_view.xml',
|
||||||
'claim_rma_view.xml',
|
],
|
||||||
],
|
'installable': True,
|
||||||
'installable': True,
|
'application': True,
|
||||||
'application': True,
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
#along with this program. If not, see <http://www.gnu.org/licenses/>. #
|
#along with this program. If not, see <http://www.gnu.org/licenses/>. #
|
||||||
#########################################################################
|
#########################################################################
|
||||||
from openerp.osv import fields, orm
|
from openerp.osv import fields, orm
|
||||||
from openerp.tools import DEFAULT_SERVER_DATE_FORMAT, DEFAULT_SERVER_DATETIME_FORMAT
|
from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT
|
||||||
from openerp import netsvc
|
from openerp import netsvc
|
||||||
import time
|
import time
|
||||||
|
|
||||||
@@ -56,7 +56,8 @@ class claim_make_picking_from_picking(orm.TransientModel):
|
|||||||
|
|
||||||
# Get default source location
|
# Get default source location
|
||||||
def _get_source_loc(self, cr, uid, context):
|
def _get_source_loc(self, cr, uid, context):
|
||||||
if context is None: context = {}
|
if context is None:
|
||||||
|
context = {}
|
||||||
warehouse_obj = self.pool.get('stock.warehouse')
|
warehouse_obj = self.pool.get('stock.warehouse')
|
||||||
warehouse_id = self._get_default_warehouse(cr, uid, context=context)
|
warehouse_id = self._get_default_warehouse(cr, uid, context=context)
|
||||||
return warehouse_obj.read(cr, uid,
|
return warehouse_obj.read(cr, uid,
|
||||||
@@ -64,7 +65,8 @@ class claim_make_picking_from_picking(orm.TransientModel):
|
|||||||
|
|
||||||
# Get default destination location
|
# Get default destination location
|
||||||
def _get_dest_loc(self, cr, uid, context):
|
def _get_dest_loc(self, cr, uid, context):
|
||||||
if context is None: context = {}
|
if context is None:
|
||||||
|
context = {}
|
||||||
warehouse_id = self._get_default_warehouse(cr, uid, context=context)
|
warehouse_id = self._get_default_warehouse(cr, uid, context=context)
|
||||||
warehouse_obj = self.pool.get('stock.warehouse')
|
warehouse_obj = self.pool.get('stock.warehouse')
|
||||||
if context.get('picking_type'):
|
if context.get('picking_type'):
|
||||||
@@ -88,7 +90,8 @@ class claim_make_picking_from_picking(orm.TransientModel):
|
|||||||
picking_obj = self.pool.get('stock.picking')
|
picking_obj = self.pool.get('stock.picking')
|
||||||
move_obj = self.pool.get('stock.move')
|
move_obj = self.pool.get('stock.move')
|
||||||
view_obj = self.pool.get('ir.ui.view')
|
view_obj = self.pool.get('ir.ui.view')
|
||||||
if context is None: context = {}
|
if context is None:
|
||||||
|
context = {}
|
||||||
p_type = 'internal'
|
p_type = 'internal'
|
||||||
if context.get('picking_type'):
|
if context.get('picking_type'):
|
||||||
context_type = context.get('picking_type')[8:]
|
context_type = context.get('picking_type')[8:]
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ Claim improvements to use them by shops:
|
|||||||
* Add shop on claim
|
* Add shop on claim
|
||||||
* Add various filter in order to work on a basic "by shop" basis
|
* Add various filter in order to work on a basic "by shop" basis
|
||||||
|
|
||||||
Was originally designed for e-commerce purpose, but could probably do the trick
|
Was originally designed for e-commerce purpose, but could probably do the trick
|
||||||
for other cases as well.
|
for other cases as well.
|
||||||
|
|
||||||
""",
|
""",
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ Those informations are used in the RMA Claim (Product Return Management) module.
|
|||||||
'test': [],
|
'test': [],
|
||||||
'installable': True,
|
'installable': True,
|
||||||
'active': False,
|
'active': False,
|
||||||
'certificate' : '',
|
'certificate': '',
|
||||||
'images': ['images/product_warranty.png'],
|
'images': ['images/product_warranty.png'],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
##############################################################################
|
##############################################################################
|
||||||
#
|
#
|
||||||
# Copyright 2013 Camptocamp
|
# Copyright 2013 Camptocamp
|
||||||
# Copyright 2009-2013 Akretion,
|
# Copyright 2009-2013 Akretion,
|
||||||
# Author: Emmanuel Samyn, Raphaël Valyi, Sébastien Beau, Joel Grand-Guillaume
|
# Author: Emmanuel Samyn, Raphaël Valyi, Sébastien Beau, Joel Grand-Guillaume
|
||||||
#
|
#
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
|||||||
Reference in New Issue
Block a user