Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ADD][9.0]RMA (WIP) #110

Closed
wants to merge 10 commits into from
Closed

[ADD][9.0]RMA (WIP) #110

wants to merge 10 commits into from

Conversation

AaronHForgeFlow
Copy link

@AaronHForgeFlow AaronHForgeFlow commented Mar 16, 2017

RMA

You use this module to manage RMA (Return Merchandise Authorization) in Odoo

The RMA can be send from the company to the customer or from the supplier to
the company

The RMA user creates the RMA and assign a responsible by selecting the
affected invoice. The available operations are refund, repair and deliver or
replace.
The assigned person checks if the conditions for the RMA are correct and
approve the RMA

The assigned person have to go to the RMA lines from the RMA and operate. THe
available options are creating receipts, delivery orders and refunds.

Once the assigned person considers that the RMA is settled he/she can
set the RMA to Done.

Configuration

To configure this module, you need to:

  1. Go to Settings > Users and add the user to the group RMA manager
  2. Go to Inventory > Settings > Return Merchandising Authorization and select
    the option "Display 3 fields on rma: partner, invoice address, delivery
    address" if needed
  3. Go to Inventory > Settings > Configuration > Warehouse management >
    Warehouses and add a default RMA location and RMA picking type for customers
    and suppliers RMA picking type. It's very important to select the type of
    operation supplier if we are moving in the company and customer if we are
    moving out of the company.

Usage

RMA are accessible though Inventory menu. There's four menus, divided by type
. Users can access to the list of RMA or RMA lines.

Create an RMA:

  1. Select a partner. Fill the rma lines by selecting an invoice.
  2. Request approval and approve.
  3. Click on RMA Lines button.
  4. Click on more and select an option: "Receive products", "Create Delivery
    Order, Create Refund"
  5. Go back to the RMA. Set the RMA to done if not further action is required

Issues

You can also comment about this module in this issue: #111

OBS: Additional modules will allow to create RMA from SO or PO

@AaronHForgeFlow AaronHForgeFlow mentioned this pull request Mar 16, 2017
@AaronHForgeFlow AaronHForgeFlow changed the title [ADD][9.0]RMA [ADD][9.0]RMA (WIP) Mar 16, 2017
@rubencabrera
Copy link

@nhomar
Copy link
Member

nhomar commented Mar 19, 2017

Dude I am really sorry.

But this is a copy of our work in Vauxoo/rma (may be with little changes).

I have several questions:

  1. Why remove our authorship?
  2. Why propose a PR to OCA/RMA first instead explain the changes into vauxoo/rma?.

We had invested on this work a HUGE amount of work and we are opensourcing everything, but IMHO this is not the way to propose a PR or a Refactor...

AFAICR we are all in the same team did not we?

cc @jbeficent

@JordiBForgeFlow
Copy link
Sponsor Member

@nhomar Obviously we have to respect the authorship. We'll add that ASAP!

We have been struggling with the current proposed approach in v8, and wanted to brainstorm with new ideas. We researched what has been done by your team, also we looked into Oracle, SAP, and Odoo v9 and v10, to try to identify new ideas to improve the process.

We did not see https://github.com/Vauxoo/rma/pull/167. And we are going to review it now.

We are happy to redirect the PR to Vauxoo/RMA and to work together on this!

@yaniaular I understand that you are under active development. We would be happy to discuss together.

@AaronHForgeFlow
Copy link
Author

@nhomar Of course we will respect the authorship, that was not intended, apologizes for the misunderstanding.
I agree to move the PR to Vauxoo/RMA and keep up with the work together.
We will review your work at https://github.com/Vauxoo/rma/pull/167

@pedrobaeza
Copy link
Member

You should move it to OCA, not to Vauxoo fork I think.

@jgrandguillaume
Copy link
Member

Hi,

First of all thank you for refactoring this module, it is an very old one that we took back from a version 5.0 and never had the budget to clean it up ! I support this move, and like very much the new way of handling the supplier and customer RMA.

I've tested it and it works well overall. I have a few remarks:

  • In the previews versions, I was able to create a refund from a line, that I didn't succeeded. It was very useful and once agreed with management, the person in charge was able to create a refund for a customer automatically, avoiding mistakes (e.g. wrong price or qty). That was very much appreciated.

  • In my opinion, one of the most important feature in the previous module was to be able to let the system create the appropriate picking according to the infos set on the inventory tab of the product (supplier.info). There you were able to tel the system wether a product should go back to you, the supplier or another adresse (entity, e.g. for Smartphone, you don't return to the seller, not the manufacturer, but the entity in charge of the repair).
    Previous behavior:

  1. If set to company, the picking created was returning in the RMA location with address=company address
  2. If set to supplier, the picking created was returning in the supplier location with address=supplier address
  3. If set to other, the picking created was returning in the supplier location with address=specified address address

That was helpful, in our case, we used this to record the picking in the system, so our customer can then print the shipping label properly, send it back to the customer in order for him to ship back to the proper place (without costs in our case). Now I didn't figured out how to do this anymore.

  • In the previous version (again ;) ), the system computed also for each line if the warranty was still going on or not (well, it was based on the current value of the supplier infos, not historical, but well..better than nothing). That is IMO important to keep. We want to know before deciding what to do, if the warranty is still valid or not.

