mirror of
https://github.com/OCA/rma.git
synced 2025-02-16 17:11:47 +02:00
[IMP] Split the mass return in a new module
[IMP] Split the new location added on WH in a new module for advance location management [IMP] Clean the wizards code in crm_claim_rma [IMP]move wizard in the new module and adapt the view and buttons
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
#
|
||||
##############################################################################
|
||||
{
|
||||
'name': 'Claim RMA (Product Return Management)',
|
||||
'name': 'RMA Claim (Product Return Management)',
|
||||
'version': '1.1',
|
||||
'category': 'Generic Modules/CRM & SRM',
|
||||
'description': """
|
||||
@@ -33,21 +33,26 @@ the claim lines to better handle that problematic. One Claim can have several li
|
||||
the return of differents products. It's for every of them that you'll be able to check the
|
||||
warranty (still running or not).
|
||||
|
||||
It mainly contain the following features :
|
||||
* product returns (one by one, mass return by lot, mass return by invoice)
|
||||
It mainly contain the following features:
|
||||
|
||||
* product returns (one by one, mass return by invoice)
|
||||
* warranty control & return address (based on invoice date and product form)
|
||||
* product picking in / out
|
||||
* product refund
|
||||
* access to related customer data (orders, invoices, refunds, picking in/out) from a claim
|
||||
|
||||
Using this module make the logistic flow of return this way:
|
||||
|
||||
* Returning product goes into Stock or Supplier location with a incoming shipment (depending
|
||||
on the settings of the supplier info in the product form)
|
||||
* You can make a delivery from the RMA to send a new product to the Customer
|
||||
|
||||
""",
|
||||
'author': 'Akretion, Camptocamp',
|
||||
'website': 'http://www.akretion.com',
|
||||
'website': 'http://www.akretion.com, http://www.camptocamp.com',
|
||||
'depends': ['sale','stock','crm_claim','product_warranty'],
|
||||
'data': [
|
||||
'wizard/claim_make_picking_view.xml',
|
||||
'wizard/claim_make_picking_from_picking_view.xml',
|
||||
'wizard/returned_lines_from_serial_wizard_view.xml',
|
||||
'crm_claim_rma_view.xml',
|
||||
'security/ir.model.access.csv',
|
||||
'account_invoice_view.xml',
|
||||
|
||||
@@ -54,7 +54,8 @@ class claim_line(orm.Model):
|
||||
# Comment written in a claim.line to know about the warranty status
|
||||
WARRANT_COMMENT = {
|
||||
'valid': "Valid",
|
||||
'expired': "Expired"}
|
||||
'expired': "Expired"
|
||||
'not_define': "Not Defined"}
|
||||
|
||||
# Method to calculate total amount of the line : qty*UP
|
||||
def _line_total_amount(self, cr, uid, ids, field_name, arg, context=None):
|
||||
@@ -159,29 +160,31 @@ class claim_line(orm.Model):
|
||||
'name': lambda *a: 'none',
|
||||
}
|
||||
|
||||
def write(self, cr, uid, ids, vals, context=None):
|
||||
res = super(claim_line, self).write(cr, uid, ids, vals, context=context)
|
||||
self.set_warranty(cr, uid, ids, context=context)
|
||||
return res
|
||||
|
||||
# Method to calculate warranty limit
|
||||
def set_warranty_limit(self, cr, uid, ids, claim_line, context=None):
|
||||
date_invoice = claim_line.invoice_line_id.invoice_id.date_invoice
|
||||
if date_invoice:
|
||||
warning = _(self.WARRANT_COMMENT['valid'])
|
||||
warning = _(self.WARRANT_COMMENT['not_define'])
|
||||
date_inv_at_server = datetime.strptime(date_invoice,
|
||||
DEFAULT_SERVER_DATE_FORMAT)
|
||||
supplier = claim_line.product_id.seller_ids[0]
|
||||
waranty_duration = relativedelta(months=int(supplier.warranty_duration))
|
||||
if claim_line.claim_id.claim_type == 'supplier':
|
||||
if claim_line.prodlot_id :
|
||||
# TODO: To be implemented
|
||||
limit = (date_inv_at_server +
|
||||
waranty_duration).strftime(DEFAULT_SERVER_DATE_FORMAT)
|
||||
else :
|
||||
limit = (date_inv_at_server +
|
||||
waranty_duration).strftime(DEFAULT_SERVER_DATE_FORMAT)
|
||||
else :
|
||||
waranty_duration = relativedelta(months=int(claim_line.product_id.warranty))
|
||||
limit = (date_inv_at_server +
|
||||
waranty_duration).strftime(DEFAULT_SERVER_DATE_FORMAT)
|
||||
if limit < claim_line.claim_id.date:
|
||||
warning = _(self.WARRANT_COMMENT['expired'])
|
||||
waranty_duration = int(supplier.warranty_duration)
|
||||
else:
|
||||
waranty_duration = int(claim_line.product_id.warranty)
|
||||
limit = (date_inv_at_server +
|
||||
relativedelta(month=waranty_duration).strftime(DEFAULT_SERVER_DATE_FORMAT)
|
||||
# If waranty period was defined
|
||||
if waranty_duration > 0:
|
||||
if limit < claim_line.claim_id.date:
|
||||
warning = _(self.WARRANT_COMMENT['expired'])
|
||||
else:
|
||||
warning = _(self.WARRANT_COMMENT['valid'])
|
||||
self.write(cr,uid,ids,{
|
||||
'guarantee_limit' : limit,
|
||||
'warning' : warning,
|
||||
@@ -240,7 +243,7 @@ class claim_line(orm.Model):
|
||||
'warranty_type':warranty_type})
|
||||
return True
|
||||
|
||||
# Method to calculate warranty limit and validity
|
||||
# Method to calculate warranty limit and address
|
||||
def set_warranty(self, cr, uid, ids, context=None):
|
||||
for claim_line in self.browse(cr, uid, ids, context=context):
|
||||
if claim_line.product_id and claim_line.invoice_line_id:
|
||||
|
||||
@@ -149,7 +149,7 @@
|
||||
<field name="invoice_id" on_change="onchange_invoice_id(invoice_id, context)" domain="[('partner_id','=',partner_id)]" />
|
||||
</group>
|
||||
<group>
|
||||
<button name="%(action_create_return_serial)d" string="Mass return from serial/lot n°" states="draft,open" type="action" target="new"/>
|
||||
<!-- Place for mass return button from crm_rma_lot_mass_return -->
|
||||
</group>
|
||||
<field name="claim_line_ids" nolabel="1" colspan="4"/>
|
||||
</group>
|
||||
@@ -207,13 +207,15 @@
|
||||
</field>
|
||||
<field name="name" position="replace">
|
||||
<div class="oe_title">
|
||||
<h1><field name="number" class="oe_inline"/> - <field name="name" class="oe_inline"/></h1>
|
||||
<label for="number" class="oe_edit_only"/>
|
||||
<h1><field name="number"/></h1>
|
||||
</div>
|
||||
</field>
|
||||
<field name="date" position="replace">
|
||||
</field>
|
||||
<field name="user_id" position="before">
|
||||
<field name="date" />
|
||||
<field name="name" />
|
||||
<field name="date"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -62,21 +62,6 @@ class stock_picking_out(orm.Model):
|
||||
}
|
||||
|
||||
|
||||
class stock_warehouse(orm.Model):
|
||||
|
||||
_inherit = "stock.warehouse"
|
||||
|
||||
_columns = {
|
||||
'lot_rma_id': fields.many2one('stock.location', 'Location RMA'),
|
||||
'lot_carrier_loss_id': fields.many2one('stock.location',
|
||||
'Location Carrier Loss'),
|
||||
'lot_breakage_loss_id': fields.many2one('stock.location',
|
||||
'Location Breakage Loss'),
|
||||
'lot_refurbish_id': fields.many2one('stock.location',
|
||||
'Location Refurbish'),
|
||||
}
|
||||
|
||||
|
||||
#This part concern the case of a wrong picking out. We need to create a new
|
||||
#stock_move in a picking already open.
|
||||
#In order to don't have to confirm the stock_move we override the create and
|
||||
|
||||
@@ -11,24 +11,6 @@
|
||||
<xpath expr="//field[@name='move_type']" position="after">
|
||||
<field name="claim_id" />
|
||||
</xpath>
|
||||
<!-- Those wizard aren't working yet -->
|
||||
<xpath expr="/form/header/button[@string='Return Products']" position="after">
|
||||
<button name="%(action_stock_picking_from_claim_picking)d"
|
||||
string="Product to stock" type="action"
|
||||
attrs="{'invisible':['|',
|
||||
('state','<>','done'),
|
||||
('claim_id', '=', False)]}"/>
|
||||
<button name="%(action_loss_picking_from_claim_picking)d"
|
||||
string="Product to Loss" type="action"
|
||||
attrs="{'invisible':['|',
|
||||
('state','<>','done'),
|
||||
('claim_id', '=', False)]}"/>
|
||||
<button name="%(action_used_picking_from_claim_picking)d"
|
||||
string="Product to refurbish stock" type="action"
|
||||
attrs="{'invisible':['|',
|
||||
('state','<>','done'),
|
||||
('claim_id', '=', False)]}"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -42,20 +24,6 @@
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="warehouse_form" model="ir.ui.view">
|
||||
<field name="name">crm_claim_rma.warehouse_form</field>
|
||||
<field name="model">stock.warehouse</field>
|
||||
<field name="inherit_id" ref="stock.view_warehouse" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="/form/group/group/field[@name='lot_output_id']" position="after">
|
||||
<field name="lot_rma_id"/>
|
||||
<field name="lot_carrier_loss_id"/>
|
||||
<field name="lot_breakage_loss_id"/>
|
||||
<field name="lot_refurbish_id"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_picking_in_search" model="ir.ui.view">
|
||||
<field name="name">crm_claim_rma.picking_in_search</field>
|
||||
|
||||
@@ -19,8 +19,6 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from . import returned_lines_from_serial
|
||||
from . import claim_make_picking
|
||||
from . import account_invoice_refund
|
||||
from . import claim_make_picking_from_picking
|
||||
|
||||
@@ -51,10 +51,10 @@ class claim_make_picking(orm.TransientModel):
|
||||
#TODO use custom states to show buttons of this wizard or not instead of raise an error
|
||||
if context is None: context = {}
|
||||
line_obj = self.pool.get('claim.line')
|
||||
if context.get('picking_type') in ['in', 'loss']:
|
||||
move_field = 'move_in_id'
|
||||
elif context.get('picking_type') == 'out':
|
||||
if context.get('picking_type') == 'out':
|
||||
move_field = 'move_out_id'
|
||||
else:
|
||||
move_field = 'move_in_id'
|
||||
good_lines = []
|
||||
line_ids = line_obj.search(cr, uid,
|
||||
[('claim_id', '=', context['active_id'])], context=context)
|
||||
@@ -77,8 +77,7 @@ class claim_make_picking(orm.TransientModel):
|
||||
warehouse_id,
|
||||
['lot_stock_id'],
|
||||
context=context)['lot_stock_id'][0]
|
||||
elif (context.get('picking_type') in ['in', 'loss']
|
||||
and context.get('partner_id')):
|
||||
elif context.get('partner_id'):
|
||||
loc_id = self.pool.get('res.partner').read(cr, uid,
|
||||
context['partner_id'],
|
||||
['property_stock_customer'],
|
||||
@@ -90,21 +89,18 @@ class claim_make_picking(orm.TransientModel):
|
||||
if context is None: context = {}
|
||||
warehouse_obj = self.pool.get('stock.warehouse')
|
||||
warehouse_id = context.get('warehouse_id')
|
||||
if context.get('picking_type') == 'out':
|
||||
loc_id = False
|
||||
if context.get('picking_type') == 'out' and context.get('partner_id'):
|
||||
loc_id = self.pool.get('res.partner').read(cr, uid,
|
||||
context.get('partner_id'),
|
||||
['property_stock_customer'],
|
||||
context=context)['property_stock_customer'][0]
|
||||
elif context.get('picking_type') == 'in':
|
||||
elif context.get('picking_type') == 'in' and context.get('partner_id'):
|
||||
loc_id = warehouse_obj.read(cr, uid,
|
||||
warehouse_id,
|
||||
['lot_rma_id'],
|
||||
context=context)['lot_rma_id'][0]
|
||||
elif context.get('picking_type') == 'loss':
|
||||
loc_id = warehouse_obj.read(cr, uid,
|
||||
warehouse_id,
|
||||
['lot_carrier_loss_id'],
|
||||
context=context)['lot_carrier_loss_id'][0]
|
||||
['lot_stock_id'],
|
||||
context=context)['lot_stock_id'][0]
|
||||
# Add the case of return to supplier !
|
||||
return loc_id
|
||||
|
||||
_defaults = {
|
||||
@@ -121,24 +117,20 @@ class claim_make_picking(orm.TransientModel):
|
||||
picking_obj = self.pool.get('stock.picking')
|
||||
if context is None: context = {}
|
||||
view_obj = self.pool.get('ir.ui.view')
|
||||
if context.get('picking_type') in ['in', 'loss']:
|
||||
p_type = 'in'
|
||||
view_xml_id = 'stock_picking_form'
|
||||
view_name = 'stock.picking.form'
|
||||
write_field = 'move_in_id'
|
||||
if context.get('picking_type') == 'in':
|
||||
note = 'RMA picking in'
|
||||
name = 'Customer picking in'
|
||||
elif context.get('picking_type') == 'loss':
|
||||
name = 'Customer product loss'
|
||||
note = 'RMA product loss'
|
||||
elif context.get('picking_type') == 'out':
|
||||
if context.get('picking_type') == 'out':
|
||||
p_type = 'out'
|
||||
write_field = 'move_out_id'
|
||||
note = 'RMA picking out'
|
||||
name = 'Customer picking out'
|
||||
view_xml_id = 'stock_picking_form'
|
||||
view_name = 'stock.picking.form'
|
||||
else:
|
||||
p_type = 'in'
|
||||
view_xml_id = 'stock_picking_form'
|
||||
view_name = 'stock.picking.form'
|
||||
write_field = 'move_in_id'
|
||||
if context.get('picking_type'):
|
||||
note = 'RMA picking ' + str(context.get('picking_type'))
|
||||
view_id = view_obj.search(cr, uid, [
|
||||
('xml_id', '=', view_xml_id),
|
||||
('model', '=', 'stock.picking'),
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
</record>
|
||||
|
||||
<record id="action_claim_picking_in" model="ir.actions.act_window">
|
||||
<field name="name">Create Incoming Shipments</field>
|
||||
<field name="name">Return Products</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">claim_make_picking.wizard</field>
|
||||
<field name="src_model">crm.claim</field>
|
||||
@@ -48,16 +48,5 @@
|
||||
<field name="context">{'picking_type': 'out'}</field>
|
||||
</record>
|
||||
|
||||
<record id="action_claim_picking_loss" model="ir.actions.act_window">
|
||||
<field name="name">Create Products Loss</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">claim_make_picking.wizard</field>
|
||||
<field name="src_model">crm.claim</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
<field name="context">{'picking_type': 'loss'}</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
24
crm_rma_advance_location/__init__.py
Normal file
24
crm_rma_advance_location/__init__.py
Normal file
@@ -0,0 +1,24 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Copyright 2013 Camptocamp
|
||||
# Copyright 2009-2013 Akretion,
|
||||
# Author: Emmanuel Samyn, Raphaël Valyi, Sébastien Beau, Joel Grand-Guillaume
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# 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/>.
|
||||
#
|
||||
##############################################################################
|
||||
from . import stock
|
||||
from . import wizard
|
||||
|
||||
64
crm_rma_advance_location/__openerp__.py
Normal file
64
crm_rma_advance_location/__openerp__.py
Normal file
@@ -0,0 +1,64 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Copyright 2013 Camptocamp
|
||||
# Copyright 2009-2013 Akretion,
|
||||
# Author: Emmanuel Samyn, Raphaël Valyi, Sébastien Beau, Joel Grand-Guillaume
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# 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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
{'name': 'RMA Claims by shop',
|
||||
'version': '1.0',
|
||||
'category': 'Generic Modules/CRM & SRM',
|
||||
'depends': ['crm_claim_rma'
|
||||
],
|
||||
'author': 'Akretion, Camptocamp',
|
||||
'license': 'AGPL-3',
|
||||
'website': 'http://www.akretion.com, http://www.camptocamp.com',
|
||||
'description': """
|
||||
RMA Claim Advance Location
|
||||
==========================
|
||||
|
||||
This module adds the following location on warehouses :
|
||||
|
||||
* Carrier Loss
|
||||
* RMA
|
||||
* Breakage Loss
|
||||
* Refurbish
|
||||
* Mistake Loss
|
||||
|
||||
And also various wizards on icoming deliveries that allow you to move your goods easily in those
|
||||
new locations from a done reception.
|
||||
|
||||
Using this module make the logistic flow of return a bit more complexe:
|
||||
|
||||
* Returning product goes into RMA location with a incoming shipment
|
||||
* From the incoming shipment, forward them to another places (stock, loss,...)
|
||||
|
||||
WARNING: This module is currently not yet completely debugged and is waiting his author to be.
|
||||
|
||||
""",
|
||||
'images': [],
|
||||
'demo': [],
|
||||
'data': [
|
||||
'stock_view.xml',
|
||||
'stock_data.xml',
|
||||
'wizard/claim_make_picking_from_picking_view.xml',
|
||||
'wizard/claim_make_picking_view.xml',
|
||||
],
|
||||
'installable': True,
|
||||
'application': True,
|
||||
}
|
||||
37
crm_rma_advance_location/stock.py
Normal file
37
crm_rma_advance_location/stock.py
Normal file
@@ -0,0 +1,37 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Copyright 2013 Camptocamp
|
||||
# Copyright 2009-2013 Akretion,
|
||||
# Author: Emmanuel Samyn, Raphaël Valyi, Sébastien Beau, Joel Grand-Guillaume
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# 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/>.
|
||||
#
|
||||
##############################################################################
|
||||
from openerp.osv import fields, orm, osv
|
||||
|
||||
|
||||
class stock_warehouse(orm.Model):
|
||||
|
||||
_inherit = "stock.warehouse"
|
||||
|
||||
_columns = {
|
||||
'lot_rma_id': fields.many2one('stock.location', 'Location RMA'),
|
||||
'lot_carrier_loss_id': fields.many2one('stock.location',
|
||||
'Location Carrier Loss'),
|
||||
'lot_breakage_loss_id': fields.many2one('stock.location',
|
||||
'Location Breakage Loss'),
|
||||
'lot_refurbish_id': fields.many2one('stock.location',
|
||||
'Location Refurbish'),
|
||||
}
|
||||
48
crm_rma_advance_location/stock_view.xml
Normal file
48
crm_rma_advance_location/stock_view.xml
Normal file
@@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<!-- INHERITED VIEW FOR THE OBJECT : stock_picking -->
|
||||
|
||||
<record id="picking_in_form" model="ir.ui.view">
|
||||
<field name="name">crm_claim_rma.picking_in_form</field>
|
||||
<field name="model">stock.picking.in</field>
|
||||
<field name="inherit_id" ref="stock.view_picking_in_form" />
|
||||
<field name="arch" type="xml">
|
||||
<!-- Those wizard aren't working yet -->
|
||||
<xpath expr="/form/header/button[@string='Return Products']" position="after">
|
||||
<button name="%(action_stock_picking_from_claim_picking)d"
|
||||
string="Product to stock" type="action"
|
||||
attrs="{'invisible':['|',
|
||||
('state','<>','done'),
|
||||
('claim_id', '=', False)]}"/>
|
||||
<button name="%(action_loss_picking_from_claim_picking)d"
|
||||
string="Product to Loss" type="action"
|
||||
attrs="{'invisible':['|',
|
||||
('state','<>','done'),
|
||||
('claim_id', '=', False)]}"/>
|
||||
<button name="%(action_used_picking_from_claim_picking)d"
|
||||
string="Product to refurbish stock" type="action"
|
||||
attrs="{'invisible':['|',
|
||||
('state','<>','done'),
|
||||
('claim_id', '=', False)]}"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="warehouse_form" model="ir.ui.view">
|
||||
<field name="name">crm_claim_rma.warehouse_form</field>
|
||||
<field name="model">stock.warehouse</field>
|
||||
<field name="inherit_id" ref="stock.view_warehouse" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="/form/group/group/field[@name='lot_output_id']" position="after">
|
||||
<field name="lot_rma_id"/>
|
||||
<field name="lot_carrier_loss_id"/>
|
||||
<field name="lot_breakage_loss_id"/>
|
||||
<field name="lot_refurbish_id"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
23
crm_rma_advance_location/wizard/__init__.py
Normal file
23
crm_rma_advance_location/wizard/__init__.py
Normal file
@@ -0,0 +1,23 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Copyright 2013 Camptocamp
|
||||
# Copyright 2009-2013 Akretion,
|
||||
# Author: Emmanuel Samyn, Raphaël Valyi, Sébastien Beau, Joel Grand-Guillaume
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# 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/>.
|
||||
#
|
||||
##############################################################################
|
||||
from . import claim_make_picking_from_picking
|
||||
from . import claim_make_picking
|
||||
56
crm_rma_advance_location/wizard/claim_make_picking.py
Normal file
56
crm_rma_advance_location/wizard/claim_make_picking.py
Normal file
@@ -0,0 +1,56 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
#########################################################################
|
||||
# #
|
||||
# #
|
||||
#########################################################################
|
||||
# #
|
||||
# crm_claim_rma for OpenERP #
|
||||
# Copyright (C) 2009-2012 Akretion, Emmanuel Samyn, #
|
||||
# Benoît GUILLOT <benoit.guillot@akretion.com> #
|
||||
#This program is free software: you can redistribute it and/or modify #
|
||||
#it under the terms of the GNU General Public License as published by #
|
||||
#the Free Software Foundation, either version 3 of the License, or #
|
||||
#(at your option) any later version. #
|
||||
# #
|
||||
#This program is distributed in the hope that it will be useful, #
|
||||
#but WITHOUT ANY WARRANTY; without even the implied warranty of #
|
||||
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
|
||||
#GNU General Public License for more details. #
|
||||
# #
|
||||
#You should have received a copy of the GNU General Public License #
|
||||
#along with this program. If not, see <http://www.gnu.org/licenses/>. #
|
||||
#########################################################################
|
||||
from openerp.osv import fields, orm, osv
|
||||
from openerp.tools import DEFAULT_SERVER_DATE_FORMAT, DEFAULT_SERVER_DATETIME_FORMAT
|
||||
from openerp import netsvc
|
||||
from openerp.tools.translate import _
|
||||
import time
|
||||
|
||||
|
||||
class claim_make_picking(orm.TransientModel):
|
||||
|
||||
_inherit = 'claim_make_picking.wizard'
|
||||
|
||||
# Get default destination location
|
||||
def _get_dest_loc(self, cr, uid, context):
|
||||
res = super(claim_make_picking, self)._get_dest_loc(cr, uid,
|
||||
context=context)
|
||||
if context is None: context = {}
|
||||
warehouse_obj = self.pool.get('stock.warehouse')
|
||||
warehouse_id = context.get('warehouse_id')
|
||||
if context.get('picking_type') == 'in':
|
||||
loc_id = warehouse_obj.read(cr, uid,
|
||||
warehouse_id,
|
||||
['lot_rma_id'],
|
||||
context=context)['lot_rma_id'][0]
|
||||
elif context.get('picking_type') == 'loss':
|
||||
loc_id = warehouse_obj.read(cr, uid,
|
||||
warehouse_id,
|
||||
['lot_carrier_loss_id'],
|
||||
context=context)['lot_carrier_loss_id'][0]
|
||||
return loc_id
|
||||
|
||||
_defaults = {
|
||||
'claim_line_dest_location': _get_dest_loc,
|
||||
}
|
||||
|
||||
22
crm_rma_advance_location/wizard/claim_make_picking_view.xml
Normal file
22
crm_rma_advance_location/wizard/claim_make_picking_view.xml
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
crm_claim_rma for OpenERP
|
||||
Copyright (C) 2011 Akretion Benoît GUILLOT <benoit.guillot@akretion.com>
|
||||
The licence is in the file __openerp__.py
|
||||
-->
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="action_claim_picking_loss" model="ir.actions.act_window">
|
||||
<field name="name">Create Products Loss</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">claim_make_picking.wizard</field>
|
||||
<field name="src_model">crm.claim</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
<field name="context">{'picking_type': 'loss'}</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -19,7 +19,7 @@
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
{'name': 'Claims by shop',
|
||||
{'name': 'RMA Claims by shop',
|
||||
'version': '1.0',
|
||||
'category': 'Generic Modules/CRM & SRM',
|
||||
'depends': ['crm_claim', 'sale'
|
||||
@@ -28,15 +28,16 @@
|
||||
'license': 'AGPL-3',
|
||||
'website': 'http://www.camptocamp.com',
|
||||
'description': """
|
||||
Claim by shops
|
||||
==============
|
||||
RMA Claim by shops
|
||||
==================
|
||||
|
||||
Claim improvements to use them by shops:
|
||||
|
||||
Claim improvements to use them by shops
|
||||
* Add shop on claim
|
||||
* 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
|
||||
for other cases.
|
||||
for other cases as well.
|
||||
|
||||
""",
|
||||
'images': [],
|
||||
|
||||
22
crm_rma_lot_mass_return/__init__.py
Normal file
22
crm_rma_lot_mass_return/__init__.py
Normal file
@@ -0,0 +1,22 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Copyright 2013 Camptocamp
|
||||
# Copyright 2009-2013 Akretion,
|
||||
# Author: Emmanuel Samyn, Raphaël Valyi, Sébastien Beau, Joel Grand-Guillaume
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# 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/>.
|
||||
#
|
||||
##############################################################################
|
||||
from . import wizard
|
||||
50
crm_rma_lot_mass_return/__openerp__.py
Normal file
50
crm_rma_lot_mass_return/__openerp__.py
Normal file
@@ -0,0 +1,50 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Copyright 2013 Camptocamp
|
||||
# Copyright 2009-2013 Akretion,
|
||||
# Author: Emmanuel Samyn, Raphaël Valyi, Sébastien Beau, Joel Grand-Guillaume
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# 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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
{'name': 'RMA Claims Mass Return by Lot',
|
||||
'version': '1.0',
|
||||
'category': 'Generic Modules/CRM & SRM',
|
||||
'depends': ['crm_claim_rma'
|
||||
],
|
||||
'author': 'Akretion, Camptocamp',
|
||||
'license': 'AGPL-3',
|
||||
'website': 'http://www.akretion.com, http://www.camptocamp.com',
|
||||
'description': """
|
||||
RMA Claim Mass Return by Lot
|
||||
============================
|
||||
|
||||
This module adds possibility to return a whole lot of product from a Claim
|
||||
and create a incoming shipment for them.
|
||||
|
||||
|
||||
WARNING: This module is currently not yet completely debugged and is waiting his author to be.
|
||||
|
||||
""",
|
||||
'images': [],
|
||||
'demo': [],
|
||||
'data': [
|
||||
'wizard/returned_lines_from_serial_wizard_view.xml',
|
||||
'crm_rma_view.xml',
|
||||
],
|
||||
'installable': True,
|
||||
'application': True,
|
||||
}
|
||||
16
crm_rma_lot_mass_return/crm_rma_view.xml
Normal file
16
crm_rma_lot_mass_return/crm_rma_view.xml
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record model="ir.ui.view" id="crm_claim_rma_form_view">
|
||||
<field name="name">CRM - Claim product return Form</field>
|
||||
<field name="model">crm.claim</field>
|
||||
<field name="inherit_id" ref="crm_claim_rma.crm_case_claims_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//page[@string='Product Return']/group/group[1]" position="inside">
|
||||
<button name="%(action_create_return_serial)d" string="Mass return from serial/lot n°" states="draft,open" type="action" target="new"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
22
crm_rma_lot_mass_return/wizard/__init__.py
Normal file
22
crm_rma_lot_mass_return/wizard/__init__.py
Normal file
@@ -0,0 +1,22 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Copyright 2013 Camptocamp
|
||||
# Copyright 2009-2013 Akretion,
|
||||
# Author: Emmanuel Samyn, Raphaël Valyi, Sébastien Beau, Joel Grand-Guillaume
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# 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/>.
|
||||
#
|
||||
##############################################################################
|
||||
from . import returned_lines_from_serial
|
||||
Reference in New Issue
Block a user