diff --git a/rma/__init__.py b/rma/__init__.py deleted file mode 100644 index d62bb54d..00000000 --- a/rma/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details. - -from . import controllers -from . import models -from . import wizard diff --git a/rma/__manifest__.py b/rma/__manifest__.py deleted file mode 100644 index a72dc792..00000000 --- a/rma/__manifest__.py +++ /dev/null @@ -1,33 +0,0 @@ -# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details. - -{ - 'name': 'Hibou RMAs', - 'version': '15.0.1.0.1', - 'category': 'Warehouse', - 'author': 'Hibou Corp.', - 'license': 'OPL-1', - 'website': 'https://hibou.io/', - 'depends': [ - 'hibou_professional', - 'stock', - 'delivery', - ], - 'demo': [ - 'demo/rma_demo.xml', - ], - 'data': [ - 'data/cron_data.xml', - 'data/ir_sequence_data.xml', - 'security/ir.model.access.csv', - 'security/rma_security.xml', - 'views/account_views.xml', - 'views/portal_templates.xml', - 'views/rma_views.xml', - 'views/stock_picking_views.xml', - 'wizard/rma_lines_views.xml', - 'wizard/rma_make_rtv_views.xml', - ], - 'installable': True, - 'application': True, - 'auto_install': False, - } diff --git a/rma/controllers/__init__.py b/rma/controllers/__init__.py deleted file mode 100644 index b4e3c98a..00000000 --- a/rma/controllers/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details. - -from . import main -from . import portal diff --git a/rma/controllers/main.py b/rma/controllers/main.py deleted file mode 100644 index 4a87c318..00000000 --- a/rma/controllers/main.py +++ /dev/null @@ -1,51 +0,0 @@ -# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details. - -from odoo import http, exceptions -from base64 import b64decode -import hmac -from hashlib import sha256 -from datetime import datetime -from time import mktime - - -def create_hmac(secret, a_attchment_id, e_expires): - return hmac.new(secret.encode(), str(str(a_attchment_id) + str(e_expires)).encode(), sha256).hexdigest() - - -def check_hmac(secret, hash_, a_attachment_id, e_expires): - myh = hmac.new(secret.encode(), str(str(a_attachment_id) + str(e_expires)).encode(), sha256) - return hmac.compare_digest(str(hash_), myh.hexdigest()) - - -class RMAController(http.Controller): - - @http.route(['/rma_label'], type='http', auth='public', website=True) - def index(self, *args, **request): - a_attachment_id = request.get('a') - e_expires = request.get('e') - hash = request.get('h') - - if not all([a_attachment_id, e_expires, hash]): - return http.Response('Invalid Request', status=400) - - now = datetime.utcnow() - now = int(mktime(now.timetuple())) - - config = http.request.env['ir.config_parameter'].sudo() - secret = str(config.search([('key', '=', 'database.secret')], limit=1).value) - - if not check_hmac(secret, hash, a_attachment_id, e_expires): - return http.Response('Invalid Request', status=400) - - if now > int(e_expires): - return http.Response('Expired', status=404) - - attachment = http.request.env['ir.attachment'].sudo().search([('id', '=', int(a_attachment_id))], limit=1) - if attachment: - data = attachment.datas - filename = attachment.name - mimetype = attachment.mimetype - return http.request.make_response(b64decode(data), [ - ('Content-Type', mimetype), - ('Content-Disposition', 'attachment; filename="' + filename + '"')]) - return http.Response('Invalid Attachment', status=404) diff --git a/rma/controllers/portal.py b/rma/controllers/portal.py deleted file mode 100644 index 6d97b80a..00000000 --- a/rma/controllers/portal.py +++ /dev/null @@ -1,177 +0,0 @@ -# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details. - -from operator import itemgetter - -from odoo import http, fields -from odoo.exceptions import AccessError, MissingError, UserError, ValidationError -from odoo.http import request -from odoo.tools import groupby as groupbyelem -from odoo.tools.translate import _ -from odoo.addons.portal.controllers.portal import pager as portal_pager, CustomerPortal - - -def rma_portal_searchbar_sortings(): - # Override to add more sorting - return { - 'date': {'label': _('Newest'), 'order': 'create_date desc, id desc'}, - 'name': {'label': _('Name'), 'order': 'name asc, id asc'}, - } - - -def rma_portal_searchbar_filters(): - # Override to add more filters - return { - 'all': {'label': _('All'), 'domain': [('state', 'in', ['draft', 'confirmed', 'done', 'cancel'])]}, - 'draft': {'label': _('Draft'), 'domain': [('state', '=', 'draft')]}, - 'confirmed': {'label': _('Confirmed'), 'domain': [('state', '=', 'confirmed')]}, - 'cancel': {'label': _('Cancelled'), 'domain': [('state', '=', 'cancel')]}, - 'done': {'label': _('Done'), 'domain': [('state', '=', 'done')]}, - } - - -def rma_portal_searchbar_inputs(): - # Override to add more search fields - return { - 'name': {'input': 'name', 'label': _('Search in Name')}, - 'all': {'input': 'all', 'label': _('Search in All')}, - } - - -def rma_portal_searchbar_groupby(): - # Override to add more options for grouping - return { - 'none': {'input': 'none', 'label': _('None')}, - 'state': {'input': 'state', 'label': _('State')}, - 'template': {'input': 'template', 'label': _('Type')}, - } - - -def rma_portal_search_domain(search_in, search): - # Override if you added search inputs - search_domain = [] - if search_in in ('name', 'all'): - search_domain.append(('name', 'ilike', search)) - return search_domain - - -def rma_portal_group_rmas(rmas, groupby): - # Override to check groupby and perform a different grouping - if groupby == 'state': - return [request.env['rma.rma'].concat(*g) for k, g in groupbyelem(rmas, itemgetter('state'))] - if groupby == 'template': - return [request.env['rma.rma'].concat(*g) for k, g in groupbyelem(rmas, itemgetter('template_id'))] - return [rmas] - - -class CustomerPortal(CustomerPortal): - - def _prepare_portal_layout_values(self): - values = super(CustomerPortal, self)._prepare_portal_layout_values() - values['rma_count'] = request.env['rma.rma'].search_count([ - ]) - return values - - def _rma_get_page_view_values(self, rma, access_token, **kwargs): - values = { - 'rma': rma, - 'current_date': fields.Datetime.now(), - } - return self._get_page_view_values(rma, access_token, values, 'my_rma_history', True, **kwargs) - - @http.route(['/my/rma', '/my/rma/page/'], type='http', auth="user", website=True) - def portal_my_rma(self, page=1, date_begin=None, date_end=None, sortby='date', filterby='all', groupby='none', search_in='all', search=None, **kw): - values = self._prepare_portal_layout_values() - - searchbar_sortings = rma_portal_searchbar_sortings() - searchbar_filters = rma_portal_searchbar_filters() - searchbar_inputs = rma_portal_searchbar_inputs() - searchbar_groupby = rma_portal_searchbar_groupby() - - if sortby not in searchbar_sortings: - raise UserError(_("Unknown sorting option.")) - order = searchbar_sortings[sortby]['order'] - - if filterby not in searchbar_filters: - raise UserError(_("Unknown filter option.")) - domain = searchbar_filters[filterby]['domain'] - if date_begin and date_end: - domain += [('create_date', '>', date_begin), ('create_date', '<=', date_end)] - - if search_in and search: - domain += rma_portal_search_domain(search_in, search) - - RMA = request.env['rma.rma'] - rma_count = len(RMA.search(domain)) - pager = portal_pager( - url="/my/rma", - url_args={'date_begin': date_begin, 'date_end': date_end, 'sortby': sortby, 'search_in': search_in, 'search': search}, - total=rma_count, - page=page, - step=self._items_per_page - ) - rmas = RMA.search(domain, order=order, limit=self._items_per_page, offset=pager['offset']) - request.session['my_rma_history'] = rmas.ids[:100] - - rma_templates = request.env['rma.template'].sudo().search([('portal_ok', '=', True)]) - - grouped_rmas = rma_portal_group_rmas(rmas, groupby) - values.update({ - 'rma_templates': rma_templates, - 'date': date_begin, - 'grouped_rmas': grouped_rmas, - 'page_name': 'rma', - 'default_url': '/my/rma', - 'pager': pager, - 'searchbar_sortings': searchbar_sortings, - 'searchbar_filters': searchbar_filters, - 'searchbar_inputs': searchbar_inputs, - 'searchbar_groupby': searchbar_groupby, - 'sortby': sortby, - 'groupby': groupby, - 'search_in': search_in, - 'search': search, - 'filterby': filterby, - }) - return request.render("rma.portal_my_rma", values) - - @http.route(['/my/rma/'], type='http', auth="public", website=True) - def portal_my_rma_rma(self, rma_id=None, access_token=None, **kw): - try: - rma_sudo = self._document_check_access('rma.rma', rma_id, access_token=access_token) - except (AccessError, MissingError): - return request.redirect('/my') - - values = self._rma_get_page_view_values(rma_sudo, access_token, **kw) - return request.render("rma.portal_my_rma_rma", values) - - @http.route(['/my/rma/new/', - '/my/rma/new//res/'], type='http', auth='public', website=True) - def portal_rma_new(self, rma_template_id=None, res_id=None, **kw): - if request.env.user.has_group('base.group_public'): - return request.redirect('/my') - - rma_template = request.env['rma.template'].sudo().browse(rma_template_id) - if not rma_template.exists() or not rma_template.portal_ok: - return request.redirect('/my') - - error = None - try: - if res_id: - # Even if res_id is not important to the RMA type, some sort of number - # should be submitted to indicate that a selection has occurred. - rma = rma_template._portal_try_create(request.env.user, res_id, **kw) - if rma: - return request.redirect(rma.get_portal_url()) - except ValidationError as e: - error = e.name - - template_name = rma_template._portal_template(res_id=res_id) - if not template_name: - return request.redirect('/my') - values = rma_template._portal_values(request.env.user, res_id=res_id) - values.update({ - 'request': request, - 'error': error, - 'current_date': fields.Datetime.now(), - }) - return request.render(template_name, values) diff --git a/rma/data/cron_data.xml b/rma/data/cron_data.xml deleted file mode 100644 index 4843bf35..00000000 --- a/rma/data/cron_data.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - RMA Expiration - 1 - days - -1 - - - code - model._rma_expire() - - - - \ No newline at end of file diff --git a/rma/data/ir_sequence_data.xml b/rma/data/ir_sequence_data.xml deleted file mode 100644 index b021bdee..00000000 --- a/rma/data/ir_sequence_data.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - RMA - rma.rma - RMA - 3 - - - - - diff --git a/rma/demo/rma_demo.xml b/rma/demo/rma_demo.xml deleted file mode 100644 index 94f78e70..00000000 --- a/rma/demo/rma_demo.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - - Missing Item - - - - - - make_to_stock - - - - RMA Returns - standard - WH/RMA/ - - - - - - RMA Receipts - WH/RMA - - - incoming - - - - - - - - - Picking Return - stock_picking - - - - - - make_to_stock - - - - - Return To Vendor - - - - - make_to_stock - - - - \ No newline at end of file diff --git a/rma/i18n/es.po b/rma/i18n/es.po deleted file mode 100644 index fb40ca27..00000000 --- a/rma/i18n/es.po +++ /dev/null @@ -1,1158 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * rma -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 15.0+e\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-01 15:26+0000\n" -"PO-Revision-Date: 2021-11-01 15:26+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: rma -#: model:ir.model.fields,help:rma.field_rma_rma__in_picking_state -#: model:ir.model.fields,help:rma.field_rma_rma__out_picking_state -msgid "" -" * Draft: The transfer is not confirmed yet. Reservation doesn't apply.\n" -" * Waiting another operation: This transfer is waiting for another operation before being ready.\n" -" * Waiting: The transfer is waiting for the availability of some products.\n" -"(a) The shipping policy is \"As soon as possible\": no product could be reserved.\n" -"(b) The shipping policy is \"When all products are ready\": not all the products could be reserved.\n" -" * Ready: The transfer is ready to be processed.\n" -"(a) The shipping policy is \"As soon as possible\": at least one product has been reserved.\n" -"(b) The shipping policy is \"When all products are ready\": all product have been reserved.\n" -" * Done: The transfer has been processed.\n" -" * Cancelled: The transfer has been cancelled." -msgstr "" -" * Borrador: Todavía no se ha confirmado la transferencias. La reserva no aplica.\n" -" * Esperando otra operación: Esta transferencia esta esperando otra operación antes de que sea lista.\n" -" * Operación: La transferencia esta esperando la disponibilidad de algunos productos.\n" -"(a) La norma de envío es \"Lo más pronto posible\": Ningún producto se pudo reservar.\n" -"(b) La norma de envío es \"Cuando todo los productos estén listos\": No se pudo reservar todos los productos.\n" -" * Listo: La transferencia esta listo para ser procesado.\n" -"(a) La norma de envío es \"Lo más pronto posible\": Se ha reservado por lo menos un producto.\n" -"(b) La norma de envío es \"Cuando todo los productos estén listos\": Se ha reservado todos los productos.\n" -" * Finalizado: La transferencia ha sido procesado.\n" -" * Cancelado: La transferencia ha sido cancelada." - -#. module: rma -#: model_terms:ir.ui.view,arch_db:rma.portal_my_rma -msgid "&times;" -msgstr "&times;" - -#. module: rma -#: model_terms:ir.ui.view,arch_db:rma.portal_my_rma -msgid "RMAs in state:" -msgstr "Estado del RMA:" - -#. module: rma -#: model_terms:ir.ui.view,arch_db:rma.portal_my_rma -msgid "Status" -msgstr "Estado" - -#. module: rma -#: model_terms:ir.ui.view,arch_db:rma.portal_my_rma -msgid "Type" -msgstr "Tipo" - -#. module: rma -#: model_terms:ir.ui.view,arch_db:rma.portal_new_stock_picking -msgid "Description" -msgstr "Descripción" - -#. module: rma -#: model_terms:ir.ui.view,arch_db:rma.portal_my_rma_rma -#: model_terms:ir.ui.view,arch_db:rma.portal_new_stock_picking -msgid "Product" -msgstr "Producto" - -#. module: rma -#: model_terms:ir.ui.view,arch_db:rma.portal_new_stock_picking -msgid "Quantity Delivered" -msgstr "Cantidad Enviado" - -#. module: rma -#: model_terms:ir.ui.view,arch_db:rma.portal_new_stock_picking -msgid "Quantity Ordered" -msgstr "Cantidad Pedido" - -#. module: rma -#: model_terms:ir.ui.view,arch_db:rma.portal_new_stock_picking -msgid "Quantity to Return" -msgstr "Cantidad a Devolver" - -#. module: rma -#: model_terms:ir.ui.view,arch_db:rma.portal_my_rma_rma -msgid "Quantity" -msgstr "Cantidad" - -#. module: rma -#: model_terms:ir.ui.view,arch_db:rma.portal_my_rma_rma -msgid "Submitted Date:" -msgstr "Fecha Emitida:" - -#. module: rma -#: model_terms:ir.ui.view,arch_db:rma.portal_my_rma_rma -msgid "Transfer:" -msgstr "Transferir:" - -#. module: rma -#: model_terms:ir.ui.view,arch_db:rma.portal_my_rma_rma -msgid "Validity Date:" -msgstr "Fecha de Validez:" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_rma__access_warning -msgid "Access warning" -msgstr "Advertencia de Acceso" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_rma__message_needaction -msgid "Action Needed" -msgstr "Acción Requerida" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_rma__activity_ids -msgid "Activities" -msgstr "Actividades" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_rma__activity_exception_decoration -msgid "Activity Exception Decoration" -msgstr "Decoracion de Excepciones del Actividad" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_rma__activity_state -msgid "Activity State" -msgstr "Estado de la Actividad" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_rma__activity_type_icon -msgid "Activity Type Icon" -msgstr "Tipo de Icono de la Actividad" - -#. module: rma -#: model_terms:ir.ui.view,arch_db:rma.view_rma_add_lines_form -msgid "Add" -msgstr "Agregar" - -#. module: rma -#: model:ir.model,name:rma.model_rma_picking_make_lines -msgid "Add Picking Lines" -msgstr "Agregar Líneas de Picking" - -#. module: rma -#: model:ir.actions.act_window,name:rma.action_rma_add_lines -msgid "Add RMA Lines" -msgstr "Agregar Líneas de RMA" - -#. module: rma -#: model_terms:ir.ui.view,arch_db:rma.view_rma_rma_form -msgid "Add lines" -msgstr "Agregar Líneas" - -#. module: rma -#: code:addons/rma/controllers/portal.py:0 -#, python-format -msgid "All" -msgstr "Todo" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_template__portal_ok -msgid "Allow on Portal" -msgstr "Permitir en el Portal" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_template__usage -msgid "Applies To" -msgstr "Aplica a" - -#. module: rma -#: model:ir.model.fields.selection,name:rma.selection__rma_template__in_procure_method__make_to_order -#: model:ir.model.fields.selection,name:rma.selection__rma_template__out_procure_method__make_to_order -msgid "Apply Procurements" -msgstr "Aplica Adquisiciones" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_rma__message_attachment_count -msgid "Attachment Count" -msgstr "Recuento de Adjuntas" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_template__automatic_expire -msgid "Automatic Expire" -msgstr "Expiración Automática" - -#. module: rma -#: model_terms:ir.ui.view,arch_db:rma.portal_my_rma -#: model_terms:ir.ui.view,arch_db:rma.view_rma_add_lines_form -#: model_terms:ir.ui.view,arch_db:rma.view_rma_rma_form -msgid "Cancel" -msgstr "Cancelar" - -#. module: rma -#: code:addons/rma/controllers/portal.py:0 -#: model:ir.model.fields.selection,name:rma.selection__rma_rma__state__cancel -#, python-format -msgid "Cancelled" -msgstr "Cancelada" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_rma__in_picking_carrier_id -#: model:ir.model.fields,field_description:rma.field_rma_rma__out_picking_carrier_id -#: model_terms:ir.ui.view,arch_db:rma.view_rma_rma_form -msgid "Carrier" -msgstr "Transportista" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_make_rtv_line__rma_claim_number -#: model:ir.model.fields,field_description:rma.field_rma_rma__claim_number -msgid "Claim Number" -msgstr "Número de Reclamo" - -#. module: rma -#: model_terms:ir.ui.view,arch_db:rma.portal_my_rma -msgid "Close" -msgstr "Cerrar" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_tag__color -msgid "Color Index" -msgstr "Índice de Color" - -#. module: rma -#: model_terms:ir.ui.view,arch_db:rma.portal_my_rma_rma -msgid "Communication" -msgstr "Comunicación" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_rma__company_id -#: model:ir.model.fields,field_description:rma.field_rma_template__company_id -msgid "Company" -msgstr "Compañía" - -#. module: rma -#: model:ir.ui.menu,name:rma.menu_rma_configuration -msgid "Configuration" -msgstr "Configuración" - -#. module: rma -#: model_terms:ir.ui.view,arch_db:rma.view_rma_rma_form -msgid "Confirm" -msgstr "Confirmar" - -#. module: rma -#: code:addons/rma/controllers/portal.py:0 -#: model:ir.model.fields.selection,name:rma.selection__rma_rma__state__confirmed -#: model_terms:ir.ui.view,arch_db:rma.view_rma_rma_search -#, python-format -msgid "Confirmed" -msgstr "Confirmado" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_rma__template_create_in_picking -#: model:ir.model.fields,field_description:rma.field_rma_template__create_in_picking -msgid "Create Inbound Picking" -msgstr "Crear un Picking de entrada" - -#. module: rma -#: model_terms:ir.ui.view,arch_db:rma.portal_my_rma -msgid "Create New RMA" -msgstr "Crear un Nuevo RMA" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_rma__template_create_out_picking -#: model:ir.model.fields,field_description:rma.field_rma_template__create_out_picking -msgid "Create Outbound Picking" -msgstr "Crear un Picking de Salida" - -#. module: rma -#: model_terms:ir.ui.view,arch_db:rma.portal_my_rma -msgid "Create RMA" -msgstr "Crear RMA" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_line__create_uid -#: model:ir.model.fields,field_description:rma.field_rma_make_rtv__create_uid -#: model:ir.model.fields,field_description:rma.field_rma_make_rtv_line__create_uid -#: model:ir.model.fields,field_description:rma.field_rma_picking_make_lines__create_uid -#: model:ir.model.fields,field_description:rma.field_rma_picking_make_lines_line__create_uid -#: model:ir.model.fields,field_description:rma.field_rma_rma__create_uid -#: model:ir.model.fields,field_description:rma.field_rma_tag__create_uid -#: model:ir.model.fields,field_description:rma.field_rma_template__create_uid -msgid "Created by" -msgstr "Creado por" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_line__create_date -#: model:ir.model.fields,field_description:rma.field_rma_make_rtv__create_date -#: model:ir.model.fields,field_description:rma.field_rma_make_rtv_line__create_date -#: model:ir.model.fields,field_description:rma.field_rma_picking_make_lines__create_date -#: model:ir.model.fields,field_description:rma.field_rma_picking_make_lines_line__create_date -#: model:ir.model.fields,field_description:rma.field_rma_rma__create_date -#: model:ir.model.fields,field_description:rma.field_rma_tag__create_date -#: model:ir.model.fields,field_description:rma.field_rma_template__create_date -msgid "Created on" -msgstr "Creado en" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_rma__customer_description -#: model:ir.model.fields,field_description:rma.field_rma_template__customer_description -#: model_terms:ir.ui.view,arch_db:rma.portal_my_rma_rma -#: model_terms:ir.ui.view,arch_db:rma.view_rma_rma_form -#: model_terms:ir.ui.view,arch_db:rma.view_rma_template_form -msgid "Customer Instructions" -msgstr "Instrucciones del Cliente" - -#. module: rma -#: model:ir.model.fields,help:rma.field_rma_rma__access_url -msgid "Customer Portal URL" -msgstr "URL del Portal del Cliente" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_picking_make_lines_line__qty_delivered -msgid "Delivered" -msgstr "Enviado" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_line__display_name -#: model:ir.model.fields,field_description:rma.field_rma_make_rtv__display_name -#: model:ir.model.fields,field_description:rma.field_rma_make_rtv_line__display_name -#: model:ir.model.fields,field_description:rma.field_rma_picking_make_lines__display_name -#: model:ir.model.fields,field_description:rma.field_rma_picking_make_lines_line__display_name -#: model:ir.model.fields,field_description:rma.field_rma_rma__display_name -#: model:ir.model.fields,field_description:rma.field_rma_tag__display_name -#: model:ir.model.fields,field_description:rma.field_rma_template__display_name -msgid "Display Name" -msgstr "Nombre para Mostrar" - -#. module: rma -#: code:addons/rma/controllers/portal.py:0 -#: model:ir.model.fields.selection,name:rma.selection__rma_rma__state__done -#: model_terms:ir.ui.view,arch_db:rma.view_rma_rma_form -#, python-format -msgid "Done" -msgstr "Finalizado" - -#. module: rma -#: model_terms:ir.ui.view,arch_db:rma.portal_my_rma_rma -msgid "Download Your Return Label" -msgstr "Descarga su etiqueta de retorno" - -#. module: rma -#: code:addons/rma/controllers/portal.py:0 -#, python-format -msgid "Draft" -msgstr "Borrador" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_rma__validity_date -msgid "Expiration Date" -msgstr "Fecha de Expiración" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_template__valid_days -msgid "Expire in Days" -msgstr "Expira en días" - -#. module: rma -#: model:ir.model.fields.selection,name:rma.selection__rma_rma__state__expired -#: model_terms:ir.ui.view,arch_db:rma.view_rma_rma_search -msgid "Expired" -msgstr "Expirado" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_rma__message_follower_ids -msgid "Followers" -msgstr "Seguidores" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_rma__message_partner_ids -msgid "Followers (Partners)" -msgstr "Seguidores (Socios)" - -#. module: rma -#: model:ir.model.fields,help:rma.field_rma_rma__activity_type_icon -msgid "Font awesome icon e.g. fa-tasks" -msgstr "Icono de Font Awesome ej. fa-tasks" - -#. module: rma -#: model_terms:ir.ui.view,arch_db:rma.view_rma_rma_form -msgid "Generate Label" -msgstr "Generar Etiqueta" - -#. module: rma -#: model_terms:ir.ui.view,arch_db:rma.view_rma_rma_search -msgid "Group By" -msgstr "Agrupar Por" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_rma__has_message -msgid "Has Message" -msgstr "Tiene Mensaje" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_line__id -#: model:ir.model.fields,field_description:rma.field_rma_make_rtv__id -#: model:ir.model.fields,field_description:rma.field_rma_make_rtv_line__id -#: model:ir.model.fields,field_description:rma.field_rma_picking_make_lines__id -#: model:ir.model.fields,field_description:rma.field_rma_picking_make_lines_line__id -#: model:ir.model.fields,field_description:rma.field_rma_rma__id -#: model:ir.model.fields,field_description:rma.field_rma_tag__id -#: model:ir.model.fields,field_description:rma.field_rma_template__id -msgid "ID" -msgstr "ID" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_rma__activity_exception_icon -msgid "Icon" -msgstr "Icono" - -#. module: rma -#: model:ir.model.fields,help:rma.field_rma_rma__activity_exception_icon -msgid "Icon to indicate an exception activity." -msgstr "Icono para indicar una actividad de excepción" - -#. module: rma -#: model:ir.model.fields,help:rma.field_rma_rma__message_needaction -#: model:ir.model.fields,help:rma.field_rma_rma__message_unread -msgid "If checked, new messages require your attention." -msgstr "Si es marcado, nuevos mensajes requiere atencion" - -#. module: rma -#: model:ir.model.fields,help:rma.field_rma_rma__message_has_error -#: model:ir.model.fields,help:rma.field_rma_rma__message_has_sms_error -msgid "If checked, some messages have a delivery error." -msgstr "Si es marcado, algunos mensajes tienen un error de envío" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_rma__initial_in_picking_carrier_id -msgid "In Delivery Method" -msgstr "En método de envío" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_rma__in_label_url -msgid "In Label Url" -msgstr "En la URL de la etiqueta" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_rma__in_picking_state -msgid "In Picking State" -msgstr "En estado de Picking" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_template__in_carrier_id -msgid "Inbound Carrier" -msgstr "Transportista Entrante" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_template__in_location_dest_id -msgid "Inbound Destination Location" -msgstr "Ubicación de Destino de Entrada" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_template__in_to_refund -msgid "Inbound Mark Refund" -msgstr "Marcar Devolución de Entrada" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_rma__in_picking_id -msgid "Inbound Picking" -msgstr "Picking de Entrada" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_template__in_type_id -msgid "Inbound Picking Type" -msgstr "Tipo de Picking de Entrada" - -#. module: rma -#: model_terms:ir.ui.view,arch_db:rma.view_rma_rma_form -msgid "Inbound Picking:" -msgstr "Picking de Entrada:" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_template__in_procure_method -msgid "Inbound Procurement Method" -msgstr "Método de Adquisición de Entrada" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_template__in_require_return -msgid "Inbound Require return of picking" -msgstr "Se requiere devolución del picking de entrada" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_template__in_location_id -msgid "Inbound Source Location" -msgstr "Ubicación de Origen de Entrada" - -#. module: rma -#: code:addons/rma/models/rma.py:0 -#, python-format -msgid "Inbound picking not complete or cancelled." -msgstr "El Picking de entrada no esta completo o esta cancelada" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_rma__description -#: model:ir.model.fields,field_description:rma.field_rma_template__description -#: model_terms:ir.ui.view,arch_db:rma.view_rma_rma_form -#: model_terms:ir.ui.view,arch_db:rma.view_rma_template_form -msgid "Internal Instructions" -msgstr "Instrucciones Internas" - -#. module: rma -#: code:addons/rma/models/rma.py:0 -#, python-format -msgid "Invalid quantity." -msgstr "Cantidad Inválida" - -#. module: rma -#: code:addons/rma/models/rma.py:0 -#, python-format -msgid "Invalid user for picking." -msgstr "Usuario inválido para Picking" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_template__invoice_done -msgid "Invoice on Completion" -msgstr "Factura cuando se Completa" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_rma__invoice_ids -#: model_terms:ir.ui.view,arch_db:rma.view_rma_rma_form -msgid "Invoices" -msgstr "Factura" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_rma__message_is_follower -msgid "Is Follower" -msgstr "Es un seguidor" - -#. module: rma -#: model:ir.model,name:rma.model_account_move -msgid "Journal Entry" -msgstr "Asiento contable" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_line____last_update -#: model:ir.model.fields,field_description:rma.field_rma_make_rtv____last_update -#: model:ir.model.fields,field_description:rma.field_rma_make_rtv_line____last_update -#: model:ir.model.fields,field_description:rma.field_rma_picking_make_lines____last_update -#: model:ir.model.fields,field_description:rma.field_rma_picking_make_lines_line____last_update -#: model:ir.model.fields,field_description:rma.field_rma_rma____last_update -#: model:ir.model.fields,field_description:rma.field_rma_tag____last_update -#: model:ir.model.fields,field_description:rma.field_rma_template____last_update -msgid "Last Modified on" -msgstr "Última Modificación el" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_line__write_uid -#: model:ir.model.fields,field_description:rma.field_rma_make_rtv__write_uid -#: model:ir.model.fields,field_description:rma.field_rma_make_rtv_line__write_uid -#: model:ir.model.fields,field_description:rma.field_rma_picking_make_lines__write_uid -#: model:ir.model.fields,field_description:rma.field_rma_picking_make_lines_line__write_uid -#: model:ir.model.fields,field_description:rma.field_rma_rma__write_uid -#: model:ir.model.fields,field_description:rma.field_rma_tag__write_uid -#: model:ir.model.fields,field_description:rma.field_rma_template__write_uid -msgid "Last Updated by" -msgstr "Última Actualización por" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_line__write_date -#: model:ir.model.fields,field_description:rma.field_rma_make_rtv__write_date -#: model:ir.model.fields,field_description:rma.field_rma_make_rtv_line__write_date -#: model:ir.model.fields,field_description:rma.field_rma_picking_make_lines__write_date -#: model:ir.model.fields,field_description:rma.field_rma_picking_make_lines_line__write_date -#: model:ir.model.fields,field_description:rma.field_rma_rma__write_date -#: model:ir.model.fields,field_description:rma.field_rma_tag__write_date -#: model:ir.model.fields,field_description:rma.field_rma_template__write_date -msgid "Last Updated on" -msgstr "Última Actualización el" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_make_rtv__rma_line_ids -#: model:ir.model.fields,field_description:rma.field_rma_picking_make_lines__line_ids -#: model:ir.model.fields,field_description:rma.field_rma_rma__lines -msgid "Lines" -msgstr "Líneas" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_rma__message_main_attachment_id -msgid "Main Attachment" -msgstr "Adjunto Principal" - -#. module: rma -#: model:ir.model,name:rma.model_rma_make_rtv -msgid "Make RTV Batch" -msgstr "Hacer Lote de RTV" - -#. module: rma -#: model:ir.model,name:rma.model_rma_make_rtv_line -msgid "Make RTV Batch RMA" -msgstr "Hacer Lote de RTV para el RMA" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_rma__message_has_error -msgid "Message Delivery error" -msgstr "Error de Mensaje de Envío" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_rma__message_ids -msgid "Messages" -msgstr "Mensajes" - -#. module: rma -#: code:addons/rma/models/rma.py:0 -#, python-format -msgid "Missing product quantity." -msgstr "Falta la cantidad de producto" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_rma__my_activity_date_deadline -msgid "My Activity Deadline" -msgstr "Fecha límite de mi actividad" - -#. module: rma -#: code:addons/rma/controllers/portal.py:0 -#: model:ir.model.fields,field_description:rma.field_rma_template__name -#, python-format -msgid "Name" -msgstr "Nombre" - -#. module: rma -#: code:addons/rma/models/rma.py:0 code:addons/rma/models/rma.py:0 -#: code:addons/rma/models/rma.py:0 code:addons/rma/models/rma.py:0 -#: code:addons/rma/models/rma.py:0 -#: model:ir.model.fields.selection,name:rma.selection__rma_rma__state__draft -#: model_terms:ir.ui.view,arch_db:rma.view_rma_rma_search -#, python-format -msgid "New" -msgstr "Nuevo" - -#. module: rma -#: model_terms:ir.ui.view,arch_db:rma.portal_my_home_menu_rma -msgid "New \"" -msgstr "Nuevo \" - -#. module: rma -#: code:addons/rma/controllers/portal.py:0 -#, python-format -msgid "Newest" -msgstr "Más Actual" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_rma__activity_calendar_event_id -msgid "Next Activity Calendar Event" -msgstr "Próximo evento del calendario de actividades" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_rma__activity_date_deadline -msgid "Next Activity Deadline" -msgstr "Próximo Fecha Límite Actividad" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_rma__activity_summary -msgid "Next Activity Summary" -msgstr "Próximo resumen de actividad" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_rma__activity_type_id -msgid "Next Activity Type" -msgstr "Próximo tipo de actividad" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_template__next_rma_template_id -msgid "Next RMA Template" -msgstr "Próxima plantilla de RMA" - -#. module: rma -#: model_terms:ir.ui.view,arch_db:rma.portal_new_stock_picking -msgid "No Transfers to choose from." -msgstr "No hay transferencias de donde elegir" - -#. module: rma -#: code:addons/rma/controllers/portal.py:0 -#, python-format -msgid "None" -msgstr "Ninguna" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_rma__name -msgid "Number" -msgstr "Número" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_rma__message_needaction_counter -msgid "Number of Actions" -msgstr "Número de Acciones" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_rma__stock_picking_rma_count -msgid "Number of RMAs for this Picking" -msgstr "Número de RMAs para este Picking" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_rma__message_has_error_counter -msgid "Number of errors" -msgstr "Número de errores" - -#. module: rma -#: model:ir.model.fields,help:rma.field_rma_rma__message_needaction_counter -msgid "Number of messages which requires an action" -msgstr "Número de mensajes que requieren una acción" - -#. module: rma -#: model:ir.model.fields,help:rma.field_rma_rma__message_has_error_counter -msgid "Number of messages with delivery error" -msgstr "Número de mensajes con un error de envío" - -#. module: rma -#: model:ir.model.fields,help:rma.field_rma_rma__message_unread_counter -msgid "Number of unread messages" -msgstr "Número de mensajes no leídos" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_picking_make_lines_line__qty_ordered -msgid "Ordered" -msgstr "Ordenado" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_rma__initial_out_picking_carrier_id -msgid "Out Delivery Method" -msgstr "Método de Envío de Salida" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_rma__out_picking_state -msgid "Out Picking State" -msgstr "Estado de Picking de Salida" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_template__out_carrier_id -msgid "Outbound Carrier" -msgstr "Transportista de Salida" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_template__out_location_dest_id -msgid "Outbound Destination Location" -msgstr "Ubicación de Destino de Salida" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_template__out_to_refund -msgid "Outbound Mark Refund" -msgstr "Marcar Devolución de Salida" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_rma__out_picking_id -msgid "Outbound Picking" -msgstr "Picking de Salida" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_template__out_type_id -msgid "Outbound Picking Type" -msgstr "Tipo de Picking de Salida" - -#. module: rma -#: model_terms:ir.ui.view,arch_db:rma.view_rma_rma_form -msgid "Outbound Picking:" -msgstr "Picking de Salida" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_template__out_procure_method -msgid "Outbound Procurement Method" -msgstr "Método de Adquisicion de Salida" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_template__out_require_return -msgid "Outbound Require picking to duplicate" -msgstr "De Salida requiere Picking para duplicar" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_template__out_location_id -msgid "Outbound Source Location" -msgstr "Ubicación de Origen de Salida" - -#. module: rma -#: code:addons/rma/models/rma.py:0 -#, python-format -msgid "Outbound picking not complete or cancelled." -msgstr "Picking de Salida no se ha completado o se esta cancelada" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_rma__parent_id -msgid "Parent" -msgstr "Padre" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_rma__partner_id -msgid "Partner" -msgstr "Socio" - -#. module: rma -#: model_terms:ir.ui.view,arch_db:rma.view_rma_rma_form -msgid "Pick RMAs" -msgstr "Seleccionar RMAs" - -#. module: rma -#: code:addons/rma/models/rma.py:0 -#, python-format -msgid "Picking RMAs" -msgstr "RMAs de Picking" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_rma__access_url -msgid "Portal Access URL" -msgstr "URL de Acceso del Portal" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_line__product_id -#: model:ir.model.fields,field_description:rma.field_rma_picking_make_lines_line__product_id -msgid "Product" -msgstr "Producto" - -#. module: rma -#: model_terms:ir.ui.view,arch_db:rma.portal_my_rma_rma -#: model_terms:ir.ui.view,arch_db:rma.portal_new_stock_picking -msgid "Product Image" -msgstr "Imagen del Producto" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_line__product_uom_qty -#: model:ir.model.fields,field_description:rma.field_rma_picking_make_lines_line__product_uom_qty -msgid "QTY" -msgstr "Cantidad" - -#. module: rma -#: model:ir.actions.act_window,name:rma.action_rma_rma -#: model:ir.model,name:rma.model_rma_rma -#: model:ir.model.fields,field_description:rma.field_rma_line__rma_id -#: model:ir.model.fields,field_description:rma.field_rma_picking_make_lines__rma_id -#: model:ir.ui.menu,name:rma.menu_rma model:ir.ui.menu,name:rma.menu_rma_rmas -#: model_terms:ir.ui.view,arch_db:rma.portal_my_home_menu_rma -#: model_terms:ir.ui.view,arch_db:rma.portal_my_home_rma -#: model_terms:ir.ui.view,arch_db:rma.portal_my_rma -#: model_terms:ir.ui.view,arch_db:rma.view_rma_rma_form -msgid "RMA" -msgstr "RMA" - -#. module: rma -#: model_terms:ir.ui.view,arch_db:rma.portal_my_rma -msgid "RMA #" -msgstr "# de RMA" - -#. module: rma -#: model:ir.actions.server,name:rma.rma_expire_ir_actions_server -#: model:ir.cron,cron_name:rma.rma_expire model:ir.cron,name:rma.rma_expire -msgid "RMA Expiration" -msgstr "Expiración de RMA" - -#. module: rma -#: model:ir.model,name:rma.model_rma_line -msgid "RMA Line" -msgstr "Línea de RMA" - -#. module: rma -#: model_terms:ir.ui.view,arch_db:rma.view_rma_rma_form -msgid "RMA Lines" -msgstr ":Líneas de RMA" - -#. module: rma -#: model:ir.model,name:rma.model_rma_picking_make_lines_line -msgid "RMA Picking Make Lines Line" -msgstr "Picking de RMA Hace Líneas Línea" - -#. module: rma -#: model:ir.actions.act_window,name:rma.action_rma_tag_form -#: model:ir.model,name:rma.model_rma_tag -msgid "RMA Tag" -msgstr "Etiqueta de RMA" - -#. module: rma -#: model:ir.model,name:rma.model_rma_template -#: model_terms:ir.ui.view,arch_db:rma.view_rma_template_form -msgid "RMA Template" -msgstr "Plantilla del RMA" - -#. module: rma -#: model:ir.actions.act_window,name:rma.action_rma_template_form -msgid "RMA Templates" -msgstr "Plantillas de RMA" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_account_bank_statement_line__rma_ids -#: model:ir.model.fields,field_description:rma.field_account_move__rma_ids -#: model:ir.model.fields,field_description:rma.field_account_payment__rma_ids -#: model_terms:ir.ui.view,arch_db:rma.view_move_form_rma -msgid "RMAs" -msgstr "RMAs" - -#. module: rma -#: model:ir.model.fields,help:rma.field_rma_template__automatic_expire -msgid "" -"RMAs with this template will automatically expire when past their expiration" -" date." -msgstr "" -"RMAs con esta plantilla, expirarán automáticamente cuando pasen su fecha de" -" expiración." - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_rma__activity_user_id -msgid "Responsible User" -msgstr "Usuario Responsable" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_template__responsible_user_ids -msgid "Responsible Users" -msgstr "Usuarios Responsables" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_make_rtv_line__rma_id -msgid "Rma" -msgstr "RMA" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_picking_make_lines_line__rma_make_lines_id -msgid "Rma Make Lines" -msgstr "RMA hace líneas" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_make_rtv_line__rma_make_rtv_id -msgid "Rma Make Rtv" -msgstr "RMA hace RTV" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_rma__message_has_sms_error -msgid "SMS Delivery error" -msgstr "Error de Envío de SMS" - -#. module: rma -#: model_terms:ir.ui.view,arch_db:rma.view_rma_rma_search -msgid "Search RMA" -msgstr "Buscar RMA" - -#. module: rma -#: code:addons/rma/controllers/portal.py:0 -#, python-format -msgid "Search in All" -msgstr "Buscar en TODO" - -#. module: rma -#: code:addons/rma/controllers/portal.py:0 -#, python-format -msgid "Search in Name" -msgstr "Buscar en Nombre" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_rma__access_token -msgid "Security Token" -msgstr "Token de Seguridad" - -#. module: rma -#: model_terms:ir.ui.view,arch_db:rma.view_rma_rma_form -msgid "Set Draft" -msgstr "Establecer Borrador" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_rma__partner_shipping_id -msgid "Shipping" -msgstr "Envío" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_make_rtv__partner_shipping_id -msgid "Shipping Address" -msgstr "Dirección de Envío" - -#. module: rma -#: code:addons/rma/controllers/portal.py:0 -#: model:ir.model.fields,field_description:rma.field_rma_make_rtv_line__rma_state -#: model:ir.model.fields,field_description:rma.field_rma_rma__state -#: model_terms:ir.ui.view,arch_db:rma.view_rma_rma_search -#, python-format -msgid "State" -msgstr "Estado" - -#. module: rma -#: model:ir.model.fields,help:rma.field_rma_rma__activity_state -msgid "" -"Status based on activities\n" -"Overdue: Due date is already passed\n" -"Today: Activity date is today\n" -"Planned: Future activities." -msgstr "" -"Estado basado en las actividades\n" -"Atrasado: Se ha pasado la fecha de entrega\n" -"Hoy: Actividades para hoy\n" -"Programada: Actividades en el futuro." - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_rma__stock_picking_id -#: model:ir.model.fields.selection,name:rma.selection__rma_template__usage__stock_picking -msgid "Stock Picking" -msgstr "Stock Picking" - -#. module: rma -#: model_terms:ir.ui.view,arch_db:rma.portal_my_rma_rma -msgid "Submitted -" -msgstr "Emitida -" - -#. module: rma -#: model_terms:ir.ui.view,arch_db:rma.portal_my_rma -msgid "Submitted Date" -msgstr "Fecha Emitida" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_tag__name -msgid "Tag Name" -msgstr "Nombre de la etiqueta" - -#. module: rma -#: model:ir.model.constraint,message:rma.constraint_rma_tag_name_uniq -msgid "Tag name already exists !" -msgstr "¡Este nombre de etiqueta ya existe!" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_rma__tag_ids -#: model:ir.ui.menu,name:rma.menu_rma_configuation_rma_tag_form -#: model_terms:ir.ui.view,arch_db:rma.view_rma_rma_form -msgid "Tags" -msgstr "Etiquetas" - -#. module: rma -#: model:ir.model.fields.selection,name:rma.selection__rma_template__in_procure_method__make_to_stock -#: model:ir.model.fields.selection,name:rma.selection__rma_template__out_procure_method__make_to_stock -msgid "Take from Stock" -msgstr "Se tomo de Stock" - -#. module: rma -#: model_terms:ir.ui.view,arch_db:rma.view_rma_rma_search -msgid "Template" -msgstr "Plantilla" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_line__rma_template_usage -#: model:ir.model.fields,field_description:rma.field_rma_rma__template_usage -msgid "Template Usage" -msgstr "Uso de la Plantilla" - -#. module: rma -#: model:ir.ui.menu,name:rma.menu_rma_configuation_rma_template_form -msgid "Templates" -msgstr "Plantillas" - -#. module: rma -#: model_terms:ir.ui.view,arch_db:rma.portal_my_rma -msgid "There are currently no RMAs for your account." -msgstr "No hay RMAs para su cuenta actualmente" - -#. module: rma -#: model_terms:ir.ui.view,arch_db:rma.view_rma_template_form -msgid "" -"This feature is implemented in specific RMA types automatically when " -"enabled." -msgstr "" -"Esta característica se implementa en tipos específicos de RMA " -"automáticamente cuando está habilitada" - -#. module: rma -#: model_terms:ir.ui.view,arch_db:rma.view_rma_rma_form -msgid "Tracking" -msgstr "Seguimiento" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_rma__in_carrier_tracking_ref -#: model:ir.model.fields,field_description:rma.field_rma_rma__out_carrier_tracking_ref -msgid "Tracking Reference" -msgstr "Referencia de Seguimiento" - -#. module: rma -#: model:ir.model,name:rma.model_stock_picking -msgid "Transfer" -msgstr "Transferir" - -#. module: rma -#: code:addons/rma/controllers/portal.py:0 -#: model:ir.model.fields,field_description:rma.field_rma_rma__template_id -#, python-format -msgid "Type" -msgstr "Tipo" - -#. module: rma -#: model:ir.model.fields,help:rma.field_rma_rma__activity_exception_decoration -msgid "Type of the exception activity on record." -msgstr "Tipo de la excepción de la actividad en el registro" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_line__product_uom_id -#: model:ir.model.fields,field_description:rma.field_rma_picking_make_lines_line__product_uom_id -msgid "UOM" -msgstr "Unidad de Medida" - -#. module: rma -#: code:addons/rma/controllers/portal.py:0 -#, python-format -msgid "Unknown filter option." -msgstr "Opción de Filtro Desconocida" - -#. module: rma -#: code:addons/rma/controllers/portal.py:0 -#, python-format -msgid "Unknown sorting option." -msgstr "Opcion de Ordenación Desconocida" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_rma__message_unread -msgid "Unread Messages" -msgstr "Mensajes no Leídos" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_rma__message_unread_counter -msgid "Unread Messages Counter" -msgstr "Recuento de Mensajes no Leídos" - -#. module: rma -#: model:ir.model.fields,help:rma.field_rma_template__responsible_user_ids -msgid "Users that get activities when creating RMA." -msgstr "Usuario que reciben actividades cuando se crea un RMA" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_make_rtv__partner_id -msgid "Vendor" -msgstr "Vendedor" - -#. module: rma -#: model:ir.model.fields,field_description:rma.field_rma_rma__website_message_ids -msgid "Website Messages" -msgstr "Mensajes del Sitio Web" - -#. module: rma -#: model:ir.model.fields,help:rma.field_rma_rma__website_message_ids -msgid "Website communication history" -msgstr "Historia de Comunicación del Sitio Web" - -#. module: rma -#: code:addons/rma/models/rma.py:0 -#, python-format -msgid "You can not delete a non-draft RMA." -msgstr "No se puede eliminar un RMA que no sea un borrador" - -#. module: rma -#: code:addons/rma/models/rma.py:0 -#, python-format -msgid "You can only confirm RMAs with lines, and partner information." -msgstr "Solo se puede confirma un RMA con líneas, y informacion del socio" - -#. module: rma -#: code:addons/rma/models/rma.py:0 code:addons/rma/models/rma.py:0 -#, python-format -msgid "You have no lines with positive quantity." -msgstr "" - -#. module: rma -#: code:addons/rma/models/rma.py:0 code:addons/rma/models/rma.py:0 -#, python-format -msgid "You must have a completed stock picking for this RMA." -msgstr "Usted debe tener un Stock Picking completada para este RMA" diff --git a/rma/migrations/13.0.1.2.0/post-migration.py b/rma/migrations/13.0.1.2.0/post-migration.py deleted file mode 100644 index d00872a4..00000000 --- a/rma/migrations/13.0.1.2.0/post-migration.py +++ /dev/null @@ -1,11 +0,0 @@ -# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details. - -def migrate(cr, installed_version): - # Provide defaults for RMAs that were created before these fields existed. - cr.execute(''' -UPDATE rma_rma as r -SET initial_in_picking_carrier_id = t.in_carrier_id , - initial_out_picking_carrier_id = t.out_carrier_id -FROM rma_template as t -WHERE r.template_id = t.id - ''') diff --git a/rma/models/__init__.py b/rma/models/__init__.py deleted file mode 100644 index 4577f1ec..00000000 --- a/rma/models/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details. - -from . import account -from . import rma -from . import stock_picking diff --git a/rma/models/account.py b/rma/models/account.py deleted file mode 100644 index 53d634b6..00000000 --- a/rma/models/account.py +++ /dev/null @@ -1,13 +0,0 @@ -# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details. - -from odoo import fields, models - - -class AccountMove(models.Model): - _inherit = 'account.move' - - rma_ids = fields.Many2many('rma.rma', - 'rma_invoice_rel', - 'invoice_id', - 'rma_id', - string='RMAs') diff --git a/rma/models/rma.py b/rma/models/rma.py deleted file mode 100644 index 8da4dc98..00000000 --- a/rma/models/rma.py +++ /dev/null @@ -1,683 +0,0 @@ -# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details. - -from odoo import api, fields, models, _ -from odoo.exceptions import UserError, ValidationError -from ..controllers.main import create_hmac -from datetime import timedelta, datetime -from time import mktime - - -class RMATemplate(models.Model): - _name = 'rma.template' - _description = 'RMA Template' - - name = fields.Char(string='Name') - usage = fields.Selection([ - ('stock_picking', 'Stock Picking'), - ], string='Applies To') - description = fields.Html(string='Internal Instructions') - customer_description = fields.Html(string='Customer Instructions') - valid_days = fields.Integer(string='Expire in Days') - automatic_expire = fields.Boolean('Automatic Expire', - help='RMAs with this template will automatically ' - 'expire when past their expiration date.') - invoice_done = fields.Boolean(string='Invoice on Completion') - - create_in_picking = fields.Boolean(string='Create Inbound Picking') - create_out_picking = fields.Boolean(string='Create Outbound Picking') - - in_type_id = fields.Many2one('stock.picking.type', string='Inbound Picking Type') - out_type_id = fields.Many2one('stock.picking.type', string='Outbound Picking Type') - - in_location_id = fields.Many2one('stock.location', string='Inbound Source Location') - in_location_dest_id = fields.Many2one('stock.location', string='Inbound Destination Location') - in_carrier_id = fields.Many2one('delivery.carrier', string='Inbound Carrier') - in_require_return = fields.Boolean(string='Inbound Require return of picking') - in_procure_method = fields.Selection([ - ('make_to_stock', 'Take from Stock'), - ('make_to_order', 'Apply Procurements') - ], string="Inbound Procurement Method", default='make_to_stock') - in_to_refund = fields.Boolean(string='Inbound Mark Refund') - - out_location_id = fields.Many2one('stock.location', string='Outbound Source Location') - out_location_dest_id = fields.Many2one('stock.location', string='Outbound Destination Location') - out_carrier_id = fields.Many2one('delivery.carrier', string='Outbound Carrier') - out_require_return = fields.Boolean(string='Outbound Require picking to duplicate') - out_procure_method = fields.Selection([ - ('make_to_stock', 'Take from Stock'), - ('make_to_order', 'Apply Procurements') - ], string="Outbound Procurement Method", default='make_to_stock') - out_to_refund = fields.Boolean(string='Outbound Mark Refund') - portal_ok = fields.Boolean(string='Allow on Portal') - company_id = fields.Many2one('res.company', 'Company') - responsible_user_ids = fields.Many2many('res.users', string='Responsible Users', - help='Users that get activities when creating RMA.') - next_rma_template_id = fields.Many2one('rma.template', string='Next RMA Template') - - def _portal_try_create(self, request_user, res_id, **kw): - if self.usage == 'stock_picking': - prefix = 'move_' - move_map = {int(key[len(prefix):]): float(kw[key]) for key in kw if key.find(prefix) == 0 and kw[key]} - if move_map: - picking = self.env['stock.picking'].browse(res_id) - if picking.partner_id != request_user.partner_id: - raise ValidationError(_('Invalid user for picking.')) - lines = [] - for move_id, qty in move_map.items(): - move = picking.move_lines.filtered(lambda l: l.id == move_id) - if move: - if not qty: - continue - if qty < 0.0 or move.quantity_done < qty: - raise ValidationError(_('Invalid quantity.')) - lines.append((0, 0, { - 'product_id': move.product_id.id, - 'product_uom_id': move.product_uom.id, - 'product_uom_qty': qty, - })) - if not lines: - raise ValidationError(_('Missing product quantity.')) - rma = self.env['rma.rma'].create({ - 'name': _('New'), - 'stock_picking_id': picking.id, - 'template_id': self.id, - 'partner_id': request_user.partner_id.id, - 'partner_shipping_id': request_user.partner_id.id, - 'lines': lines, - }) - return rma - - def _portal_template(self, res_id=None): - if self.usage == 'stock_picking': - return 'rma.portal_new_stock_picking' - - def _portal_values(self, request_user, res_id=None): - if self.usage == 'stock_picking': - picking = None - pickings = None - if res_id: - picking = self.env['stock.picking'].browse(res_id) - if picking.partner_id != request_user.partner_id: - picking = None - else: - pickings = self.env['stock.picking'].search([('partner_id', '=', request_user.partner_id.id)], limit=100) - return { - 'rma_template': self, - 'pickings': pickings, - 'picking': picking, - } - - def _values_for_in_picking(self, rma): - return { - 'origin': rma.name, - 'partner_id': rma.partner_shipping_id.id, - 'picking_type_id': self.in_type_id.id, - 'location_id': self.in_location_id.id, - 'location_dest_id': self.in_location_dest_id.id, - 'carrier_id': rma.initial_in_picking_carrier_id.id, - 'move_lines': [(0, None, { - 'name': rma.name + ' IN: ' + l.product_id.name_get()[0][1], - 'product_id': l.product_id.id, - 'product_uom_qty': l.product_uom_qty, - 'product_uom': l.product_uom_id.id, - 'procure_method': self.in_procure_method, - 'to_refund': self.in_to_refund, - 'location_id': self.in_location_id.id, - 'location_dest_id': self.in_location_dest_id.id, - }) for l in rma.lines.filtered(lambda l: l.product_id.type != 'service')], - } - - def _values_for_out_picking(self, rma): - return { - 'origin': rma.name, - 'partner_id': rma.partner_shipping_id.id, - 'picking_type_id': self.out_type_id.id, - 'location_id': self.out_location_id.id, - 'location_dest_id': self.out_location_dest_id.id, - 'carrier_id': rma.initial_out_picking_carrier_id.id, - 'move_lines': [(0, None, { - 'name': rma.name + ' OUT: ' + l.product_id.name_get()[0][1], - 'product_id': l.product_id.id, - 'product_uom_qty': l.product_uom_qty, - 'product_uom': l.product_uom_id.id, - 'procure_method': self.out_procure_method, - 'to_refund': self.out_to_refund, - 'location_id': self.out_location_id.id, - 'location_dest_id': self.out_location_dest_id.id, - }) for l in rma.lines.filtered(lambda l: l.product_id.type != 'service')], - } - - def _schedule_responsible_activities(self, rma): - model_id = self.env['ir.model']._get(rma._name).id - activity_to_write = [] - for user in self.responsible_user_ids: - if rma.with_user(user).check_access_rights('read', raise_exception=False): - activity_to_write.append((0, 0, { - 'res_id': rma.id, - 'res_model_id': model_id, - 'summary': 'Review New RMA', - 'activity_type_id': False, - 'user_id': user.id, - })) - if activity_to_write: - rma.write({ - 'activity_ids': activity_to_write, - }) - - def _rma_expire(self): - templates = self.sudo().search([('automatic_expire', '=', True)]) - if not templates: - return True - rmas = self.env['rma.rma'].sudo().search([ - ('template_id', 'in', templates.ids), - ('state', 'in', ('draft', 'confirmed',)), - ('validity_date', '<', fields.Datetime.now()) - ]) - if rmas: - return rmas._action_expire() - return True - - -class RMATag(models.Model): - _name = "rma.tag" - _description = "RMA Tag" - - name = fields.Char('Tag Name', required=True) - color = fields.Integer('Color Index') - - _sql_constraints = [ - ('name_uniq', 'unique (name)', "Tag name already exists !"), - ] - - -class RMA(models.Model): - _name = 'rma.rma' - _inherit = ['portal.mixin', 'mail.thread', 'mail.activity.mixin'] - _description = 'RMA' - _order = 'id desc' - _mail_post_access = 'read' - - name = fields.Char(string='Number', copy=False) - state = fields.Selection([ - ('draft', 'New'), - ('confirmed', 'Confirmed'), - ('done', 'Done'), - ('expired', 'Expired'), - ('cancel', 'Cancelled'), - ], string='State', default='draft', copy=False) - company_id = fields.Many2one('res.company', 'Company') - parent_id = fields.Many2one('rma.rma') - template_id = fields.Many2one('rma.template', string='Type', required=True) - template_create_in_picking = fields.Boolean(related='template_id.create_in_picking') - template_create_out_picking = fields.Boolean(related='template_id.create_out_picking') - - stock_picking_id = fields.Many2one('stock.picking', string='Stock Picking') - stock_picking_rma_count = fields.Integer('Number of RMAs for this Picking', compute='_compute_stock_picking_rma_count') - partner_id = fields.Many2one('res.partner', string='Partner') - partner_shipping_id = fields.Many2one('res.partner', string='Shipping') - lines = fields.One2many('rma.line', 'rma_id', string='Lines') - tag_ids = fields.Many2many('rma.tag', 'rma_tags_rel', 'rma_id', 'tag_id', string='Tags') - description = fields.Html(string='Internal Instructions', related='template_id.description') - customer_description = fields.Html(string='Customer Instructions', related='template_id.customer_description') - template_usage = fields.Selection(string='Template Usage', related='template_id.usage') - validity_date = fields.Datetime(string='Expiration Date') - claim_number = fields.Char(string='Claim Number') - invoice_ids = fields.Many2many('account.move', - 'rma_invoice_rel', - 'rma_id', - 'invoice_id', - string='Invoices') - - initial_in_picking_carrier_id = fields.Many2one('delivery.carrier', string='In Delivery Method') - initial_out_picking_carrier_id = fields.Many2one('delivery.carrier', string='Out Delivery Method') - - in_picking_id = fields.Many2one('stock.picking', string='Inbound Picking', copy=False) - out_picking_id = fields.Many2one('stock.picking', string='Outbound Picking', copy=False) - - in_picking_state = fields.Selection(string='In Picking State', related='in_picking_id.state') - out_picking_state = fields.Selection(string='Out Picking State', related='out_picking_id.state') - - in_picking_carrier_id = fields.Many2one('delivery.carrier', related='in_picking_id.carrier_id', readonly=False) - out_picking_carrier_id = fields.Many2one('delivery.carrier', related='out_picking_id.carrier_id', readonly=False) - - in_carrier_tracking_ref = fields.Char(related='in_picking_id.carrier_tracking_ref') - in_label_url = fields.Char(compute='_compute_in_label_url') - out_carrier_tracking_ref = fields.Char(related='out_picking_id.carrier_tracking_ref') - - - def _compute_access_url(self): - super(RMA, self)._compute_access_url() - for rma in self: - rma.access_url = '/my/rma/%s' % (rma.id) - - @api.onchange('template_id') - def _onchange_template_id(self): - for rma in self: - rma.initial_in_picking_carrier_id = rma.template_id.in_carrier_id - rma.initial_out_picking_carrier_id = rma.template_id.out_carrier_id - - @api.onchange('template_usage') - def _onchange_template_usage(self): - now = datetime.now() - for rma in self: - if rma.template_id.valid_days: - rma.validity_date = now + timedelta(days=rma.template_id.valid_days) - if rma.template_usage != 'stock_picking': - rma.stock_picking_id = False - - @api.onchange('stock_picking_id') - def _onchange_stock_picking_id(self): - for rma in self.filtered(lambda rma: rma.stock_picking_id): - rma.partner_id = rma.stock_picking_id.partner_id - rma.partner_shipping_id = rma.stock_picking_id.partner_id - - @api.onchange('in_carrier_tracking_ref', 'validity_date') - def _compute_in_label_url(self): - config = self.env['ir.config_parameter'].sudo() - secret = config.search([('key', '=', 'database.secret')], limit=1) - secret = str(secret.value) if secret else '' - base_url = config.search([('key', '=', 'web.base.url')], limit=1) - base_url = str(base_url.value) if base_url else '' - for rma in self: - if not rma.in_picking_id: - rma.in_label_url = '' - continue - if rma.validity_date: - e_expires = int(mktime(fields.Datetime.from_string(rma.validity_date).timetuple())) - else: - year = datetime.now() + timedelta(days=365) - e_expires = int(mktime(year.timetuple())) - attachment = self.env['ir.attachment'].search([ - ('res_model', '=', 'stock.picking'), - ('res_id', '=', rma.in_picking_id.id), - ('name', 'like', 'Label%')], limit=1) - if not attachment: - rma.in_label_url = '' - continue - rma.in_label_url = base_url + '/rma_label?a=' + \ - str(attachment.id) + '&e=' + str(e_expires) + \ - '&h=' + create_hmac(secret, attachment.id, e_expires) - - @api.depends('stock_picking_id') - def _compute_stock_picking_rma_count(self): - for rma in self: - if rma.stock_picking_id: - rma_data = self.read_group([('stock_picking_id', '=', rma.stock_picking_id.id), ('state', '!=', 'cancel')], - ['stock_picking_id'], ['stock_picking_id']) - if rma_data: - rma.stock_picking_rma_count = rma_data[0]['stock_picking_id_count'] - else: - rma.stock_picking_rma_count = 0.0 - else: - rma.stock_picking_rma_count = 0.0 - - def open_stock_picking_rmas(self): - return { - 'type': 'ir.actions.act_window', - 'name': _('Picking RMAs'), - 'res_model': 'rma.rma', - 'view_mode': 'tree,form', - 'context': {'search_default_stock_picking_id': self[0].stock_picking_id.id} - } - - def _action_expire(self): - pickings_to_cancel = self.env['stock.picking'] - rmas = self.filtered(lambda rma: rma.in_picking_state != 'done' and rma.out_picking_state != 'done') - pickings_to_cancel += rmas.filtered(lambda r: r.in_picking_id).mapped('in_picking_id') - pickings_to_cancel += rmas.filtered(lambda r: r.out_picking_id).mapped('out_picking_id') - pickings_to_cancel.action_cancel() - rmas.write({'state': 'expired'}) - return True - - @api.model - def create(self, vals): - if vals.get('name', _('New')) == _('New'): - if 'company_id' in vals: - self = self.with_company(vals['company_id']) - vals['name'] = self.env['ir.sequence'].next_by_code('rma.rma') or _('New') - - # Provide defaults on create (e.g. from portal) - if vals.get('template_id'): - template = self.env['rma.template'].browse(vals.get('template_id')) - if 'initial_in_picking_carrier_id' not in vals: - vals['initial_in_picking_carrier_id'] = template.in_carrier_id.id - if 'initial_out_picking_carrier_id' not in vals: - vals['initial_out_picking_carrier_id'] = template.out_carrier_id.id - if template.valid_days and 'validity_date' not in vals: - now = datetime.now() - vals['validity_date'] = now + timedelta(days=template.valid_days) - - result = super(RMA, self).create(vals) - result.template_id._schedule_responsible_activities(result) - return result - - def action_confirm(self): - for rma in self: - in_picking_id = False - out_picking_id = False - if any((not rma.template_id, not rma.lines, not rma.partner_id, not rma.partner_shipping_id)): - raise UserError(_('You can only confirm RMAs with lines, and partner information.')) - if rma.template_id.create_in_picking: - in_picking_id = rma._create_in_picking() - if in_picking_id: - in_picking_id.action_confirm() - in_picking_id.action_assign() - if rma.template_id.create_out_picking: - out_picking_id = rma._create_out_picking() - if out_picking_id: - out_picking_id.action_confirm() - out_picking_id.action_assign() - rma.write({'state': 'confirmed', - 'in_picking_id': in_picking_id.id if in_picking_id else False, - 'out_picking_id': out_picking_id.id if out_picking_id else False}) - - def _next_rma_values(self): - return { - 'template_id': self.template_id.next_rma_template_id.id, - # Partners should be set when confirming or using the RTV wizard - # 'partner_id': self.partner_id.id, - # 'partner_shipping_id': self.partner_shipping_id.id, - 'parent_id': self.id, - 'lines': [(0, 0, { - 'product_id': l.product_id.id, - 'product_uom_id': l.product_uom_id.id, - 'product_uom_qty': l.product_uom_qty, - }) for l in self.lines] - } - - def _next_rma(self): - if self.template_id.next_rma_template_id: - # currently we do not want to automatically confirm them - # this is because we want to mass confirm and set picking to one partner/vendor - _ = self.create(self._next_rma_values()) - - def action_done(self): - for rma in self: - if rma.in_picking_id and rma.in_picking_id.state not in ('done', 'cancel'): - raise UserError(_('Inbound picking not complete or cancelled.')) - if rma.out_picking_id and rma.out_picking_id.state not in ('done', 'cancel'): - raise UserError(_('Outbound picking not complete or cancelled.')) - self.write({'state': 'done'}) - self._done_invoice() - self._next_rma() - - def _done_invoice(self): - for rma in self.filtered(lambda r: r.template_id.invoice_done): - # If you do NOT want to take part in the default invoicing functionality - # then your usage method (e.g. _invoice_values_sale_order) should be - # defined, and return nothing or extend _invoice_values to do the same - usage = rma.template_usage or '' - if hasattr(rma, '_invoice_values_' + usage): - values = getattr(rma, '_invoice_values_' + usage)() - else: - values = rma._invoice_values() - if values: - if hasattr(rma, '_invoice_' + usage): - getattr(rma, '_invoice_' + usage)(values) - else: - rma._invoice(values) - - def _invoice(self, invoice_values): - self.invoice_ids += self.env['account.move'].with_context(default_move_type=invoice_values['move_type']).create( - invoice_values) - - def _invoice_values(self): - self.ensure_one() - # special case for vendor return - supplier = self._context.get('rma_supplier') - if supplier is None and self.out_picking_id and self.out_picking_id.location_dest_id.usage == 'supplier': - supplier = True - - fiscal_position_id = self.env['account.fiscal.position'].get_fiscal_position( - self.partner_id.id, delivery_id=self.partner_shipping_id.id) - - invoice_values = { - 'move_type': 'in_refund' if supplier else 'out_refund', - 'partner_id': self.partner_id.id, - 'fiscal_position_id': fiscal_position_id, - } - - line_commands = [] - for rma_line in self.lines: - product = rma_line.product_id - accounts = product.product_tmpl_id.get_product_accounts() - account = accounts['expense'] if supplier else accounts['income'] - qty = rma_line.product_uom_qty - uom = rma_line.product_uom_id - price = product.standard_price if supplier else product.lst_price - if uom != product.uom_id: - price = product.uom_id._compute_price(price, uom) - line_commands.append((0, 0, { - 'product_id': product.id, - 'product_uom_id': uom.id, - 'name': product.name, - 'price_unit': price, - 'quantity': qty, - 'account_id': account.id, - 'tax_ids': [(6, 0, product.taxes_id.ids)], - })) - if line_commands: - invoice_values['invoice_line_ids'] = line_commands - return invoice_values - - def action_cancel(self): - for rma in self: - rma.in_picking_id.action_cancel() - rma.out_picking_id.action_cancel() - self.write({'state': 'cancel'}) - - def action_draft(self): - self.filtered(lambda l: l.state in ('cancel', 'expired')).write({ - 'state': 'draft', 'in_picking_id': False, 'out_picking_id': False}) - - def _create_in_picking(self): - if self._context.get('rma_in_picking_id'): - # allow passing/setting by context to allow many RMA's to include the same pickings - return self.env['stock.picking'].browse(self._context.get('rma_in_picking_id')) - if self.template_usage and hasattr(self, '_create_in_picking_' + self.template_usage): - return getattr(self, '_create_in_picking_' + self.template_usage)() - values = self.template_id._values_for_in_picking(self) - return self.env['stock.picking'].sudo().create(values) - - def _create_out_picking(self): - if self._context.get('rma_out_picking_id'): - # allow passing/setting by context to allow many RMA's to include the same pickings - return self.env['stock.picking'].browse(self._context.get('rma_out_picking_id')) - if self.template_usage and hasattr(self, '_create_out_picking_' + self.template_usage): - return getattr(self, '_create_out_picking_' + self.template_usage)() - values = self.template_id._values_for_out_picking(self) - return self.env['stock.picking'].sudo().create(values) - - def _find_candidate_return_picking(self, product_ids, pickings, location_id): - done_pickings = pickings.filtered(lambda p: p.state == 'done' and p.location_dest_id.id == location_id) - for p in done_pickings: - p_product_ids = p.move_lines.filtered(lambda l: l.state == 'done').mapped('product_id.id') - if set(product_ids) & set(p_product_ids) == set(product_ids): - return p - return None - - def action_in_picking_send_to_shipper(self): - for rma in self: - if rma.in_picking_id and rma.in_picking_carrier_id: - rma.in_picking_id.send_to_shipper() - - def action_add_picking_lines(self): - make_line_obj = self.env['rma.picking.make.lines'] - for rma in self: - lines = make_line_obj.create({ - 'rma_id': rma.id, - }) - action = self.env['ir.actions.act_window']._for_xml_id('rma.action_rma_add_lines') - action['res_id'] = lines.id - return action - - def unlink(self): - for rma in self: - if rma.state not in ('draft'): - raise UserError(_('You can not delete a non-draft RMA.')) - return super(RMA, self).unlink() - - def _picking_from_values(self, values, values_update, move_line_values_update): - values.update(values_update) - move_lines = [] - for l1, l2, vals in values['move_lines']: - vals.update(move_line_values_update) - move_lines.append((l1, l2, vals)) - values['move_lines'] = move_lines - return self.env['stock.picking'].sudo().create(values) - - def _new_in_picking(self, old_picking): - new_picking = old_picking.copy({ - 'move_lines': [], - 'picking_type_id': self.template_id.in_type_id.id, - 'state': 'draft', - 'origin': old_picking.name + ' ' + self.name, - 'location_id': self.template_id.in_location_id.id, - 'location_dest_id': self.template_id.in_location_dest_id.id, - 'carrier_id': self.initial_in_picking_carrier_id.id, - 'carrier_tracking_ref': False, - 'carrier_price': False - }) - new_picking.message_post_with_view('mail.message_origin_link', - values={'self': new_picking, 'origin': self}, - subtype_id=self.env.ref('mail.mt_note').id) - return new_picking - - def _new_in_move_vals(self, rma_line, new_picking, old_move): - return { - 'name': self.name + ' IN: ' + rma_line.product_id.name_get()[0][1], - 'product_id': rma_line.product_id.id, - 'product_uom_qty': rma_line.product_uom_qty, - 'product_uom': rma_line.product_uom_id.id, - 'picking_id': new_picking.id, - 'state': 'draft', - 'location_id': old_move.location_dest_id.id, - 'location_dest_id': self.template_id.in_location_dest_id.id, - 'picking_type_id': new_picking.picking_type_id.id, - 'warehouse_id': new_picking.picking_type_id.warehouse_id.id, - 'origin_returned_move_id': old_move.id, - 'procure_method': self.template_id.in_procure_method, - 'to_refund': self.template_id.in_to_refund, - } - - def _get_old_move(self, old_picking, line): - return old_picking.move_lines.filtered( - lambda ol: ol.state == 'done' and - ol.product_id == line.product_id - )[0] - - def _new_in_moves(self, old_picking, new_picking, move_update): - lines = self.lines.filtered(lambda l: l.product_uom_qty >= 1) - if not lines: - raise UserError(_('You have no lines with positive quantity.')) - - moves = self.env['stock.move'] - for l in lines: - return_move = self._get_old_move(old_picking, l) - copy_vals = self._new_in_move_vals(l, new_picking, return_move) - copy_vals.update(move_update) - r = return_move.copy(copy_vals) - vals = {} - # +--------------------------------------------------------------------------------------------------------+ - # | picking_pick <--Move Orig-- picking_pack --Move Dest--> picking_ship - # | | returned_move_ids ↑ | returned_move_ids - # | ↓ | return_line.move_id ↓ - # | return pick(Add as dest) return toLink return ship(Add as orig) - # +--------------------------------------------------------------------------------------------------------+ - move_orig_to_link = return_move.move_dest_ids.mapped('returned_move_ids') - move_dest_to_link = return_move.move_orig_ids.mapped('returned_move_ids') - vals['move_orig_ids'] = [(4, m.id) for m in move_orig_to_link | return_move] - vals['move_dest_ids'] = [(4, m.id) for m in move_dest_to_link] - r.write(vals) - moves += r - return moves - - def _new_out_picking(self, old_picking): - new_picking = old_picking.copy({ - 'move_lines': [], - 'picking_type_id': self.template_id.out_type_id.id, - 'state': 'draft', - 'origin': old_picking.name + ' ' + self.name, - 'location_id': self.template_id.out_location_id.id, - 'location_dest_id': self.template_id.out_location_dest_id.id, - 'carrier_id': self.initial_out_picking_carrier_id.id, - 'carrier_tracking_ref': False, - 'carrier_price': False - }) - new_picking.message_post_with_view('mail.message_origin_link', - values={'self': new_picking, 'origin': self}, - subtype_id=self.env.ref('mail.mt_note').id) - return new_picking - - def _new_out_move_vals(self, rma_line, new_picking, old_move): - return { - 'name': self.name + ' OUT: ' + rma_line.product_id.name_get()[0][1], - 'product_id': rma_line.product_id.id, - 'product_uom_qty': rma_line.product_uom_qty, - 'picking_id': new_picking.id, - 'state': 'draft', - 'location_id': self.template_id.out_location_id.id, - 'location_dest_id': self.template_id.out_location_dest_id.id, - 'picking_type_id': new_picking.picking_type_id.id, - 'warehouse_id': new_picking.picking_type_id.warehouse_id.id, - 'origin_returned_move_id': False, - 'procure_method': self.template_id.out_procure_method, - 'to_refund': self.template_id.out_to_refund, - } - - def _new_out_moves(self, old_picking, new_picking, move_update): - lines = self.lines.filtered(lambda l: l.product_uom_qty >= 1) - if not lines: - raise UserError(_('You have no lines with positive quantity.')) - moves = self.env['stock.move'] - for l in lines: - return_move = old_picking.move_lines.filtered(lambda ol: ol.state == 'done' and ol.product_id.id == l.product_id.id)[0] - copy_vals = self._new_out_move_vals(l, new_picking, return_move) - copy_vals.update(move_update) - moves += return_move.copy(copy_vals) - return moves - - def _create_in_picking_stock_picking(self): - if not self.stock_picking_id or self.stock_picking_id.state != 'done': - raise UserError(_('You must have a completed stock picking for this RMA.')) - if not self.template_id.in_require_return: - group_id = self.stock_picking_id.group_id.id if self.stock_picking_id.group_id else 0 - values = self.template_id._values_for_in_picking(self) - update = {'group_id': group_id} - return self._picking_from_values(values, update, update) - - old_picking = self.stock_picking_id - - new_picking = self._new_in_picking(old_picking) - self._new_in_moves(old_picking, new_picking, {}) - return new_picking - - def _create_out_picking_stock_picking(self): - if not self.stock_picking_id or self.stock_picking_id.state != 'done': - raise UserError(_('You must have a completed stock picking for this RMA.')) - if not self.template_id.out_require_return: - group_id = self.stock_picking_id.group_id.id if self.stock_picking_id.group_id else 0 - values = self.template_id._values_for_out_picking(self) - update = {'group_id': group_id} - return self._picking_from_values(values, update, update) - - old_picking = self.stock_picking_id - new_picking = self._new_out_picking(old_picking) - self._new_out_moves(old_picking, new_picking, {}) - return new_picking - - -class RMALine(models.Model): - _name = 'rma.line' - _description = 'RMA Line' - - rma_id = fields.Many2one('rma.rma', string='RMA') - product_id = fields.Many2one('product.product', 'Product') - product_uom_id = fields.Many2one('uom.uom', 'UOM') - product_uom_qty = fields.Float(string='QTY') - rma_template_usage = fields.Selection(related='rma_id.template_usage') - - @api.onchange('product_id') - def _onchange_product_id(self): - for line in self: - line.product_uom_id = line.product_id.uom_id diff --git a/rma/models/stock_picking.py b/rma/models/stock_picking.py deleted file mode 100644 index 0b31801d..00000000 --- a/rma/models/stock_picking.py +++ /dev/null @@ -1,26 +0,0 @@ -# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details. - -from odoo import api, models, _ - - -class StockPicking(models.Model): - _inherit = 'stock.picking' - - def send_to_shipper(self): - res = False - for pick in self.filtered(lambda p: not p.carrier_tracking_ref): - # deliver full order if no items are done. - pick_has_no_done = sum(pick.move_line_ids.mapped('qty_done')) == 0 - if pick_has_no_done: - pick._rma_complete() - res = super(StockPicking, pick).send_to_shipper() - if pick_has_no_done: - pick._rma_complete_reverse() - return res - - def _rma_complete(self): - for line in self.move_line_ids: - line.qty_done = line.product_uom_qty - - def _rma_complete_reverse(self): - self.move_line_ids.write({'qty_done': 0.0}) diff --git a/rma/security/ir.model.access.csv b/rma/security/ir.model.access.csv deleted file mode 100644 index f0289a2c..00000000 --- a/rma/security/ir.model.access.csv +++ /dev/null @@ -1,14 +0,0 @@ -"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" -"manage_rma_stock","manage_rma","model_rma_rma","stock.group_stock_user",1,1,1,1 -"manage_rma_line_stock","manage_rma_line","model_rma_line","stock.group_stock_user",1,1,1,1 -"manage_rma_template_stock","manage_rma_template","model_rma_template","stock.group_stock_manager",1,1,1,1 -"manage_rma_tag_stock","manage_rma_tag","model_rma_tag","stock.group_stock_manager",1,1,1,1 -"access_rma_template_stock","access_rma_template","model_rma_template","stock.group_stock_user",1,1,0,0 -"access_rma_tag_stock","access_rma_tag","model_rma_tag","stock.group_stock_user",1,0,0,0 -access_rma_portal,rma.rma.portal,rma.model_rma_rma,base.group_portal,1,0,0,0 -access_rma_line_portal,rma.line.portal,rma.model_rma_line,base.group_portal,1,0,0,0 -access_rma_template_portal,rma.template.portal,rma.model_rma_template,base.group_portal,1,0,0,0 -"access_rma_picking_make_lines","access rma.picking.make.lines","rma.model_rma_picking_make_lines","stock.group_stock_user",1,1,1,1 -"access_rma_picking_make_lines_line","access rma.picking.make.lines.line","rma.model_rma_picking_make_lines_line","stock.group_stock_user",1,1,1,1 -"access_rma_make_rtv","access rma.make.rtv","rma.model_rma_make_rtv","stock.group_stock_user",1,1,1,1 -"access_rma_make_rtv_line","access rma.make.rtv.line","rma.model_rma_make_rtv_line","stock.group_stock_user",1,1,1,1 diff --git a/rma/security/rma_security.xml b/rma/security/rma_security.xml deleted file mode 100644 index 77691a2d..00000000 --- a/rma/security/rma_security.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - RMA: RMA - - - ['|', - ('company_id', '=', False), - ('company_id', 'in', company_ids), - ] - - - - RMA: RMA Template - - - ['|', - ('company_id', '=', False), - ('company_id', 'in', company_ids), - ] - - - - - Portal Personal RMAs - - [('partner_id','child_of',[user.commercial_partner_id.id])] - - - - - - - - - Portal RMA Line - - [('rma_id.partner_id','child_of',[user.commercial_partner_id.id])] - - - - - - - - - diff --git a/rma/tests/__init__.py b/rma/tests/__init__.py deleted file mode 100644 index 586c5532..00000000 --- a/rma/tests/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details. - -from . import test_rma diff --git a/rma/tests/test_rma.py b/rma/tests/test_rma.py deleted file mode 100644 index 4c1d1230..00000000 --- a/rma/tests/test_rma.py +++ /dev/null @@ -1,309 +0,0 @@ -# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details. - -from odoo.tests import common -from odoo.exceptions import UserError, ValidationError -import logging - - -_logger = logging.getLogger(__name__) - - -class TestRMA(common.TransactionCase): - def setUp(self): - super(TestRMA, self).setUp() - self.product1 = self.env.ref('product.product_product_24') - self.product2 = self.env.ref('product.product_product_25') - self.template_missing = self.env.ref('rma.template_missing_item') - self.template_return = self.env.ref('rma.template_picking_return') - self.template_rtv = self.env.ref('rma.template_rtv') - self.partner1 = self.env.ref('base.res_partner_2') - self.user1 = self.env.ref('base.user_demo') - # Additional partner in tests or vendor in Return To Vendor - self.partner2 = self.env.ref('base.res_partner_12') - - def test_00_basic_rma(self): - self.template_missing.responsible_user_ids += self.user1 - self.template_missing.usage = False - rma = self.env['rma.rma'].create({ - 'template_id': self.template_missing.id, - 'partner_id': self.partner1.id, - 'partner_shipping_id': self.partner1.id, - }) - self.assertEqual(rma.state, 'draft') - self.assertTrue(rma.activity_ids) - self.assertEqual(rma.activity_ids.user_id, self.user1) - rma_line = self.env['rma.line'].create({ - 'rma_id': rma.id, - 'product_id': self.product1.id, - 'product_uom_id': self.product1.uom_id.id, - 'product_uom_qty': 2.0, - }) - rma.action_confirm() - # Should have made pickings - self.assertEqual(rma.state, 'confirmed') - # No inbound picking - self.assertFalse(rma.in_picking_id) - # Good outbound picking - self.assertTrue(rma.out_picking_id) - self.assertEqual(rma_line.product_id, rma.out_picking_id.move_lines.product_id) - self.assertEqual(rma_line.product_uom_qty, rma.out_picking_id.move_lines.product_uom_qty) - - with self.assertRaises(UserError): - rma.action_done() - - rma.out_picking_id.move_lines.quantity_done = 2.0 - rma.out_picking_id.button_validate() - rma.action_done() - self.assertEqual(rma.state, 'done') - - def test_10_rma_cancel(self): - self.template_missing.usage = False - rma = self.env['rma.rma'].create({ - 'template_id': self.template_missing.id, - 'partner_id': self.partner1.id, - 'partner_shipping_id': self.partner1.id, - }) - self.assertEqual(rma.state, 'draft') - rma_line = self.env['rma.line'].create({ - 'rma_id': rma.id, - 'product_id': self.product1.id, - 'product_uom_id': self.product1.uom_id.id, - 'product_uom_qty': 2.0, - }) - rma.action_confirm() - # Good outbound picking - self.assertEqual(rma.out_picking_id.move_lines.state, 'assigned') - rma.action_cancel() - self.assertEqual(rma.out_picking_id.move_lines.state, 'cancel') - - def test_20_picking_rma(self): - self.product1.type = 'product' - type_out = self.env.ref('stock.picking_type_out') - location = self.env.ref('stock.stock_location_stock') - location_customer = self.env.ref('stock.stock_location_customers') - - adjust_to_zero_quant = self.env['stock.quant'].with_context(inventory_mode=True).create({ - 'product_id': self.product1.id, - 'location_id': location.id, - 'inventory_quantity': 0.0 - }).action_apply_inventory() - - # No Quants after moving inventory out (quant exists with qty == 0 in Odoo 14) - quant = self.env['stock.quant'].search([('product_id', '=', self.product1.id), - ('location_id', '=', location.id), - ('quantity', '!=', 0)]) - self.assertEqual(len(quant), 0) - - # Adjust in a single serial - self.product1.tracking = 'serial' - - # Need to ensure this is the only quant that can be reserved for this move. - lot = self.env['stock.production.lot'].create({ - 'product_id': self.product1.id, - 'name': 'X1000', - 'product_uom_id': self.product1.uom_id.id, - 'company_id': self.env.user.company_id.id, - }) - - adjust_to_zero_quant = self.env['stock.quant'].with_context(inventory_mode=True).create({ - 'product_id': self.product1.id, - 'location_id': self.env.ref('stock.warehouse0').lot_stock_id.id, - 'inventory_quantity': 1.0, - 'lot_id': lot.id, - }).action_apply_inventory() - - self.assertEqual(self.product1.qty_available, 1.0) - self.assertTrue(lot.quant_ids) - # Test some internals in Odoo 12.0 - lot_internal_quants = lot.quant_ids.filtered(lambda q: q.location_id.usage in ['internal', 'transit']) - self.assertEqual(len(lot_internal_quants), 1) - self.assertEqual(lot_internal_quants.mapped('quantity'), [1.0]) - # Re-compute qty as it does not depend on anything. - lot._product_qty() - self.assertEqual(lot.product_qty, 1.0) - - # Create initial picking that will be returned by RMA - picking_out = self.env['stock.picking'].create({ - 'partner_id': self.partner1.id, - 'name': 'testpicking', - 'picking_type_id': type_out.id, - 'location_id': location.id, - 'location_dest_id': location_customer.id, - }) - self.env['stock.move'].create({ - 'name': self.product1.name, - 'product_id': self.product1.id, - 'product_uom_qty': 1.0, - 'product_uom': self.product1.uom_id.id, - 'picking_id': picking_out.id, - 'location_id': location.id, - 'location_dest_id': location_customer.id, - }) - picking_out.with_context(planned_picking=True).action_confirm() - - # Try to RMA item not delivered yet - rma = self.env['rma.rma'].create({ - 'template_id': self.template_return.id, - 'partner_id': self.partner1.id, - 'partner_shipping_id': self.partner1.id, - 'stock_picking_id': picking_out.id, - }) - self.assertEqual(rma.state, 'draft') - wizard = self.env['rma.picking.make.lines'].create({ - 'rma_id': rma.id, - }) - wizard.line_ids.product_uom_qty = 1.0 - wizard.add_lines() - self.assertEqual(len(rma.lines), 1) - - # Make sure that we cannot 'return' if we cannot 'reverse' a stock move - # (this is what `in_require_return` and `out_require_return` do on `rma.template`) - with self.assertRaises(UserError): - rma.action_confirm() - - # Finish our original picking - picking_out.action_assign() - self.assertEqual(picking_out.state, 'assigned') - - # The only lot should be reserved, so we shouldn't get an exception finishing the transfer. - picking_out.move_line_ids.write({ - 'qty_done': 1.0, - }) - picking_out.button_validate() - self.assertEqual(picking_out.state, 'done') - - # Now we can 'return' that picking - rma.action_confirm() - self.assertEqual(rma.in_picking_id.state, 'assigned') - pack_opt = rma.in_picking_id.move_line_ids[0] - self.assertTrue(pack_opt) - - # unlink the lot so that we can re-add it later - self.assertTrue(pack_opt.lot_id) - pack_opt.write({'lot_id': False}) - - # We cannot check this directly anymore. Instead just try to return the same lot and make sure you can. - # self.assertEqual(pack_opt.lot_id, lot) - - with self.assertRaises(UserError): - rma.action_done() - - pack_opt.qty_done = 1.0 - with self.assertRaises(UserError): - # require a lot - rma.in_picking_id.button_validate() - - pack_opt.lot_id = lot - rma.in_picking_id.button_validate() - rma.action_done() - - # Ensure that the same lot was in fact returned into our destination inventory - quant = self.env['stock.quant'].search([('product_id', '=', self.product1.id), - ('location_id', '=', location.id), - ('quantity', '!=', 0)]) - self.assertEqual(len(quant), 1) - self.assertEqual(quant.lot_id, lot) - - # Make another RMA for the same picking - rma2 = self.env['rma.rma'].create({ - 'template_id': self.template_return.id, - 'partner_id': self.partner1.id, - 'partner_shipping_id': self.partner1.id, - 'stock_picking_id': picking_out.id, - }) - wizard = self.env['rma.picking.make.lines'].create({ - 'rma_id': rma2.id, - }) - wizard.line_ids.product_uom_qty = 1.0 - wizard.add_lines() - self.assertEqual(len(rma2.lines), 1) - - rma2.action_confirm() - - # In Odoo 10, this would not have been able to reserve. - # In Odoo 11, reservation can still happen, but at least we can't move the same lot twice! - # self.assertEqual(rma2.in_picking_id.state, 'confirmed') - - # Requires Lot - with self.assertRaises(UserError): - rma2.in_picking_id.move_line_ids.write({'qty_done': 1.0}) - rma2.in_picking_id.button_validate() - - - self.assertTrue(rma2.in_picking_id.move_line_ids) - self.assertFalse(rma2.in_picking_id.move_line_ids.lot_id.name) - - # Assign existing lot - # TODO: Investigate - # rma2.in_picking_id.move_line_ids.write({ - # 'lot_id': lot.id - # }) - - # Existing lot cannot be re-used. - # TODO: Investigate - # It appears that in Odoo 13 You can move the lot again... - # with self.assertRaises(ValidationError): - # rma2.in_picking_id.action_done() - - # RMA cannot be completed because the inbound picking state is confirmed - with self.assertRaises(UserError): - rma2.action_done() - - def test_30_next_rma_rtv(self): - self.template_return.usage = False - self.template_return.in_require_return = False - self.template_return.next_rma_template_id = self.template_rtv - rma = self.env['rma.rma'].create({ - 'template_id': self.template_return.id, - 'partner_id': self.partner1.id, - 'partner_shipping_id': self.partner1.id, - }) - self.assertEqual(rma.state, 'draft') - rma_line = self.env['rma.line'].create({ - 'rma_id': rma.id, - 'product_id': self.product1.id, - 'product_uom_id': self.product1.uom_id.id, - 'product_uom_qty': 2.0, - }) - rma.action_confirm() - # Should have made pickings - self.assertEqual(rma.state, 'confirmed') - - # No outbound picking - self.assertFalse(rma.out_picking_id) - # Good inbound picking - self.assertTrue(rma.in_picking_id) - self.assertEqual(rma_line.product_id, rma.in_picking_id.move_lines.product_id) - self.assertEqual(rma_line.product_uom_qty, rma.in_picking_id.move_lines.product_uom_qty) - - with self.assertRaises(UserError): - rma.action_done() - - rma.in_picking_id.move_lines.quantity_done = 2.0 - rma.in_picking_id.button_validate() - rma.action_done() - self.assertEqual(rma.state, 'done') - - # RTV RMA - rma_rtv = self.env['rma.rma'].search([('parent_id', '=', rma.id)]) - self.assertTrue(rma_rtv) - self.assertEqual(rma_rtv.state, 'draft') - - wiz = self.env['rma.make.rtv'].with_context(active_model='rma.rma', active_ids=rma_rtv.ids).create({}) - self.assertTrue(wiz.rma_line_ids) - wiz.partner_id = self.partner2 - wiz.create_batch() - self.assertTrue(rma_rtv.out_picking_id) - self.assertEqual(rma_rtv.out_picking_id.partner_id, self.partner2) - self.assertEqual(rma_rtv.state, 'confirmed') - - # ship and finish - rma_rtv.out_picking_id.move_lines.quantity_done = 2.0 - rma_rtv.out_picking_id.button_validate() - rma_rtv.action_done() - self.assertEqual(rma_rtv.state, 'done') - - # ensure invoice and type - rtv_invoice = rma_rtv.invoice_ids - self.assertTrue(rtv_invoice) - self.assertEqual(rtv_invoice.move_type, 'in_refund') diff --git a/rma/views/account_views.xml b/rma/views/account_views.xml deleted file mode 100644 index 8bf1dfd5..00000000 --- a/rma/views/account_views.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - account.move.form.rma - account.move - - - - - - - - - - - \ No newline at end of file diff --git a/rma/views/portal_templates.xml b/rma/views/portal_templates.xml deleted file mode 100644 index 3ab631b1..00000000 --- a/rma/views/portal_templates.xml +++ /dev/null @@ -1,284 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/rma/views/rma_views.xml b/rma/views/rma_views.xml deleted file mode 100644 index 42ee959a..00000000 --- a/rma/views/rma_views.xml +++ /dev/null @@ -1,289 +0,0 @@ - - - - rma.rma.form - rma.rma - -
-
-
- -
- -
-
-

- -

-
- - - - - - - - -
-