Apart from those points, I'm happy to support this refactoring !

Thanks again for the work,

👍

Joël

@rubencabrera
Copy link

rubencabrera commented Apr 26, 2017

I have a few points to review:

  1. When creating an invoice from add_invoice_id on a Customer RMA, the invoice form loaded has the supplier label on partner, tried to use a context with {'default_type': 'out_invoice'} to fix it but can't make it work this way.

  2. On the RMA lines, operation_id is readonly and required, son no manual lines can be added, just the ones generated adding an invoice. What if we don't have the invoice in odoo because we are migrating from another ERP?

  3. When loading demo data, my warehouse and locations get overriden with the RMA ones in demo data. Is this intended? EDIT: this only happend on the backport I'm doing to 8.0, sorry for the inconvenience, I guess it's not that important anyway, the README explains quite well how to set RMA locations.

@AaronHForgeFlow
Copy link
Author

Hello @rubencabrera,
Thanks for your feedback. Regarding your comments:

  1. You're correct, I'll figure it out how to fix this
  2. I'll remove those restrictions in order to allow to create manual lines.
  3. The demo data is intended to no be updated (noupdate=1), I'll review this.

rubencabrera pushed a commit to rubencabrera/rma that referenced this pull request Apr 27, 2017
Merge changes after pulling from 9.0 PR OCA#110
Copy link

@rubencabrera rubencabrera left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Undefined variables in _default_dest/src_location_id methods

def _default_src_location_id(self):
if self.type == 'customer':
if self.rma_id.partner_id.property_stock_customer:
return lines.rma_id.partner_id.property_stock_customer.id

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't lines an undefined variable here and in line 440?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this method is not used indeed. I'll remove it. Thank you! @rubencabrera

@api.onchange('product_id')
def _onchange_product_id(self):
if not self.invoice_id:
return
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @aheficent , is this by design? If RMA unrelated to invoice then onchange will not fill name field. Meanwhile field name is readonly thus data can not be saved.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @andhit-r Creating manual RMA lines was not possible at that time, but this design is going to be modified

from openerp.exceptions import UserError
from dateutil.relativedelta import relativedelta
from openerp.tools import DEFAULT_SERVER_DATE_FORMAT
import math
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unused import

from openerp.tools import DEFAULT_SERVER_DATE_FORMAT
import math
from datetime import datetime
import calendar
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unused import

default=lambda self: self.env.user)
company_id = fields.Many2one('res.company', string='Company',
default=lambda self: self.env.user.company_id)
rma_line_ids = fields.One2many('rma.order.line', 'rma_id',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should make it readonly unless it's draft

if self.env.context.get('supplier'):
vals['name'] = self.env['ir.sequence'].get('rma.order.supplier')
else:
vals['name'] = self.env['ir.sequence'].get('rma.order')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, the best way to assign sequence are according these flow:

  1. Give a default value for name (e.g. /)
  2. Remove readonly from field name, so user can override the sequence when they see fit
  3. If no change needed (field name value == /) then assign sequence when data created

Just an opinion, no need to change if you don't see fit.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your advice. It could be a good option.

self.move_count = len(list(set(move_list)))

@api.model
def _default_dest_location_id(self):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method also unused

rma_id = fields.Many2one('rma.order', string='RMA',
ondelete='cascade')
uom_id = fields.Many2one('product.uom', string='Unit of Measure')
product_id = fields.Many2one('product.product', string='Product',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Readonly unless its draft

@AaronHForgeFlow
Copy link
Author

Thank you for you review @andhit-r I hope to include some improvements soon

@berpweb
Copy link

berpweb commented Jul 7, 2017

Guys any idea of pushing this PR forward?
@aheficent you still working on the improvements?

@drl9319
Copy link

drl9319 commented Jul 7, 2017

Hi guys. Now I working in migrate this code to V 8.0, fix some errors and add new funcionality.

I add module: rma_serial_number, this module allow select product and serial number, with this data the code can search the related invoice, (for example a big company have more mobile phone and a few moths since the company purchase this mobile have and problem with a unique serial number, but how this company have more invoices and pruchase order can't search the related invoice, for thah is this new funcionality).

The second funcionality is when the company have and rma from a invoice haven't in the system becouse it is from the old system. For thah we have create a new object rma_external_invoice_line with the invoice number, date, client/supplier and serial number.

can be this changes in this url: https://github.com/praxya/rma/tree/8.0-rma-serial-number

regards

@AaronHForgeFlow
Copy link
Author

Hi @berpweb We are still working on this. Regards.

@gurneyalex
Copy link
Member

Can you rebase the PR to solve the conflict?

@JordiBForgeFlow
Copy link
Sponsor Member

JordiBForgeFlow commented Jul 17, 2017

@gurneyalex this is our current working branch https://github.com/Eficent/rma/tree/9.0-rma-v2

As we have deviated significantly from 8.0 we may not finally propose to OCA/rma to respect the current desig, used already by others.

@JordiBForgeFlow
Copy link
Sponsor Member

We have decided to continue our diverging approach in https://github.com/Eficent/stock-rma

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet