diff --git a/addons/rma/__manifest__.py b/addons/rma/__manifest__.py index 058d24c2..40f59351 100644 --- a/addons/rma/__manifest__.py +++ b/addons/rma/__manifest__.py @@ -7,7 +7,7 @@ 'website': 'https://flectrahq.com', 'description': """ Return Merchandise Authorizationing is part of the process of a - consumer returning a product to receive a refund, replacement or repair + consumer returning a product to receive a refund or or replacement during the product's warranty period. """, 'category': 'Sales', @@ -16,10 +16,10 @@ 'security/ir.model.access.csv', 'data/mail_message_subtype_data.xml', 'data/mail_template_data.xml', - 'data/replacement_reason_data.xml', + 'data/return_reason_data.xml', 'sequences/data_rma_order_sequence.xml', 'views/rma_request_view.xml', - 'views/replacement_reason_view.xml', + 'views/return_reason_view.xml', 'views/rma_line_view.xml', 'views/stock_production_lot_view.xml', 'views/stock_picking_view.xml', diff --git a/addons/rma/data/mail_message_subtype_data.xml b/addons/rma/data/mail_message_subtype_data.xml index f93b5fcc..0aa9ad64 100644 --- a/addons/rma/data/mail_message_subtype_data.xml +++ b/addons/rma/data/mail_message_subtype_data.xml @@ -6,7 +6,7 @@ rma.request - Replacement Request is Created + RMA Request is Created Request Created @@ -22,7 +22,7 @@ rma.request - Replacement Request has been + RMA Request has been Confirmed @@ -34,19 +34,35 @@ team_id - + + Return created + + rma.request + + Products have been returned + + + Return created + 12 + rma.request + + + team_id + + + Replacement created rma.request Products have been replaced - + Replacement created 12 rma.request - + team_id \ No newline at end of file diff --git a/addons/rma/data/mail_template_data.xml b/addons/rma/data/mail_template_data.xml index 27f8bd20..37f178a5 100644 --- a/addons/rma/data/mail_template_data.xml +++ b/addons/rma/data/mail_template_data.xml @@ -1,7 +1,7 @@ - + Warranty: Product Warranty email ${(object.user_id.email and '%s <%s>' % (object.user_id.name, object.user_id.email) or '')|safe} @@ -12,50 +12,86 @@ ${object.partner_id.lang} -

Dear ${object.partner_id.name}

-

We are sorry to hear about the problem you have had - with your product. -

-

We would like to be able to make the necessary - adjustment at no charge to you, - but unfortunately the warranty is expired of - following products: -

- + % if object.is_website: + %if object.is_replacement: +
+

Dear ${object.partner_id.name}

+

We do hereby confirm the reception of your + request regarding replacement of products + ${object.rma_line.product_id.name}, Please accept our apologies + for this incident.

+

As per your request, a new shipment for + ${object.rma_line.product_id.name} will be created + soon and we will replace product.

+

We are sorry that this occurred and appreciate + your continued patronage, As a thanks for + being one of our best client. + Should you have any questions, + please do not hesitate to contact us. +

+

Thank You

+
+ %else: +
+

Dear ${object.partner_id.name}

+

We do hereby confirm the reception of your + request regarding return of products + ${object.rma_line.product_id.name}, Please accept our apologies + for this incident.

+

We are sorry that this occurred and appreciate + your continued patronage, As a thanks for + being one of our best client. + Should you have any questions, + please do not hesitate to contact us. +

+

Thank You

+
+ %endif - - - - - - - - - - - % for line in object.warranty_expire_line: - - - - - - - % endfor - -
ProductLotQuantityWarranty Date
${line.product_id.name}${line.lot_id.name}${line.qty_expired}${line.warranty_date}
% else: -
-

Dear ${object.partner_id.name}

-

We are sorry to hear about the problem you have had - with your product.

-

We would like to be able to make the necessary - adjustment at no charge to you, We are going to - replace your product. We will deliver it to - you as possible. -

-
+ % if object.warranty_expire_line: +
+

Dear ${object.partner_id.name}

+

We are sorry to hear about the problem you have had + with your product. +

+

We would like to be able to make the necessary + adjustment at no charge to you, + but unfortunately the warranty is expired of + following products: +

+
+ + + + + + + + + + + + % for line in object.warranty_expire_line: + + + + + + + % endfor + +
ProductLotQuantityWarranty Date
${line.product_id.name}${line.lot_id.name}${line.qty_expired}${line.warranty_date}
+ % else: +
+

Dear ${object.partner_id.name}

+

We are sorry to hear about the problem you have had + with your product.

+

We would like to be able to make the necessary + adjustment at no charge to you. +

+
+ % endif % endif ]]>
diff --git a/addons/rma/data/replacement_reason_data.xml b/addons/rma/data/return_reason_data.xml similarity index 55% rename from addons/rma/data/replacement_reason_data.xml rename to addons/rma/data/return_reason_data.xml index c1493eb0..6bb4c857 100644 --- a/addons/rma/data/replacement_reason_data.xml +++ b/addons/rma/data/return_reason_data.xml @@ -1,50 +1,50 @@ - + Better price available - + Incompatible or not useful - + Product damaged, but shipping box OK - + Item arrived too late - + Missing parts or accessories - + Both product and shipping box damaged - + Wrong item was sent - + No longer needed - + Item defective or doesn't work - + Didn't approve purchase - + Performace or quality not adequate - + Inaccurate website description diff --git a/addons/rma/demo/product_demo.xml b/addons/rma/demo/product_demo.xml index 396eb64b..a2b37516 100644 --- a/addons/rma/demo/product_demo.xml +++ b/addons/rma/demo/product_demo.xml @@ -27,4 +27,16 @@ DEMO-PROD2 lot
+ + Demo Product3 + + 150.0 + 300.0 + product + + + Demo product3 + + DEMO-PROD3 +
diff --git a/addons/rma/i18n/rma.pot b/addons/rma/i18n/rma.pot index abc0550c..5810ca1b 100644 --- a/addons/rma/i18n/rma.pot +++ b/addons/rma/i18n/rma.pot @@ -4,10 +4,10 @@ # msgid "" msgstr "" -"Project-Id-Version: Flectra Server 1.0alpha\n" +"Project-Id-Version: Flectra Server 1.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-12-25 11:22+0000\n" -"PO-Revision-Date: 2017-12-25 11:22+0000\n" +"POT-Creation-Date: 2018-03-14 06:04+0000\n" +"PO-Revision-Date: 2018-03-14 06:04+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -16,63 +16,100 @@ msgstr "" "Plural-Forms: \n" #. module: rma -#: model:mail.template,body_html:rma.email_template_notify_warranty_new +#: model:mail.template,body_html:rma.email_template_notify_warranty_date msgid "\n" -" % if object.warranty_expire_line:\n" -"
\n" -"

Dear ${object.partner_id.name}

\n" -"

We are sorry to hear about the problem you have had\n" -" with your product.\n" -" We would like to be able to make the necessary\n" -" adjustment at no charge to you,\n" -" but unfortunately the warranty is expired of\n" -" following products:\n" -"

\n" -"
\n" +" % if object.is_website:\n" +" %if object.is_replacement:\n" +"
\n" +"

Dear ${object.partner_id.name}

\n" +"

We do hereby confirm the reception of your\n" +" request regarding replacement of products\n" +" ${object.rma_line.product_id.name}, Please accept our apologies\n" +" for this incident.

\n" +"

As per your request, a new shipment for\n" +" ${object.rma_line.product_id.name} will be created\n" +" soon and we will replace product.

\n" +"

We are sorry that this occurred and appreciate\n" +" your continued patronage, As a thanks for\n" +" being one of our best client.\n" +" Should you have any questions,\n" +" please do not hesitate to contact us.\n" +"

\n" +"

Thank You

\n" +"
\n" +" %else:\n" +"
\n" +"

Dear ${object.partner_id.name}

\n" +"

We do hereby confirm the reception of your\n" +" request regarding return of products\n" +" ${object.rma_line.product_id.name}, Please accept our apologies\n" +" for this incident.

\n" +"

We are sorry that this occurred and appreciate\n" +" your continued patronage, As a thanks for\n" +" being one of our best client.\n" +" Should you have any questions,\n" +" please do not hesitate to contact us.\n" +"

\n" +"

Thank You

\n" +"
\n" +" %endif\n" "\n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" % for line in object.warranty_expire_line:\n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" % endfor\n" -" \n" -"
ProductLotQuantityWarranty Date
${line.product_id.name}${line.lot_id.name}${line.qty_expired}${line.warranty_date}
\n" -" % else:\n" -"
\n" -"

Dear ${object.partner_id.name}

\n" -"

We are sorry to hear about the problem you have had\n" -" with your product.\n" -" We would like to be able to make the necessary\n" -" adjustment at no charge to you, We are going to\n" -" replace your product. We will deliver it to\n" -" you as possible.\n" -"

\n" -"
\n" -" % endif\n" +" % else:\n" +" % if object.warranty_expire_line:\n" +"
\n" +"

Dear ${object.partner_id.name}

\n" +"

We are sorry to hear about the problem you have had\n" +" with your product.\n" +"

\n" +"

We would like to be able to make the necessary\n" +" adjustment at no charge to you,\n" +" but unfortunately the warranty is expired of\n" +" following products:\n" +"

\n" +"
\n" +"\n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" % for line in object.warranty_expire_line:\n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" % endfor\n" +" \n" +"
ProductLotQuantityWarranty Date
${line.product_id.name}${line.lot_id.name}${line.qty_expired}${line.warranty_date}
\n" +" % else:\n" +"
\n" +"

Dear ${object.partner_id.name}

\n" +"

We are sorry to hear about the problem you have had\n" +" with your product.

\n" +"

We would like to be able to make the necessary\n" +" adjustment at no charge to you.\n" +"

\n" +"
\n" +" % endif\n" +" % endif\n" "\n" " " msgstr "" #. module: rma -#: model:mail.template,subject:rma.email_template_notify_warranty_new +#: model:mail.template,subject:rma.email_template_notify_warranty_date msgid "${object.name or 'n/a'}" msgstr "" #. module: rma -#: code:addons/rma/models/rma_request.py:147 +#: code:addons/rma/models/rma_request.py:150 #, python-format msgid "Compose Email" msgstr "" @@ -89,11 +126,11 @@ msgstr "" #. module: rma #: model:ir.ui.view,arch_db:rma.view_rma_request_form -msgid "Create Replacement" +msgid "Create RMA" msgstr "" #. module: rma -#: model:ir.model.fields,field_description:rma.field_replacement_reason_create_uid +#: model:ir.model.fields,field_description:rma.field_return_reason_create_uid #: model:ir.model.fields,field_description:rma.field_rma_line_create_uid #: model:ir.model.fields,field_description:rma.field_rma_request_create_uid #: model:ir.model.fields,field_description:rma.field_warranty_expire_line_create_uid @@ -101,7 +138,7 @@ msgid "Created by" msgstr "" #. module: rma -#: model:ir.model.fields,field_description:rma.field_replacement_reason_create_date +#: model:ir.model.fields,field_description:rma.field_return_reason_create_date #: model:ir.model.fields,field_description:rma.field_rma_line_create_date #: model:ir.model.fields,field_description:rma.field_rma_request_create_date #: model:ir.model.fields,field_description:rma.field_warranty_expire_line_create_date @@ -139,6 +176,12 @@ msgstr "" msgid "Demo Product2" msgstr "" +#. module: rma +#: model:product.product,name:rma.demo_product_3 +#: model:product.template,name:rma.demo_product_3_product_template +msgid "Demo Product3" +msgstr "" + #. module: rma #: model:product.product,description:rma.demo_product_1 #: model:product.template,description:rma.demo_product_1_product_template @@ -154,7 +197,14 @@ msgid "Demo product2\n" msgstr "" #. module: rma -#: model:ir.model.fields,field_description:rma.field_replacement_reason_display_name +#: model:product.product,description:rma.demo_product_3 +#: model:product.template,description:rma.demo_product_3_product_template +msgid "Demo product3\n" +" " +msgstr "" + +#. module: rma +#: model:ir.model.fields,field_description:rma.field_return_reason_display_name #: model:ir.model.fields,field_description:rma.field_rma_line_display_name #: model:ir.model.fields,field_description:rma.field_rma_request_display_name #: model:ir.model.fields,field_description:rma.field_warranty_expire_line_display_name @@ -177,7 +227,7 @@ msgid "Group By" msgstr "" #. module: rma -#: model:ir.model.fields,field_description:rma.field_replacement_reason_id +#: model:ir.model.fields,field_description:rma.field_return_reason_id #: model:ir.model.fields,field_description:rma.field_rma_line_id #: model:ir.model.fields,field_description:rma.field_rma_request_id #: model:ir.model.fields,field_description:rma.field_warranty_expire_line_id @@ -185,7 +235,13 @@ msgid "ID" msgstr "" #. module: rma -#: model:ir.model.fields,field_description:rma.field_replacement_reason___last_update +#: code:addons/rma/wizard/stock_return_picking.py:16 +#, python-format +msgid "It is not replacement request!" +msgstr "" + +#. module: rma +#: model:ir.model.fields,field_description:rma.field_return_reason___last_update #: model:ir.model.fields,field_description:rma.field_rma_line___last_update #: model:ir.model.fields,field_description:rma.field_rma_request___last_update #: model:ir.model.fields,field_description:rma.field_warranty_expire_line___last_update @@ -193,7 +249,7 @@ msgid "Last Modified on" msgstr "" #. module: rma -#: model:ir.model.fields,field_description:rma.field_replacement_reason_write_uid +#: model:ir.model.fields,field_description:rma.field_return_reason_write_uid #: model:ir.model.fields,field_description:rma.field_rma_line_write_uid #: model:ir.model.fields,field_description:rma.field_rma_request_write_uid #: model:ir.model.fields,field_description:rma.field_warranty_expire_line_write_uid @@ -201,7 +257,7 @@ msgid "Last Updated by" msgstr "" #. module: rma -#: model:ir.model.fields,field_description:rma.field_replacement_reason_write_date +#: model:ir.model.fields,field_description:rma.field_return_reason_write_date #: model:ir.model.fields,field_description:rma.field_rma_line_write_date #: model:ir.model.fields,field_description:rma.field_rma_request_write_date #: model:ir.model.fields,field_description:rma.field_warranty_expire_line_write_date @@ -224,19 +280,19 @@ msgid "My Requests" msgstr "" #. module: rma -#: code:addons/rma/wizard/stock_return_picking.py:62 +#: model:ir.actions.act_window,help:rma.return_request_action_reports +msgid "No Return request." +msgstr "" + +#. module: rma +#: code:addons/rma/wizard/stock_return_picking.py:68 #, python-format -msgid "No products to replace (only lines in Done state andnot fully replaced yet can be replaced)!" +msgid "No products to return (only lines in Done state andnot fully returned yet can be returned)!" msgstr "" #. module: rma -#: model:ir.actions.act_window,help:rma.replacement_request_action_reports -msgid "No replacement request." -msgstr "" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_crm_team_replacements_count -msgid "Number of replacements" +#: model:ir.model.fields,field_description:rma.field_crm_team_returns_count +msgid "Number of returns" msgstr "" #. module: rma @@ -256,10 +312,26 @@ msgid "Product" msgstr "" #. module: rma -#: model:mail.message.subtype,description:rma.mt_request_replaced +#: model:mail.message.subtype,description:rma.mt_replacement_create msgid "Products have been replaced" msgstr "" +#. module: rma +#: model:mail.message.subtype,description:rma.mt_request_return +msgid "Products have been returned" +msgstr "" + +#. module: rma +#: model:ir.ui.menu,name:rma.rma_request_menu +msgid "RMA" +msgstr "" + +#. module: rma +#: model:ir.ui.view,arch_db:rma.view_rma_request_filter +#: selection:rma.request,state:0 +msgid "RMA Created" +msgstr "" + #. module: rma #: model:ir.model,name:rma.model_rma_line msgid "RMA Line" @@ -281,30 +353,46 @@ msgstr "" #. module: rma #: model:ir.actions.act_window,name:rma.act_open_rma_request_view -#: model:ir.actions.act_window,name:rma.action_open_rma_request_replacementteam +#: model:ir.actions.act_window,name:rma.action_open_rma_request_rmateam +#: model:ir.model,name:rma.model_rma_request +#: model:ir.ui.menu,name:rma.menu_request_rma +#: model:ir.ui.view,arch_db:rma.crm_team_rma_teams_view_kanban +#: model:ir.ui.view,arch_db:rma.rma_view_kanban #: model:ir.ui.view,arch_db:rma.view_rma_request_filter msgid "RMA Request" msgstr "" #. module: rma #: model:ir.model.fields,field_description:rma.field_rma_line_rma_id +#: model:ir.model.fields,field_description:rma.field_warranty_expire_line_rma_id msgid "RMA Request Number" msgstr "" #. module: rma -#: model:ir.model,name:rma.model_rma_request -msgid "RMA Reuqest" +#: model:mail.message.subtype,description:rma.mt_request_confirm +msgid "RMA Request has been\n" +" Confirmed" msgstr "" #. module: rma -#: model:ir.model.fields,field_description:rma.field_warranty_expire_line_rma_id -msgid "RMA Reuqest Number" +#: model:mail.message.subtype,description:rma.mt_request_create +msgid "RMA Request is Created" msgstr "" #. module: rma -#: model:ir.model.fields,field_description:rma.field_replacement_reason_name +#: model:ir.ui.view,arch_db:rma.view_rma_request_filter +msgid "RMA Request type" +msgstr "" + +#. module: rma +#: model:ir.ui.view,arch_db:rma.crm_team_rma_teams_view_kanban +msgid "RMA Requests" +msgstr "" + +#. module: rma +#: model:ir.model.fields,field_description:rma.field_return_reason_name #: model:ir.model.fields,field_description:rma.field_rma_line_reason_id -#: model:ir.ui.view,arch_db:rma.view_replacement_reason_form +#: model:ir.ui.view,arch_db:rma.view_return_reason_form msgid "Reason" msgstr "" @@ -314,73 +402,30 @@ msgid "Remark" msgstr "" #. module: rma -#: model:ir.ui.menu,name:rma.menu_request_rma -msgid "Replace Request" -msgstr "" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_crm_team_use_replacement -#: model:ir.ui.menu,name:rma.rma_request_menu -#: model:ir.ui.view,arch_db:rma.crm_team_replacement_teams_view_kanban -#: model:ir.ui.view,arch_db:rma.replacement_view_kanban -#: selection:rma.request,type:0 -msgid "Replacement" -msgstr "" - -#. module: rma -#: model:ir.ui.view,arch_db:rma.view_rma_request_filter #: selection:rma.request,state:0 msgid "Replacement Created" msgstr "" #. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_line_qty_replaced -msgid "Replacement Quantity" -msgstr "" - -#. module: rma -#: model:ir.actions.act_window,name:rma.act_open_replacement_reason_view -#: model:ir.model,name:rma.model_replacement_reason -#: model:ir.ui.menu,name:rma.menu_replacement_reason -msgid "Replacement Reason" -msgstr "" - -#. module: rma -#: model:ir.ui.view,arch_db:rma.view_rma_line_graph +#: model:ir.actions.act_window,name:rma.action_open_replacement_request_rmateam msgid "Replacement Request" msgstr "" #. module: rma -#: model:mail.message.subtype,description:rma.mt_request_confirm -msgid "Replacement Request has been\n" -" Confirmed" -msgstr "" - -#. module: rma -#: model:mail.message.subtype,description:rma.mt_request_create -msgid "Replacement Request is Created" -msgstr "" - -#. module: rma -#: model:ir.actions.act_window,name:rma.replacement_request_action_reports -msgid "Replacement Requests" -msgstr "" - -#. module: rma -#: model:mail.message.subtype,name:rma.mt_request_replaced -#: model:mail.message.subtype,name:rma.mt_salesteam_request_replaced +#: model:mail.message.subtype,name:rma.mt_replacement_create +#: model:mail.message.subtype,name:rma.mt_salesteam_request_replacement msgid "Replacement created" msgstr "" #. module: rma -#: model:ir.ui.view,arch_db:rma.crm_team_replacement_teams_view_kanban -msgid "Replacements" +#: model:ir.model.fields,field_description:rma.field_rma_request_is_replacement +msgid "Replacement?" msgstr "" #. module: rma -#: code:addons/rma/models/rma_line.py:35 -#, python-format -msgid "Replacemet quantity of %s should not be greater than ordered quantity." +#: model:ir.ui.view,arch_db:rma.crm_team_rma_teams_view_kanban +#: model:ir.ui.view,arch_db:rma.view_rma_request_filter +msgid "Replacements" msgstr "" #. module: rma @@ -420,11 +465,76 @@ msgstr "" msgid "Requests for RMA" msgstr "" +#. module: rma +#: model:ir.model.fields,field_description:rma.field_crm_team_use_return +msgid "Return" +msgstr "" + #. module: rma #: model:ir.model,name:rma.model_stock_return_picking msgid "Return Picking" msgstr "" +#. module: rma +#: model:ir.model.fields,field_description:rma.field_rma_line_qty_return +msgid "Return Quantity" +msgstr "" + +#. module: rma +#: model:ir.actions.act_window,name:rma.act_open_return_reason_view +#: model:ir.model,name:rma.model_return_reason +msgid "Return Reason" +msgstr "" + +#. module: rma +#: model:ir.ui.menu,name:rma.menu_return_reason +msgid "Return Reasons" +msgstr "" + +#. module: rma +#: model:ir.ui.view,arch_db:rma.view_rma_line_graph +msgid "Return Request" +msgstr "" + +#. module: rma +#: model:ir.actions.act_window,name:rma.return_request_action_reports +msgid "Return Requests" +msgstr "" + +#. module: rma +#: model:mail.message.subtype,name:rma.mt_request_return +#: model:mail.message.subtype,name:rma.mt_salesteam_request_return +msgid "Return created" +msgstr "" + +#. module: rma +#: code:addons/rma/models/rma_line.py:35 +#, python-format +msgid "Return quantity of %s should not be greater than ordered quantity." +msgstr "" + +#. module: rma +#: code:addons/rma/models/rma_line.py:40 +#, python-format +msgid "Return quantity should not be 0." +msgstr "" + +#. module: rma +#: selection:rma.request,type:0 +msgid "Return/Replace" +msgstr "" + +#. module: rma +#: model:ir.ui.view,arch_db:rma.view_rma_request_filter +msgid "Return/Replacement" +msgstr "" + +#. module: rma +#: model:ir.ui.view,arch_db:rma.crm_team_rma_teams_view_kanban +#: model:ir.ui.view,arch_db:rma.view_rma_request_filter +msgid "Returns" +msgstr "" + #. module: rma #: model:ir.model.fields,field_description:rma.field_rma_request_sale_order_id msgid "SO Number" @@ -507,31 +617,36 @@ msgid "Warranty Expiry Date" msgstr "" #. module: rma -#: code:addons/rma/models/rma_line.py:30 -#, python-format -msgid "You can only replace %s quantity for product %s as its warranty has been expired." +#: model:ir.model.fields,field_description:rma.field_rma_request_is_website +msgid "Website" msgstr "" #. module: rma -#: code:addons/rma/models/rma_request.py:183 +#: code:addons/rma/models/rma_line.py:30 +#, python-format +msgid "You can only return %s quantity for product %s as its warranty has been expired." +msgstr "" + +#. module: rma +#: code:addons/rma/models/rma_request.py:187 #, python-format msgid "You cannot delete a request which is not in draft state." msgstr "" #. module: rma -#: code:addons/rma/wizard/stock_return_picking.py:16 -#, python-format -msgid "You may only replace single picking at a time!" -msgstr "" - -#. module: rma -#: code:addons/rma/wizard/stock_return_picking.py:26 +#: code:addons/rma/wizard/stock_return_picking.py:32 #, python-format msgid "You may only return Done pickings" msgstr "" #. module: rma -#: code:addons/rma/models/rma_request.py:174 +#: code:addons/rma/wizard/stock_return_picking.py:22 +#, python-format +msgid "You may only return single picking at a time!" +msgstr "" + +#. module: rma +#: code:addons/rma/models/rma_request.py:177 #, python-format msgid "You must select rma lines!" msgstr "" diff --git a/addons/rma/models/__init__.py b/addons/rma/models/__init__.py index b65c16e5..33e03e44 100644 --- a/addons/rma/models/__init__.py +++ b/addons/rma/models/__init__.py @@ -6,4 +6,4 @@ from . import rma_request from . import stock_production_lot from . import stock_picking from . import sales_team -from . import replacement_reason +from . import return_reason diff --git a/addons/rma/models/replacement_reason.py b/addons/rma/models/return_reason.py similarity index 58% rename from addons/rma/models/replacement_reason.py rename to addons/rma/models/return_reason.py index 5790576b..78c15ada 100644 --- a/addons/rma/models/replacement_reason.py +++ b/addons/rma/models/return_reason.py @@ -3,8 +3,8 @@ from flectra import fields, models -class ReplacementReason(models.Model): - _name = "replacement.reason" - _description = "Replacement Reason" +class ReturnReason(models.Model): + _name = "return.reason" + _description = "Return Reason" name = fields.Char(string='Reason') diff --git a/addons/rma/models/rma_line.py b/addons/rma/models/rma_line.py index 3f775ca4..0e348bd7 100644 --- a/addons/rma/models/rma_line.py +++ b/addons/rma/models/rma_line.py @@ -11,30 +11,30 @@ class RMALine(models.Model): product_id = fields.Many2one('product.product', string='Product') uom_id = fields.Many2one('product.uom', string='UOM') qty_delivered = fields.Float(string='Delivered Quantity') - qty_replaced = fields.Float(string='Replacement Quantity') + qty_return = fields.Float(string='Return Quantity') rma_id = fields.Many2one('rma.request', string='RMA Request Number') move_line_id = fields.Many2one('stock.move', string='Stock Move') - reason_id = fields.Many2one("replacement.reason", sting='Reason for RMA') + reason_id = fields.Many2one("return.reason", sting='Reason for RMA') remark = fields.Text(sting='Remark') team_id = fields.Many2one('crm.team', 'Team', related='rma_id.team_id') - @api.onchange('qty_replaced') - def _onchange_qty_replaced(self): - if self.product_id.tracking != 'none': - replaceable_qty = sum(line.qty_done for line in - self.move_line_id.move_line_ids if - line.lot_id.warranty_date and - line.lot_id.warranty_date >= - self.rma_id.date) - if self.qty_replaced > replaceable_qty: - raise UserError(_('You can only replace %s quantity for ' + @api.onchange('qty_return') + def _onchange_qty_return(self): + if not self.rma_id.is_website and self.product_id.tracking != 'none': + can_be_return_qty = sum(line.qty_done for line in + self.move_line_id.move_line_ids if + line.lot_id.warranty_date and + line.lot_id.warranty_date >= + self.rma_id.date) + if self.qty_return > can_be_return_qty: + raise UserError(_('You can only return %s quantity for ' 'product %s as its warranty has been ' - 'expired.') % (replaceable_qty, + 'expired.') % (can_be_return_qty, self.product_id.name)) - elif self.qty_replaced > self.qty_delivered: - raise UserError(_('Replacemet quantity of %s should not be ' + elif self.qty_return > self.qty_delivered: + raise UserError(_('Return quantity of %s should not be ' 'greater than ordered quantity.') % (self.product_id.name)) - if self.qty_replaced == 0: - raise UserError(_('Replacement quantity should not be 0.')) + if self.qty_return == 0: + raise UserError(_('Return quantity should not be 0.')) diff --git a/addons/rma/models/rma_request.py b/addons/rma/models/rma_request.py index 5a855172..ee7b5d36 100644 --- a/addons/rma/models/rma_request.py +++ b/addons/rma/models/rma_request.py @@ -6,7 +6,7 @@ from flectra.exceptions import UserError class RmaRequest(models.Model): _name = "rma.request" - _inherit = ['mail.thread', 'mail.activity.mixin'] + _inherit = ['mail.thread', 'mail.activity.mixin', 'portal.mixin'] _description = "RMA Request" name = fields.Char(string='RMA Order Number') @@ -16,7 +16,7 @@ class RmaRequest(models.Model): default=fields.Date.context_today) partner_id = fields.Many2one('res.partner', string='Customer') type = fields.Selection([ - ('replacement', 'Replacement') + ('return_replace', 'Return/Replace') ], string='Request Type') rma_line = fields.One2many('rma.line', 'rma_id', string='RMA Lines') warranty_expire_line = fields.One2many('warranty.expire.line', 'rma_id', @@ -24,6 +24,7 @@ class RmaRequest(models.Model): state = fields.Selection([ ('draft', 'Draft'), ('confirmed', 'Confirmed'), + ('rma_created', 'RMA Created'), ('replacement_created', 'Replacement Created'), ], string='Request Status', track_visibility='onchange', readonly=True, copy=False, default='draft') @@ -35,6 +36,8 @@ class RmaRequest(models.Model): user_id = fields.Many2one('res.users', string='User', default=lambda self: self.env.user) team_id = fields.Many2one('crm.team', string='Team') + is_website = fields.Boolean(string="Website") + is_replacement = fields.Boolean(string="Replacement?") @api.multi def _compute_picking(self): @@ -54,7 +57,7 @@ class RmaRequest(models.Model): @api.onchange('picking_id') def _get_rma_lines(self): - if self.picking_id: + if self.picking_id and not self.is_website: move_line_ids = self.env['stock.move'].search([( 'picking_id', '=', self.picking_id.id)]) move_lines = [(5, 0, 0)] @@ -63,11 +66,11 @@ class RmaRequest(models.Model): 'product_id': line.product_id.id, 'uom_id': line.product_uom.id, 'qty_delivered': line.quantity_done, - 'qty_replaced': sum(line.qty_done for line in - line.move_line_ids if - line.lot_id.warranty_date and - line.lot_id.warranty_date >= self.date - ), + 'qty_return': sum(line.qty_done for line in + line.move_line_ids if + line.lot_id.warranty_date and + line.lot_id.warranty_date >= self.date + ), 'rma_id': self.id, 'move_line_id': line.id })) @@ -127,7 +130,7 @@ class RmaRequest(models.Model): ir_model_data = self.env['ir.model.data'] try: template_id = ir_model_data.get_object_reference( - 'rma', 'email_template_notify_warranty_new')[1] + 'rma', 'email_template_notify_warranty_date')[1] except ValueError: template_id = False try: @@ -163,8 +166,8 @@ class RmaRequest(models.Model): elif 'state' in init_values and self.state == 'confirmed' and \ self.rma_line: return 'rma.mt_request_confirm' - elif 'state' in init_values and self.state == 'replacement_created': - return 'rma.mt_request_replaced' + elif 'state' in init_values and self.state == 'rma_created': + return 'rma.mt_request_return' return super(RmaRequest, self)._track_subtype(init_values) @api.multi @@ -172,8 +175,9 @@ class RmaRequest(models.Model): self.ensure_one() if not self.rma_line: raise UserError(_('You must select rma lines!')) - for line in self.rma_line: - line._onchange_qty_replaced() + if not self.is_website: + for line in self.rma_line: + line._onchange_qty_return() self.state = 'confirmed' @api.multi diff --git a/addons/rma/models/sales_team.py b/addons/rma/models/sales_team.py index 42b30d23..25607cc7 100644 --- a/addons/rma/models/sales_team.py +++ b/addons/rma/models/sales_team.py @@ -6,14 +6,14 @@ from flectra import fields, models class CrmTeam(models.Model): _inherit = 'crm.team' - use_replacement = fields.Boolean(string='Replacement') - replacements_count = fields.Integer( - compute='_compute_replacements', - string='Number of replacements') + use_return = fields.Boolean(string='Return') + returns_count = fields.Integer( + compute='_compute_returns', + string='Number of returns') - def _compute_replacements(self): - for replace in self: - if replace.use_replacement: + def _compute_returns(self): + for return_req in self: + if return_req.use_return: rma_ids = self.env['rma.request'].search([ - ('team_id.id', '=', replace.id)]) - replace.replacements_count = len(rma_ids) + ('team_id.id', '=', return_req.id)]) + return_req.returns_count = len(rma_ids) diff --git a/addons/rma/security/ir.model.access.csv b/addons/rma/security/ir.model.access.csv index 3df44237..51f8c8f7 100644 --- a/addons/rma/security/ir.model.access.csv +++ b/addons/rma/security/ir.model.access.csv @@ -1,5 +1,9 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink -access_rma_request,access_rma_request,model_rma_request,,1,1,1,0 -access_rma_line,access_rma_line,model_rma_line,,1,1,1,0 -access_warranty_expire_line,access_warranty_expire_line,model_warranty_expire_line,,1,1,1,0 -access_replacement_reason,access_replacement_reason,model_replacement_reason,,1,1,1,0 +access_rma_request_manager,access_rma_request_manager,model_rma_request,stock.group_stock_manager,1,1,1,1 +access_rma_request_portal,access_rma_request_portal,model_rma_request,base.group_portal,1,0,0,0 +access_rma_line_manager,access_rma_line_manager,model_rma_line,stock.group_stock_manager,1,1,1,1 +access_rma_line_portal,access_rma_line_potal,model_rma_line,base.group_portal,1,0,0,0 +access_warranty_expire_line_manager,access_warranty_expire_line_manager,model_warranty_expire_line,stock.group_stock_manager,1,1,1,0 +access_warranty_expire_line_portal,access_warranty_expire_line_portal,model_warranty_expire_line,base.group_portal,1,0,0,0 +access_return_reason_manager,access_return_reason_manager,model_return_reason,stock.group_stock_manager,1,1,1,0 +access_return_reason_portal,access_return_reason_portal,model_return_reason,base.group_portal,1,1,1,0 diff --git a/addons/rma/static/description/create_rma_btn8.png b/addons/rma/static/description/create_rma_btn8.png new file mode 100644 index 00000000..7cfc18a1 Binary files /dev/null and b/addons/rma/static/description/create_rma_btn8.png differ diff --git a/addons/rma/static/description/delivery_order4.png b/addons/rma/static/description/delivery_order4.png new file mode 100644 index 00000000..e732dd17 Binary files /dev/null and b/addons/rma/static/description/delivery_order4.png differ diff --git a/addons/rma/static/description/email7.png b/addons/rma/static/description/email7.png new file mode 100644 index 00000000..f8416123 Binary files /dev/null and b/addons/rma/static/description/email7.png differ diff --git a/addons/rma/static/description/expiry_date2.png b/addons/rma/static/description/expiry_date2.png new file mode 100644 index 00000000..f18c465f Binary files /dev/null and b/addons/rma/static/description/expiry_date2.png differ diff --git a/addons/rma/static/description/incoming_do9.png b/addons/rma/static/description/incoming_do9.png new file mode 100644 index 00000000..3e4dae38 Binary files /dev/null and b/addons/rma/static/description/incoming_do9.png differ diff --git a/addons/rma/static/description/index.html b/addons/rma/static/description/index.html new file mode 100644 index 00000000..cb7ba38d --- /dev/null +++ b/addons/rma/static/description/index.html @@ -0,0 +1,233 @@ +
+
+

Return Merchandise Authorizationing

+
+
+
+
+
+

Products by lots/serial numbers.

+

+ If product is managed by lots/serial number then warranty + expiry date is set. When return request is created, product + from expiry lot can not be return. +

+
+
+
+ +
+
+
+
+
+
+
+

Add warranty expiry date for + particular lot.

+

+ When product is managed by lots/serial numbers then warranty + expirey date must be set. +

+
+
+
+ +
+
+
+
+
+
+
+

Sale Order Created

+

+ Sale order is created for [E-COM08] Apple In-Ear Headphones + product. After confirming order, Delivery Order is generated. +

+
+
+
+ +
+
+
+
+
+
+
+

Delivery Order generated

+

+ Delivery order is created with lot numbers. Warranty expiry date + for lot number 0000004 is set before today's date. +

+
+
+
+ +
+
+
+
+
+
+
+

Return request is created for particular sale order and for a + particular picking.

+

+ In RMA Lines tab, Return quantity + is set to 5 because 2 quantity from lot number 0000004 has + been expired, so product from that lot can not be return. +

+
+
+
+ +
+
+
+
+
+
+
+

Warranty expire lines

+

+ In warranty Expire Lines tab, Details + of expired lot number, it's quantity and expired date is + visible. +

+
+
+
+ +
+
+
+
+
+
+
+

Email for product expiration

+

+ Email can be sent for product expiration by clicking "Send By + Email" button. +

+
+
+
+ +
+
+
+
+
+
+
+

Create a rma by clicking "Create + RMA" button

+
+
+
+ +
+
+
+
+
+
+
+

Incoming DO created

+

+ By clicking a button, Incoming Delivery Order is created. +

+
+
+
+ +
+
+
+
+
+
+
+

Details of return requests.

+
+
+
+ +
+
+
+
+
+
+
+

Return button for replacement

+

+ By clicking "Return" button, Outgoing Delivery is generated + if RMA request is for replacement. +

+
+
+
+ +
+
+
+
+
+
+
+

Outgoing DO generated

+

+ This RMA request is for replacement as Replacement checkbox + is checked. So system will allow to create replacement. +

+
+
+
+ +
+
+
+
+
+
+
+

Only return request

+

+ This RMA request is for return products as Replacement + checkbox is not checked. So system will not allow to create + outgoing DO. +

+
+
+
+ +
+
+
+
+
+
+
+

Create replacement is not allowed

+

+ From return DO, If you try to create replacement eventhough + it is not replacement request, Then this warning will appear. +

+
+
+
+ +
+
+
+
diff --git a/addons/rma/static/description/lot_number1.png b/addons/rma/static/description/lot_number1.png new file mode 100644 index 00000000..d04070fb Binary files /dev/null and b/addons/rma/static/description/lot_number1.png differ diff --git a/addons/rma/static/description/replace_do11.png b/addons/rma/static/description/replace_do11.png new file mode 100644 index 00000000..681e4f61 Binary files /dev/null and b/addons/rma/static/description/replace_do11.png differ diff --git a/addons/rma/static/description/replace_out_do12.png b/addons/rma/static/description/replace_out_do12.png new file mode 100644 index 00000000..c893fa10 Binary files /dev/null and b/addons/rma/static/description/replace_out_do12.png differ diff --git a/addons/rma/static/description/replacement_req14.png b/addons/rma/static/description/replacement_req14.png new file mode 100644 index 00000000..415f1b78 Binary files /dev/null and b/addons/rma/static/description/replacement_req14.png differ diff --git a/addons/rma/static/description/rma_request13.png b/addons/rma/static/description/rma_request13.png new file mode 100644 index 00000000..d2c83a03 Binary files /dev/null and b/addons/rma/static/description/rma_request13.png differ diff --git a/addons/rma/static/description/rma_request5.png b/addons/rma/static/description/rma_request5.png new file mode 100644 index 00000000..e1b2384a Binary files /dev/null and b/addons/rma/static/description/rma_request5.png differ diff --git a/addons/rma/static/description/rma_tree10.png b/addons/rma/static/description/rma_tree10.png new file mode 100644 index 00000000..bc831874 Binary files /dev/null and b/addons/rma/static/description/rma_tree10.png differ diff --git a/addons/rma/static/description/sale_order3.png b/addons/rma/static/description/sale_order3.png new file mode 100644 index 00000000..ea5f2b3a Binary files /dev/null and b/addons/rma/static/description/sale_order3.png differ diff --git a/addons/rma/static/description/warranty_lines6.png b/addons/rma/static/description/warranty_lines6.png new file mode 100644 index 00000000..1a8c7dc3 Binary files /dev/null and b/addons/rma/static/description/warranty_lines6.png differ diff --git a/addons/rma/tests/test_rma_request.py b/addons/rma/tests/test_rma_request.py index 037c0ee9..7abb59ca 100644 --- a/addons/rma/tests/test_rma_request.py +++ b/addons/rma/tests/test_rma_request.py @@ -56,28 +56,28 @@ class TestSaleOrder(TransactionCase): 'picking_id': picking_ids[0].id, 'date': datetime.now() - relativedelta(days=15), 'partner_id': self.sale_order_id_1.partner_id.id, - 'type': 'replacement' + 'type': 'return_replace' }) self.assertEquals(self.rma_id_1.state, 'draft') self.rma_id_1._get_rma_lines() self.assertTrue((len(self.rma_id_1.rma_line.ids)) != 0, - 'You can not create replacement request!') + 'You can not create RMA request!') self.rma_id_1._get_warranty_lines() self.assertEquals((len(self.rma_id_1.warranty_expire_line.ids)), 0, - 'This Replacement request should not have expiry ' + 'This RMA request should not have expiry ' 'product!') for rma_line in self.rma_id_1.rma_line: - replaceable_qty = sum(line.qty_done for line in - rma_line.move_line_id.move_line_ids if - line.lot_id.warranty_date and - line.lot_id.warranty_date >= - self.rma_id_1.date) - self.assertTrue(rma_line.qty_replaced <= replaceable_qty, - "You can only replace %d quantity for %s" % - (replaceable_qty, rma_line.product_id.name)) + can_be_return_qty = sum(line.qty_done for line in + rma_line.move_line_id.move_line_ids if + line.lot_id.warranty_date and + line.lot_id.warranty_date >= + self.rma_id_1.date) + self.assertTrue(rma_line.qty_return <= can_be_return_qty, + "You can only return %d quantity for %s" % + (can_be_return_qty, rma_line.product_id.name)) self.rma_id_1.action_confirm_request() self.assertEquals(self.rma_id_1.state, 'confirmed') @@ -90,9 +90,9 @@ class TestSaleOrder(TransactionCase): picking_id=self.rma_id_1.picking_id.id, )) self.return_picking_id_1.create_returns() - self.assertEquals(self.rma_id_1.state, 'replacement_created') + self.assertEquals(self.rma_id_1.state, 'rma_created') self.assertTrue(len(self.sale_order_id_1.picking_ids.ids) > 1, - 'Product has not been replaced yet') + 'Product has not been returned yet') incoming_shipment = False for pick in self.sale_order_id_1.picking_ids: @@ -104,6 +104,9 @@ class TestSaleOrder(TransactionCase): pick.button_validate() pick.action_done() self.assertTrue(incoming_shipment, 'Incoming shipment is not created') + self.assertEqual(len(self.sale_order_id_1.picking_ids.filtered( + lambda pick: pick.picking_type_code == 'outgoing')), 1, + "Replacement request can not be created!") def test_01_rma_request(self): self.sale_order_id_2.action_confirm() @@ -122,26 +125,27 @@ class TestSaleOrder(TransactionCase): 'picking_id': picking_ids[0].id, 'date': datetime.now() - relativedelta(days=10), 'partner_id': self.sale_order_id_2.partner_id.id, - 'type': 'replacement' + 'type': 'return_replace', + 'is_replacement': True }) self.assertEquals(self.rma_id_2.state, 'draft') self.rma_id_2._get_rma_lines() self.assertTrue((len(self.rma_id_2.rma_line.ids)) != 0, - 'You can not create replacement request!') + 'You can not create RMA request!') self.rma_id_2._get_warranty_lines() self.assertEquals((len(self.rma_id_2.warranty_expire_line.ids)), 1, - 'Replacement request must have expiry product!') + 'RMA request must have expiry product!') for rma_line in self.rma_id_2.rma_line: - replaceable_qty = sum(line.qty_done for line in - rma_line.move_line_id.move_line_ids if - line.lot_id.warranty_date and - line.lot_id.warranty_date >= - self.rma_id_2.date) - self.assertTrue(rma_line.qty_replaced <= replaceable_qty, + can_be_return_qty = sum(line.qty_done for line in + rma_line.move_line_id.move_line_ids if + line.lot_id.warranty_date and + line.lot_id.warranty_date >= + self.rma_id_2.date) + self.assertTrue(rma_line.qty_return <= can_be_return_qty, "You can only return %d quantity for %s" % - (replaceable_qty, rma_line.product_id.name)) + (can_be_return_qty, rma_line.product_id.name)) self.rma_id_2.state = 'confirmed' self.assertEquals(self.rma_id_2.state, 'confirmed') @@ -153,10 +157,10 @@ class TestSaleOrder(TransactionCase): 'stock.return.picking'].with_context(context).create(dict( picking_id=self.rma_id_2.picking_id.id, )) - self.return_picking_id_2.create_returns() - self.assertEquals(self.rma_id_2.state, 'replacement_created') + picking = self.return_picking_id_2.create_returns() + self.assertEquals(self.rma_id_2.state, 'rma_created') self.assertTrue(len(self.sale_order_id_2.picking_ids.ids) > 1, - 'Product has not been replaced yet') + 'Product has not been returned yet') incoming_shipment = False for pick in self.sale_order_id_2.picking_ids: @@ -170,3 +174,12 @@ class TestSaleOrder(TransactionCase): pick.button_validate() pick.action_done() self.assertTrue(incoming_shipment, 'Incoming shipment is not created') + + replace_context = {"active_model": 'stock.picking', + "active_ids": [picking['res_id']], "active_id": + picking['res_id']} + self.replace_picking_id_2 = self.env[ + 'stock.return.picking'].with_context(replace_context).create( + dict(picking_id=picking['res_id'])) + self.replace_picking_id_2.create_returns() + self.assertEquals(self.rma_id_2.state, 'replacement_created') diff --git a/addons/rma/views/menuitems_view.xml b/addons/rma/views/menuitems_view.xml index b3c81367..2b72e56c 100644 --- a/addons/rma/views/menuitems_view.xml +++ b/addons/rma/views/menuitems_view.xml @@ -2,19 +2,19 @@ - diff --git a/addons/rma/views/replacement_reason_view.xml b/addons/rma/views/return_reason_view.xml similarity index 59% rename from addons/rma/views/replacement_reason_view.xml rename to addons/rma/views/return_reason_view.xml index 54c93dde..d6c36bcf 100644 --- a/addons/rma/views/replacement_reason_view.xml +++ b/addons/rma/views/return_reason_view.xml @@ -1,10 +1,9 @@ - - replacement.reason.tree - replacement.reason + + return.reason.tree + return.reason tree - @@ -12,11 +11,10 @@ - - replacement.reason.form - replacement.reason + + return.reason.form + return.reason form -
@@ -29,10 +27,10 @@ - Replacement Reason + id="act_open_return_reason_view"> + Return Reason ir.actions.act_window - replacement.reason + return.reason form tree,form [] diff --git a/addons/rma/views/rma_line_view.xml b/addons/rma/views/rma_line_view.xml index 762b375a..9582b502 100644 --- a/addons/rma/views/rma_line_view.xml +++ b/addons/rma/views/rma_line_view.xml @@ -5,7 +5,6 @@ rma.line.form rma.line form - @@ -13,7 +12,7 @@ - + @@ -50,22 +49,21 @@ rma.line.graph rma.line - - + - - Replacement Requests + Return Requests rma.line graph,tree,form

- No replacement request. + No Return request.

{'search_default_team_id': active_id} diff --git a/addons/rma/views/rma_request_view.xml b/addons/rma/views/rma_request_view.xml index 71de7f05..4874dffd 100644 --- a/addons/rma/views/rma_request_view.xml +++ b/addons/rma/views/rma_request_view.xml @@ -4,7 +4,6 @@ rma.request.tree rma.request tree - @@ -21,23 +20,24 @@ rma.request.form rma.request form -
@@ -70,11 +70,14 @@ options="{'no_create': True}" attrs="{'readonly': [('state', '!=', 'draft')]}" /> - + + attrs="{'readonly': [('state', '!=', 'draft')], 'required': [('is_website', '=', False)], + 'invisible': [('is_website', '=', True)]}"/> +
@@ -85,7 +88,7 @@ attrs="{'readonly': [('state', '!=', 'draft')]}" options="{'no_create': True}"/> + attrs="{'readonly': ['|', ('state', '!=', 'draft'), ('is_website', '=', True)]}"/> @@ -99,7 +102,7 @@ force_save="1"/> - + @@ -115,8 +118,7 @@
- +
@@ -138,9 +140,15 @@ - + + + +
@@ -168,7 +180,7 @@
+ id="action_open_rma_request_rmateam"> RMA Request ir.actions.act_window rma.request @@ -177,6 +189,23 @@ [] { 'search_default_team_id': [active_id], + 'search_default_return_filter': 1, + 'default_team_id': active_id, + } + + + + + Replacement Request + ir.actions.act_window + rma.request + form + tree,form + [] + { + 'search_default_team_id': [active_id], + 'search_default_replacement_filter': 1, 'default_team_id': active_id, } diff --git a/addons/rma/views/sales_team_view.xml b/addons/rma/views/sales_team_view.xml index b03e371b..1f380af8 100644 --- a/addons/rma/views/sales_team_view.xml +++ b/addons/rma/views/sales_team_view.xml @@ -1,21 +1,21 @@ - - replacement.team.form + + rma.team.form crm.team
- -
- - replacement.team.kanban + + rma.team.kanban crm.team @@ -24,23 +24,28 @@
- +
+
-
+ @@ -48,8 +53,8 @@ @@ -57,8 +62,8 @@ - - replacement.kanban + + rma.kanban crm.team @@ -66,10 +71,10 @@ - diff --git a/addons/rma/views/warranty_expire_line_view.xml b/addons/rma/views/warranty_expire_line_view.xml index 256109ce..ec49af0e 100644 --- a/addons/rma/views/warranty_expire_line_view.xml +++ b/addons/rma/views/warranty_expire_line_view.xml @@ -4,7 +4,6 @@ warranty.expire..line.tree warranty.expire.line tree - @@ -20,9 +19,8 @@ warranty.expire.line.form warranty.expire.line form - - + diff --git a/addons/rma/wizard/stock_return_picking.py b/addons/rma/wizard/stock_return_picking.py index d7fc48e5..65ee844c 100644 --- a/addons/rma/wizard/stock_return_picking.py +++ b/addons/rma/wizard/stock_return_picking.py @@ -9,12 +9,18 @@ class ReturnPicking(models.TransientModel): @api.model def default_get(self, fields): + if self._context.get('active_model') == 'stock.picking': + picking = self.env['stock.picking'].browse( + self.env.context.get('active_id')) + if picking.rma_id and not picking.rma_id.is_replacement: + raise UserError(_("It is not replacement request!")) + if self._context.get('rma') and self._context.get('active_model') ==\ 'rma.request': res = {} if len(self.env.context.get('active_ids', list())) > 1: raise UserError(_( - "You may only replace single picking at a time!")) + "You may only return single picking at a time!")) move_dest_exists = False product_return_moves = [] rma_id = self.env['rma.request'].browse( @@ -33,7 +39,7 @@ class ReturnPicking(models.TransientModel): vals = {} for rma_line in rma_id.rma_line: vals.update({ - rma_line.product_id.id: rma_line.qty_replaced, + rma_line.product_id.id: rma_line.qty_return, }) for prod_id in product_ids: if vals.get(prod_id.id): @@ -60,8 +66,8 @@ class ReturnPicking(models.TransientModel): if not product_return_moves: raise UserError(_( - "No products to replace (only lines in Done state and" - "not fully replaced yet can be replaced)!")) + "No products to return (only lines in Done state and" + "not fully returned yet can be returned)!")) if 'product_return_moves' in fields: res.update({'product_return_moves': product_return_moves}) if 'move_dest_exists' in fields: @@ -94,5 +100,10 @@ class ReturnPicking(models.TransientModel): 'rma.request': rma_id = self.env['rma.request'].browse( self.env.context.get('active_id')) - rma_id.state = 'replacement_created' + rma_id.state = 'rma_created' + if self._context.get('active_model') == 'stock.picking': + picking = self.env['stock.picking'].browse( + self.env.context.get('active_id')) + if picking.rma_id: + picking.rma_id.state = 'replacement_created' return super(ReturnPicking, self).create_returns() diff --git a/addons/website_rma/__init__.py b/addons/website_rma/__init__.py new file mode 100644 index 00000000..fdd0bd76 --- /dev/null +++ b/addons/website_rma/__init__.py @@ -0,0 +1,5 @@ +# Part of Flectra See LICENSE file for full copyright and licensing details. + +from . import models +from . import wizard +from . import controllers diff --git a/addons/website_rma/__manifest__.py b/addons/website_rma/__manifest__.py new file mode 100644 index 00000000..c199f44a --- /dev/null +++ b/addons/website_rma/__manifest__.py @@ -0,0 +1,29 @@ +# Part of Flectra See LICENSE file for full copyright and licensing details. + +{ + 'name': 'Website Return Merchandise Authorizationing', + 'version': '1.0', + 'author': 'Flectra', + 'website': 'https://flectrahq.com', + 'description': """ + Return Merchandise Authorizationing is part of the process of a + consumer returning a product to receive a refund or replacement + during the product's warranty period. + """, + 'category': 'Sales', + 'depends': ['rma', 'website_sale', 'portal'], + 'data': [ + 'wizard/stock_return_web_view.xml', + 'views/rma_request_view.xml', + 'views/return_portal_template.xml', + 'views/templates.xml', + + ], + 'demo': [ + 'demo/sale_order_demo.xml' + ], + 'images': [ + 'static/description/website-rma-app-banner.jpg', + ], + 'application': True, +} diff --git a/addons/website_rma/controllers/__init__.py b/addons/website_rma/controllers/__init__.py new file mode 100644 index 00000000..b57b03dd --- /dev/null +++ b/addons/website_rma/controllers/__init__.py @@ -0,0 +1,4 @@ +# -*- coding: utf-8 -*- +# Part of Flectra. See LICENSE file for full copyright and licensing details. + +from . import portal diff --git a/addons/website_rma/controllers/portal.py b/addons/website_rma/controllers/portal.py new file mode 100644 index 00000000..9278c140 --- /dev/null +++ b/addons/website_rma/controllers/portal.py @@ -0,0 +1,132 @@ +# -*- coding: utf-8 -*- +# Part of Odoo,Flectra. See LICENSE file for full copyright and licensing +# details. + + +from flectra import http +from flectra.http import request, route +from flectra.addons.portal.controllers.portal import CustomerPortal, pager as \ + portal_pager + + +class CustomerPortal(CustomerPortal): + + @http.route() + def home(self, **kw): + response = super(CustomerPortal, self).home(**kw) + request_count = request.env['rma.request'].sudo().search_count( + [('state', 'in', ['draft', 'confirmed', 'rma_created', + 'replacement_created'])]) + response.qcontext.update({ + 'request_count': request_count + }) + return response + + def _order_get_page_view_values(self, order, access_token, **kwargs): + values = super(CustomerPortal, self)._order_get_page_view_values( + order, access_token, **kwargs) + reason_ids = request.env['return.reason'].search([]) + return_ids = request.env['rma.request'].search([ + ('sale_order_id', '=', order.id)]) + values.update({ + 'reasons': reason_ids, + 'return_ids': return_ids, + }) + return values + + @http.route(['/my/request', '/my/request/page/'], type='http', + auth="user", website=True) + def portal_my_requet(self, page=1, date_begin=None, date_end=None, + sortby=None, **kw): + values = self._prepare_portal_layout_values() + ReturnRequest = request.env['rma.request'] + domain = [ + ('state', 'in', ['draft', 'confirmed', 'rma_created', + 'replacement_created']) + ] + request_count = ReturnRequest.search_count(domain) + pager = portal_pager( + url="/my/request", + url_args={}, + total=request_count, + page=page, + step=self._items_per_page + ) + # content according to pager and archive selected + requests = ReturnRequest.sudo().search(domain, + limit=self._items_per_page, + offset=pager['offset']) + request.session['my_requests_history'] = requests.ids[:100] + + values.update({ + 'date': date_begin, + 'requests': requests.sudo(), + 'page_name': 'return_request', + 'pager': pager, + 'archive_groups': '', + 'default_url': '/my/request', + 'searchbar_sortings': '', + 'sortby': sortby, + }) + return request.render("website_rma.portal_my_requests", values) + + @http.route(['/my/request/'], type='http', + auth="public", + website=True) + def portal_request_page(self, return_req=None, access_token=None, **kw): + req = request.env['rma.request'].sudo().browse(return_req) + values = { + 'return_request': req, + } + return request.render("website_rma.portal_request_page", values) + + @http.route(['/return/request'], type='http', auth="public", + website=True, csrf=False) + def add_return_request(self, **kw): + is_replacement = False + if 'is_replacement_check' in kw and kw['is_replacement_check'] == 'on': + is_replacement = True + sale_order = request.env['sale.order'].browse(int(kw['order_id'])) + request_id = request.env['rma.request'].sudo().create({ + 'partner_id': kw['partner_id'], + 'sale_order_id': kw['order_id'], + 'team_id': sale_order.team_id and sale_order.team_id.id or False, + 'type': 'web_return_replace', + 'is_website': True, + 'is_replacement': is_replacement, + 'rma_line': [(0, 0, { + 'product_id': kw['product_id'], + 'uom_id': kw['uom_id'], + 'qty_return': kw['quantity'], + 'reason_id': kw['reason'], + 'qty_delivered': kw['qty_delivered'], + 'remark': kw['remark'], + }) + ], + }) + request_id.rma_line.write({'rma_id': request_id.id}) + request.session['request_last_return_id'] = request_id.id + return request.redirect('/return/confirmation') + + @http.route(['/return/confirmation'], type='http', auth="public", + website=True) + def return_confirmation(self, **post): + return_request_id = request.session.get('request_last_return_id') + if return_request_id: + return_request = request.env['rma.request'].sudo().browse( + return_request_id) + return request.render("website_rma.return_confirmation", + {'return_req_id': return_request}) + else: + return request.redirect('/shop') + + @route(['/sale/order/pdf/'], type='http', auth="public", + website=True) + def portal_sale_order_report(self, order_id, access_token=None, **kw): + pdf = request.env.ref('sale.action_report_saleorder' + ).sudo().render_qweb_pdf([order_id])[0] + pdfhttpheaders = [ + ('Content-Type', 'application/pdf'), + ('Content-Length', len(pdf)), + ] + return request.make_response(pdf, headers=pdfhttpheaders) diff --git a/addons/website_rma/demo/sale_order_demo.xml b/addons/website_rma/demo/sale_order_demo.xml new file mode 100644 index 00000000..52ef63cc --- /dev/null +++ b/addons/website_rma/demo/sale_order_demo.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + 1 + + + + + + Demo Product3 + + 3 + + 300.00 + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + Demo Product3 + + 5 + + 250.00 + + + + + + + + + + + + + + diff --git a/addons/website_rma/i18n/website_rma.pot b/addons/website_rma/i18n/website_rma.pot new file mode 100644 index 00000000..0ff58988 --- /dev/null +++ b/addons/website_rma/i18n/website_rma.pot @@ -0,0 +1,396 @@ +# Translation of Flectra Server. +# This file contains the translation of the following modules: +# * website_rma +# +msgid "" +msgstr "" +"Project-Id-Version: Flectra Server 1.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-03-14 05:57+0000\n" +"PO-Revision-Date: 2018-03-14 05:57+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: website_rma +#: model:ir.ui.view,arch_db:website_rma.portal_my_requests +msgid "&nbsp;" +msgstr "" + +#. module: website_rma +#: model:ir.ui.view,arch_db:website_rma.portal_return_page_button +msgid "&times;\n" +" Close" +msgstr "" + +#. module: website_rma +#: model:ir.ui.view,arch_db:website_rma.portal_my_requests +msgid "Return Reuqest #\n" +" " +msgstr "" + +#. module: website_rma +#: model:ir.ui.view,arch_db:website_rma.portal_request_page +msgid "\n" +" \n" +" Cancelled\n" +" " +msgstr "" + +#. module: website_rma +#: model:ir.ui.view,arch_db:website_rma.portal_my_requests +msgid "\n" +" \n" +" Draft\n" +" \n" +" " +msgstr "" + +#. module: website_rma +#: model:ir.ui.view,arch_db:website_rma.portal_request_page +msgid "\n" +" \n" +" Preparation\n" +" " +msgstr "" + +#. module: website_rma +#: model:ir.ui.view,arch_db:website_rma.portal_my_requests +msgid "\n" +" \n" +" Confirmed\n" +" \n" +" " +msgstr "" + +#. module: website_rma +#: model:ir.ui.view,arch_db:website_rma.portal_my_requests +msgid "\n" +" \n" +" Replacement Created\n" +" \n" +" " +msgstr "" + +#. module: website_rma +#: model:ir.ui.view,arch_db:website_rma.portal_my_requests +msgid "\n" +" \n" +" RMA\n" +" Request\n" +" Created\n" +" \n" +" " +msgstr "" + +#. module: website_rma +#: model:ir.ui.view,arch_db:website_rma.portal_request_page +msgid "\n" +" \n" +" Shipped\n" +" " +msgstr "" + +#. module: website_rma +#: model:ir.ui.view,arch_db:website_rma.portal_request_page +msgid "\n" +" \n" +" Confirm\n" +" " +msgstr "" + +#. module: website_rma +#: model:ir.ui.view,arch_db:website_rma.portal_request_page +msgid "\n" +" \n" +" RMA Request created\n" +" " +msgstr "" + +#. module: website_rma +#: model:ir.ui.view,arch_db:website_rma.portal_request_page +msgid "\n" +" \n" +" Draft\n" +" " +msgstr "" + +#. module: website_rma +#: model:ir.ui.view,arch_db:website_rma.portal_request_page +msgid "\n" +" \n" +" Partially Available\n" +" " +msgstr "" + +#. module: website_rma +#: model:ir.ui.view,arch_db:website_rma.return_confirmation +msgid "\n" +" Confirmed" +msgstr "" + +#. module: website_rma +#: model:ir.ui.view,arch_db:website_rma.return_confirmation +msgid "Return Request" +msgstr "" + +#. module: website_rma +#: model:ir.ui.view,arch_db:website_rma.portal_request_page +msgid "Date:" +msgstr "" + +#. module: website_rma +#: model:ir.ui.view,arch_db:website_rma.portal_request_page +msgid "Delivered Quantity" +msgstr "" + +#. module: website_rma +#: model:ir.ui.view,arch_db:website_rma.portal_request_page +msgid "Delivery Order" +msgstr "" + +#. module: website_rma +#: model:ir.ui.view,arch_db:website_rma.portal_request_page +msgid "Invoicing Address" +msgstr "" + +#. module: website_rma +#: model:ir.ui.view,arch_db:website_rma.portal_request_page +msgid "Order" +msgstr "" + +#. module: website_rma +#: model:ir.ui.view,arch_db:website_rma.portal_return_page_button +msgid "Partner" +msgstr "" + +#. module: website_rma +#: model:ir.ui.view,arch_db:website_rma.portal_return_page_button +msgid "Product to Return\n" +" " +msgstr "" + +#. module: website_rma +#: model:ir.ui.view,arch_db:website_rma.portal_request_page +msgid "Product" +msgstr "" + +#. module: website_rma +#: model:ir.ui.view,arch_db:website_rma.portal_return_page_button +msgid "Quantity" +msgstr "" + +#. module: website_rma +#: model:ir.ui.view,arch_db:website_rma.portal_return_page_button +msgid "Reason" +msgstr "" + +#. module: website_rma +#: model:ir.ui.view,arch_db:website_rma.portal_return_page_button +msgid "Replacement?" +msgstr "" + +#. module: website_rma +#: model:ir.ui.view,arch_db:website_rma.portal_request_page +msgid "Return Quantity" +msgstr "" + +#. module: website_rma +#: model:ir.ui.view,arch_db:website_rma.portal_return_page_button +msgid "Return Requests" +msgstr "" + +#. module: website_rma +#: model:ir.ui.view,arch_db:website_rma.portal_return_page_button +msgid "Sale Order" +msgstr "" + +#. module: website_rma +#: model:ir.ui.view,arch_db:website_rma.portal_request_page +msgid "Shipping/Picking Address" +msgstr "" + +#. module: website_rma +#: model:ir.ui.view,arch_db:website_rma.portal_request_page +msgid "State" +msgstr "" + +#. module: website_rma +#: model:ir.ui.view,arch_db:website_rma.portal_request_page +msgid "UOM" +msgstr "" + +#. module: website_rma +#: model:ir.ui.view,arch_db:website_rma.view_stock_return_web +msgid "Cancel" +msgstr "" + +#. module: website_rma +#: model:ir.ui.view,arch_db:website_rma.portal_return_page_button +msgid "Close" +msgstr "" + +#. module: website_rma +#: model:ir.ui.view,arch_db:website_rma.view_rma_request_form_inherit +msgid "Create RMA" +msgstr "" + +#. module: website_rma +#: model:ir.model.fields,field_description:website_rma.field_stock_return_web_create_uid +msgid "Created by" +msgstr "" + +#. module: website_rma +#: model:ir.model.fields,field_description:website_rma.field_stock_return_web_create_date +msgid "Created on" +msgstr "" + +#. module: website_rma +#: model:ir.model.fields,field_description:website_rma.field_stock_return_web_destination_location_id +msgid "Destination Location" +msgstr "" + +#. module: website_rma +#: model:ir.model.fields,field_description:website_rma.field_stock_return_web_display_name +msgid "Display Name" +msgstr "" + +#. module: website_rma +#: model:ir.model.fields,field_description:website_rma.field_stock_return_web_id +msgid "ID" +msgstr "" + +#. module: website_rma +#: model:ir.model.fields,field_description:website_rma.field_stock_return_web___last_update +msgid "Last Modified on" +msgstr "" + +#. module: website_rma +#: model:ir.model.fields,field_description:website_rma.field_stock_return_web_write_uid +msgid "Last Updated by" +msgstr "" + +#. module: website_rma +#: model:ir.model.fields,field_description:website_rma.field_stock_return_web_write_date +msgid "Last Updated on" +msgstr "" + +#. module: website_rma +#: code:addons/website_rma/wizard/stock_return_web.py:58 +#, python-format +msgid "New Move:" +msgstr "" + +#. module: website_rma +#: model:ir.model.fields,field_description:website_rma.field_stock_return_web_picking_type_id +msgid "Picking Type" +msgstr "" + +#. module: website_rma +#: model:ir.model.fields,field_description:website_rma.field_stock_return_web_product_id +msgid "Product" +msgstr "" + +#. module: website_rma +#: model:ir.model,name:website_rma.model_rma_request +msgid "RMA Request" +msgstr "" + +#. module: website_rma +#: model:ir.ui.view,arch_db:website_rma.portal_return_page_button +msgid "Remark" +msgstr "" + +#. module: website_rma +#: model:ir.ui.view,arch_db:website_rma.portal_my_requests +msgid "Request Date" +msgstr "" + +#. module: website_rma +#: model:ir.ui.view,arch_db:website_rma.portal_return_page_button +#: model:ir.ui.view,arch_db:website_rma.view_stock_return_web +msgid "Return" +msgstr "" + +#. module: website_rma +#: model:ir.actions.act_window,name:website_rma.action_stock_return_web +#: model:ir.ui.view,arch_db:website_rma.portal_return_page_button +#: model:ir.ui.view,arch_db:website_rma.view_stock_return_web +msgid "Return Product" +msgstr "" + +#. module: website_rma +#: model:ir.model.fields,field_description:website_rma.field_stock_return_web_qty_return +msgid "Return Quantity" +msgstr "" + +#. module: website_rma +#: model:ir.model.fields,field_description:website_rma.field_stock_return_web_rma_id +msgid "Return Request Number" +msgstr "" + +#. module: website_rma +#: model:ir.ui.view,arch_db:website_rma.portal_my_home_menu_request +#: model:ir.ui.view,arch_db:website_rma.portal_my_requests +msgid "Return Requests" +msgstr "" + +#. module: website_rma +#: model:ir.ui.view,arch_db:website_rma.return_confirmation +msgid "Return request will be\n" +" processed soon." +msgstr "" + +#. module: website_rma +#: model:ir.ui.view,arch_db:website_rma.portal_return_page_button +msgid "Return/Replace" +msgstr "" + +#. module: website_rma +#: model:ir.ui.view,arch_db:website_rma.portal_my_home_menu_return_request +msgid "Returns" +msgstr "" + +#. module: website_rma +#: model:ir.model.fields,field_description:website_rma.field_stock_return_web_order_id +msgid "SO Number" +msgstr "" + +#. module: website_rma +#: model:ir.ui.view,arch_db:website_rma.portal_my_requests +msgid "Sale Order #" +msgstr "" + +#. module: website_rma +#: model:ir.model,name:website_rma.model_sale_order_line +msgid "Sales Order Line" +msgstr "" + +#. module: website_rma +#: model:ir.model.fields,field_description:website_rma.field_stock_return_web_source_location_id +msgid "Source Location" +msgstr "" + +#. module: website_rma +#: model:ir.ui.view,arch_db:website_rma.portal_my_requests +msgid "There are currently no requests for your account." +msgstr "" + +#. module: website_rma +#: model:ir.model.fields,field_description:website_rma.field_stock_return_web_uom_id +msgid "UOM" +msgstr "" + +#. module: website_rma +#: model:ir.ui.view,arch_db:website_rma.portal_return_page_button +msgid "remark(optional)" +msgstr "" + +#. module: website_rma +#: model:ir.model,name:website_rma.model_stock_return_web +msgid "stock.return.web" +msgstr "" + diff --git a/addons/website_rma/models/__init__.py b/addons/website_rma/models/__init__.py new file mode 100644 index 00000000..34a7711a --- /dev/null +++ b/addons/website_rma/models/__init__.py @@ -0,0 +1,4 @@ +# Part of Flectra See LICENSE file for full copyright and licensing details. + +from . import rma_request +from . import sale_order_line diff --git a/addons/website_rma/models/rma_request.py b/addons/website_rma/models/rma_request.py new file mode 100644 index 00000000..a6e1efdd --- /dev/null +++ b/addons/website_rma/models/rma_request.py @@ -0,0 +1,18 @@ +# Part of Flectra See LICENSE file for full copyright and licensing details. + +from flectra import api, fields, models + + +class RmaReuqest(models.Model): + _inherit = ['rma.request'] + + type = fields.Selection([ + ('return_replace', 'Return/Replace'), + ('web_return_replace', 'Web Return/Replace') + ], string='Request Type', help="Type of return request") + + @api.multi + def _compute_is_website(self): + for request in self: + request.is_website = request.type and request.type == \ + 'web_return_replace' or False diff --git a/addons/website_rma/models/sale_order_line.py b/addons/website_rma/models/sale_order_line.py new file mode 100644 index 00000000..18d1426c --- /dev/null +++ b/addons/website_rma/models/sale_order_line.py @@ -0,0 +1,23 @@ +# Part of Flectra See LICENSE file for full copyright and licensing details. + +from flectra import models + + +class SaleOrderLine(models.Model): + _inherit = 'sale.order.line' + + def get_return_qty(self, order_id, line_id): + self._cr.execute("select s_line.id, r_line.product_id, " + "sum(r_line.qty_return) as return_qty from " + "rma_line " + "r_line, " + "rma_request req, sale_order so, " + "sale_order_line s_line where req.id = " + "r_line.rma_id and so.id = req.sale_order_id and " + "so.id = s_line.order_id and s_line.product_id = " + "r_line.product_id and so.id = %s and s_line.id " + "= %s " % (order_id, line_id) + + "group by(r_line.product_id, s_line.id)") + result = self._cr.dictfetchall() + if result: + return result diff --git a/addons/website_rma/static/description/icon.png b/addons/website_rma/static/description/icon.png new file mode 100644 index 00000000..0d6b10b9 Binary files /dev/null and b/addons/website_rma/static/description/icon.png differ diff --git a/addons/website_rma/static/description/index.html b/addons/website_rma/static/description/index.html new file mode 100644 index 00000000..a38d1a34 --- /dev/null +++ b/addons/website_rma/static/description/index.html @@ -0,0 +1,132 @@ +
+
+

Website Return Merchandise + Authorizationing

+
+
+
+
+
+

Ecommerce Sale Order

+
+
+
+ +
+
+
+
+
+
+
+

Return/Replace product

+

+ Product can be returned/replaced by clicking "Return/Replace" + button from particular order line. +

+
+
+
+ +
+
+
+
+
+
+
+

Return/Replace product dialog

+

+ By clicking "Return/Replace" button, A dialog box will open + with some auto fill details. You have to enter quantity to be + return/replace, reason for return/replace products and check + replacement checkbox if you want to replace product. +

+
+
+
+ +
+
+
+
+
+
+
+

RMA request created

+

+ By clicking "Return" button of dialog box, RMA request is + created with all required details. +

+
+
+
+ +
+
+
+
+
+
+
+

Return Product Wizard

+

+ By clicking "Create RMA" button, A wizard will open. You + have to select a picking type. +

+
+
+
+ +
+
+
+
+
+
+
+

Incoming DO Created

+

+ By clicking "Return" button, An Incoming delivery order is + generated. +

+
+
+
+ +
+
+
+
+
+
+
+

"Returns" will redirect to all + return/replacement + requests.

+
+
+
+ +
+
+
+
+
+
+
+

RMA Request

+
+
+
+ +
+
+
+
\ No newline at end of file diff --git a/addons/website_rma/static/description/web_picking.png b/addons/website_rma/static/description/web_picking.png new file mode 100644 index 00000000..d1194d2f Binary files /dev/null and b/addons/website_rma/static/description/web_picking.png differ diff --git a/addons/website_rma/static/description/web_picking_incoming.png b/addons/website_rma/static/description/web_picking_incoming.png new file mode 100644 index 00000000..011e9503 Binary files /dev/null and b/addons/website_rma/static/description/web_picking_incoming.png differ diff --git a/addons/website_rma/static/description/web_return_btn.png b/addons/website_rma/static/description/web_return_btn.png new file mode 100644 index 00000000..3fdba4d5 Binary files /dev/null and b/addons/website_rma/static/description/web_return_btn.png differ diff --git a/addons/website_rma/static/description/web_return_dialog.png b/addons/website_rma/static/description/web_return_dialog.png new file mode 100644 index 00000000..e2004290 Binary files /dev/null and b/addons/website_rma/static/description/web_return_dialog.png differ diff --git a/addons/website_rma/static/description/web_return_tab.png b/addons/website_rma/static/description/web_return_tab.png new file mode 100644 index 00000000..5d2eaabd Binary files /dev/null and b/addons/website_rma/static/description/web_return_tab.png differ diff --git a/addons/website_rma/static/description/web_rma_request.png b/addons/website_rma/static/description/web_rma_request.png new file mode 100644 index 00000000..2bb62381 Binary files /dev/null and b/addons/website_rma/static/description/web_rma_request.png differ diff --git a/addons/website_rma/static/description/web_rma_request_tab.png b/addons/website_rma/static/description/web_rma_request_tab.png new file mode 100644 index 00000000..52c1eea6 Binary files /dev/null and b/addons/website_rma/static/description/web_rma_request_tab.png differ diff --git a/addons/website_rma/static/description/web_sale_order.png b/addons/website_rma/static/description/web_sale_order.png new file mode 100644 index 00000000..b7b9ade2 Binary files /dev/null and b/addons/website_rma/static/description/web_sale_order.png differ diff --git a/addons/website_rma/static/description/website-rma-app-banner.jpg b/addons/website_rma/static/description/website-rma-app-banner.jpg new file mode 100644 index 00000000..e7b459aa Binary files /dev/null and b/addons/website_rma/static/description/website-rma-app-banner.jpg differ diff --git a/addons/website_rma/static/src/css/return_wizard.css b/addons/website_rma/static/src/css/return_wizard.css new file mode 100644 index 00000000..7bb01326 --- /dev/null +++ b/addons/website_rma/static/src/css/return_wizard.css @@ -0,0 +1,11 @@ +.modal-body .form-horizontal .col-sm-2, +.modal-body .form-horizontal .col-sm-10 { + width: 100% +} + +.modal-body .form-horizontal .control-label { + text-align: left; +} +.modal-body .form-horizontal .col-sm-offset-2 { + margin-left: 15px; +} diff --git a/addons/website_rma/static/src/js/website_rma_tour.js b/addons/website_rma/static/src/js/website_rma_tour.js new file mode 100644 index 00000000..1f0fb90c --- /dev/null +++ b/addons/website_rma/static/src/js/website_rma_tour.js @@ -0,0 +1,37 @@ +flectra.define('website_rma.rma_tour', function (require) { +'use strict'; + +var tour = require("web_tour.tour"); +var base = require("web_editor.base"); + +tour.register('web_rma', { + test: true, + url: '/my/home', + wait_for: base.ready() +}, + [ + { + content: "sales order list", + trigger: 'a[href="/my/orders"]', + }, + { + content: "select sale order", + trigger: 'a:contains("SO035")', + }, + { + content: "click on return button on order line", + trigger: '#order_line_return a:contains("Return")', + }, + { + content: "click on return button", + trigger: 'button[id="prod_return"]', + }, + { + content: "create rma request", + trigger: 'form[action^="/return/request"]', + }, + + ] +); + +}); diff --git a/addons/website_rma/static/src/js/website_rma_tour_demo.js b/addons/website_rma/static/src/js/website_rma_tour_demo.js new file mode 100644 index 00000000..eb4ba5e3 --- /dev/null +++ b/addons/website_rma/static/src/js/website_rma_tour_demo.js @@ -0,0 +1,37 @@ +flectra.define('website_rma.rma_tour_demo', function (require) { +'use strict'; + +var tour = require("web_tour.tour"); +var base = require("web_editor.base"); + +tour.register('web_rma_demo', { + test: true, + url: '/my/home', + wait_for: base.ready() +}, + [ + { + content: "sales order list", + trigger: 'a[href="/my/orders"]', + }, + { + content: "select sale order", + trigger: 'a:contains("SO036")', + }, + { + content: "click on return button on order line", + trigger: '#order_line_return a:contains("Return")', + }, + { + content: "click on return button", + trigger: 'button[id="prod_return"]', + }, + { + content: "create rma request", + trigger: 'form[action^="/return/request"]', + }, + + ] +); + +}); diff --git a/addons/website_rma/tests/__init__.py b/addons/website_rma/tests/__init__.py new file mode 100644 index 00000000..b3a9e293 --- /dev/null +++ b/addons/website_rma/tests/__init__.py @@ -0,0 +1,3 @@ +# Part of Flectra See LICENSE file for full copyright and licensing details. + +from . import test_web_rma diff --git a/addons/website_rma/tests/test_web_rma.py b/addons/website_rma/tests/test_web_rma.py new file mode 100644 index 00000000..d1f62504 --- /dev/null +++ b/addons/website_rma/tests/test_web_rma.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# Part of Flectra. See LICENSE file for full copyright and licensing details. + + +import flectra.tests + + +@flectra.tests.common.at_install(False) +@flectra.tests.common.post_install(True) +class TestUi(flectra.tests.HttpCase): + def test_01_web_rma(self): + self.phantom_js("/my/home", "flectra.__DEBUG__.services[" + "'web_tour.tour'].run('web_rma')", + "flectra.__DEBUG__.services['web_tour.tour'" + "].tours.web_rma.ready", login="admin") + + def test_02_web_rma(self): + self.phantom_js("/my/home", "flectra.__DEBUG__.services[" + "'web_tour.tour'].run('web_rma_demo')", + "flectra.__DEBUG__.services['web_tour.tour'" + "].tours.web_rma_demo.ready", login="demo") diff --git a/addons/website_rma/views/return_portal_template.xml b/addons/website_rma/views/return_portal_template.xml new file mode 100644 index 00000000..20d961cf --- /dev/null +++ b/addons/website_rma/views/return_portal_template.xml @@ -0,0 +1,540 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/addons/website_rma/views/rma_request_view.xml b/addons/website_rma/views/rma_request_view.xml new file mode 100644 index 00000000..c23277c9 --- /dev/null +++ b/addons/website_rma/views/rma_request_view.xml @@ -0,0 +1,19 @@ + + + + rma.request.form.inherit + rma.request + + + +