mirror of
https://github.com/OCA/rma.git
synced 2025-02-16 17:11:47 +02:00
changes in the crm_rma module and made it 10.0 compatible
This commit is contained in:
committed by
Maxime Chambreuil
parent
f83e7896f8
commit
cb8ae2d63e
@@ -1,4 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# © 2017 Techspawn Solutions
|
||||
# © 2015 Vauxoo
|
||||
# © 2015 Eezee-It
|
||||
# © 2009-2013 Akretion
|
||||
@@ -10,6 +11,7 @@
|
||||
'category': 'Generic Modules/CRM & SRM',
|
||||
'author': "Akretion, Camptocamp, Eezee-it, MONK Software, Vauxoo, "
|
||||
"Odoo Community Association (OCA)",
|
||||
"Techspawn Solutions"
|
||||
'website': 'http://www.akretion.com, http://www.camptocamp.com, '
|
||||
'http://www.eezee-it.com, http://www.wearemonk.com, '
|
||||
'http://www.vauxoo.com',
|
||||
@@ -33,12 +35,12 @@
|
||||
"views/claim_line.xml",
|
||||
'views/res_partner.xml',
|
||||
'views/stock_view.xml',
|
||||
'security/ir.model.access.csv',
|
||||
#'security/ir.model.access.csv',
|
||||
],
|
||||
'demo': [],
|
||||
'test': [
|
||||
'test/test_invoice_refund.yml'
|
||||
],
|
||||
'installable': False,
|
||||
'installable': True,
|
||||
'auto_install': False,
|
||||
}
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# © 2017 Techspawn Solutions
|
||||
# © 2015 Eezee-It, MONK Software, Vauxoo
|
||||
# © 2013 Camptocamp
|
||||
# © 2009-2013 Akretion,
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from openerp import _, api, exceptions, fields, models
|
||||
from odoo import _, api, exceptions, fields, models
|
||||
|
||||
|
||||
class AccountInvoice(models.Model):
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# © 2017 Techspawn Solutions
|
||||
# © 2015 Vauxoo
|
||||
# © 2013 Camptocamp
|
||||
# © 2009-2013 Akretion,
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from openerp import api, models
|
||||
from odoo import api, models
|
||||
|
||||
|
||||
class AccountInvoiceLine(models.Model):
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# © 2017 Techspawn Solutions
|
||||
# © 2015 Vauxoo
|
||||
# © 2013 Camptocamp
|
||||
# © 2009-2013 Akretion,
|
||||
@@ -10,8 +11,8 @@ from datetime import datetime
|
||||
|
||||
from dateutil.relativedelta import relativedelta
|
||||
|
||||
from openerp import _, api, exceptions, fields, models
|
||||
from openerp.tools import (DEFAULT_SERVER_DATE_FORMAT,
|
||||
from odoo import _, api, exceptions, fields, models
|
||||
from odoo.tools import (DEFAULT_SERVER_DATE_FORMAT,
|
||||
DEFAULT_SERVER_DATETIME_FORMAT)
|
||||
|
||||
from .invoice_no_date import InvoiceNoDate
|
||||
@@ -58,14 +59,14 @@ class ClaimLine(models.Model):
|
||||
date = fields.Date('Claim Line Date',
|
||||
select=True,
|
||||
default=fields.date.today())
|
||||
name = fields.Char('Description', default='none', required=True,
|
||||
name = fields.Char('Description', default='none', required=False,
|
||||
help="More precise description of the problem")
|
||||
priority = fields.Selection([('0_not_define', 'Not Define'),
|
||||
('1_normal', 'Normal'),
|
||||
('2_high', 'High'),
|
||||
('3_very_high', 'Very High')],
|
||||
'Priority', default='0_not_define',
|
||||
compute='_compute_priority',
|
||||
#compute='_compute_priority',
|
||||
store=True,
|
||||
readonly=False,
|
||||
help="Priority attention of claim line")
|
||||
@@ -77,7 +78,7 @@ class ClaimLine(models.Model):
|
||||
],
|
||||
help="To describe the line product diagnosis")
|
||||
claim_origin = fields.Selection(SUBJECT_LIST, 'Claim Subject',
|
||||
required=True, help="To describe the "
|
||||
required=False, help="To describe the "
|
||||
"line product problem")
|
||||
product_id = fields.Many2one('product.product', string='Product',
|
||||
help="Returned product")
|
||||
@@ -115,20 +116,18 @@ class ClaimLine(models.Model):
|
||||
|
||||
@api.model
|
||||
def get_warranty_return_partner(self):
|
||||
return self.env['product.supplierinfo']._columns[
|
||||
'warranty_return_partner'
|
||||
].selection
|
||||
return self.env['product.supplierinfo'].warranty_return_partner
|
||||
|
||||
|
||||
warranty_type = fields.Selection(
|
||||
get_warranty_return_partner, readonly=True,
|
||||
get_warranty_return_partner,
|
||||
help="Who is in charge of the warranty return treatment towards "
|
||||
"the end customer. Company will use the current company "
|
||||
"delivery or default address and so on for supplier and brand "
|
||||
"manufacturer. Does not necessarily mean that the warranty "
|
||||
"to be applied is the one of the return partner (ie: can be "
|
||||
"returned to the company and be under the brand warranty")
|
||||
warranty_return_partner = \
|
||||
fields.Many2one('res.partner', string='Warranty Address',
|
||||
warranty_return_partner = fields.Many2one('res.partner', string='Warranty Address',
|
||||
help="Where the customer has to "
|
||||
"send back the product(s)")
|
||||
claim_id = fields.Many2one('crm.claim', string='Related claim',
|
||||
@@ -278,6 +277,7 @@ class ClaimLine(models.Model):
|
||||
'warning': warning}
|
||||
|
||||
def set_warranty_limit(self):
|
||||
|
||||
self.ensure_one()
|
||||
|
||||
claim = self.claim_id
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# © 2017 Techspawn Solutions
|
||||
# © 2015 Eezee-It, MONK Software, Vauxoo
|
||||
# © 2013 Camptocamp
|
||||
# © 2009-2013 Akretion,
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from openerp import _, api, exceptions, fields, models
|
||||
from odoo import _, api, exceptions, fields, models
|
||||
|
||||
from .invoice_no_date import InvoiceNoDate
|
||||
from .product_no_supplier import ProductNoSupplier
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# © 2017 Techspawn Solutions
|
||||
# © 2015 Eezee-It, MONK Software, Vauxoo
|
||||
# © 2013 Camptocamp
|
||||
# © 2009-2013 Akretion,
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# © 2017 Techspawn Solutions
|
||||
# © 2016 Cyril Gaudin (Camptocamp)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from openerp import fields, models
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class ProcurementGroup(models.Model):
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# © 2017 Techspawn Solutions
|
||||
# © 2015 Vauxoo
|
||||
# © 2015 Eezee-It, MONK Software
|
||||
# © 2013 Camptocamp
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# © 2017 Techspawn Solutions
|
||||
# © 2015 Eezee-It, MONK Software, Vauxoo
|
||||
# © 2013 Camptocamp
|
||||
# © 2009-2013 Akretion,
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from openerp import api, models
|
||||
from odoo import api, models
|
||||
|
||||
|
||||
class StockMove(models.Model):
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# © 2017 Techspawn Solutions
|
||||
# © 2015 Eezee-It, MONK Software, Vauxoo
|
||||
# © 2013 Camptocamp
|
||||
# © 2009-2013 Akretion,
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from openerp import fields, models
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class StockPicking(models.Model):
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# © 2017 Techspawn Solutions
|
||||
# © 2015 Eezee-It, MONK Software, Vauxoo
|
||||
# © 2013 Camptocamp
|
||||
# © 2009-2013 Akretion,
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from openerp import fields, models
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class SubstateSubstate(models.Model):
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# © 2016 Cyril Gaudin (Camptocamp)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from openerp.tests import TransactionCase
|
||||
from odoo.tests import TransactionCase
|
||||
|
||||
|
||||
class TestClaim(TransactionCase):
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# © 2014 Camptocamp SA
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from openerp.tests import common
|
||||
from odoo.tests import common
|
||||
|
||||
|
||||
class TestPickingCreation(common.TransactionCase):
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
<!-- INHERITED VIEW FOR THE OBJECT : account_invoice -->
|
||||
|
||||
<record id="invoice_form" model="ir.ui.view">
|
||||
@@ -8,11 +9,13 @@
|
||||
<field name="inherit_id" ref="account.invoice_form"/>
|
||||
<field eval="16" name="priority"/>
|
||||
<field name="arch" type="xml">
|
||||
<data>
|
||||
<field name='origin' position="after">
|
||||
<field name="claim_id" attrs="{'invisible':[('type','!=','out_refund')]}"/>
|
||||
</field>
|
||||
</data>
|
||||
|
||||
<field name='origin' position="after"/>
|
||||
<xpath expr="//button[@name='action_invoice_cancel']" position="replace">
|
||||
<field name="claim_id" attrs="{'invisible':[('type','!=','out_refund')]}"/>
|
||||
</xpath>
|
||||
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
|
||||
@@ -110,7 +110,8 @@
|
||||
<separator string="Problem" colspan="4"/>
|
||||
<group col="6" colspan="4">
|
||||
<field name="name" colspan="6"/>
|
||||
<field name="product_id" readonly="1" colspan="6"/>
|
||||
<!-- Read-only view deleted -->
|
||||
<field name="product_id" colspan="6"/>
|
||||
<field name="prodlot_id" colspan="6"/>
|
||||
<field name="claim_origin" colspan="6"/>
|
||||
<field name="claim_diagnosis" colspan="6"/>
|
||||
@@ -119,26 +120,26 @@
|
||||
<field name="unit_sale_price"/>
|
||||
<field name="return_value"/>
|
||||
</group>
|
||||
<group>
|
||||
<group>
|
||||
<group string="Warranty">
|
||||
<field name="guarantee_limit" readonly="1"/>
|
||||
<field name="warning" readonly="1"/>
|
||||
<field name="warranty_type" readonly="1"/>
|
||||
<field name="guarantee_limit"/>
|
||||
<field name="warning"/>
|
||||
<!-- <field name="warranty_type"/> -->
|
||||
<field name="warranty_return_partner"/>
|
||||
</group>
|
||||
<group string="Linked Document">
|
||||
<field name="claim_id" readonly="1"/>
|
||||
<field name="invoice_line_id" readonly="1"/>
|
||||
<field name="invoice_line_id" />
|
||||
<field name="refund_line_id" readonly="1"/>
|
||||
<field name="move_in_id" readonly="1"/>
|
||||
<field name="move_out_id" readonly="1"/>
|
||||
</group>
|
||||
</group>
|
||||
</group>
|
||||
<separator string="State" colspan="4"/>
|
||||
<group col="6" colspan="4">
|
||||
<field name="substate_id" widget='selection'/>
|
||||
<field name="last_state_change"/>
|
||||
</group>
|
||||
</group>
|
||||
</sheet>
|
||||
<div class="oe_chatter">
|
||||
<field name="message_follower_ids" widget="mail_followers"/>
|
||||
@@ -148,34 +149,6 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!--
|
||||
A second slightly modified form view to be used for the claim_line_ids
|
||||
field in the crm.claim form view. Defining it here instead of directly
|
||||
inside the field allows us to write only the changes and reference it
|
||||
-->
|
||||
<record id="crm_claim_line_view_form_embedded" model="ir.ui.view">
|
||||
<field name="name">Claim line form view to be used inside claim tree</field>
|
||||
<field name="mode">primary</field>
|
||||
<field name="model">claim.line</field>
|
||||
<field name="priority" eval="30"/>
|
||||
<field name="inherit_id" ref="crm_claim_line_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="claim_id" position="attributes">
|
||||
<attribute name="readonly">1</attribute>
|
||||
</field>
|
||||
<field name="product_id" position="attributes">
|
||||
<attribute name="context">{'claim_id': parent.id, 'company_id': parent.company_id, 'warehouse_id':
|
||||
parent.warehouse_id, 'claim_type': parent.claim_type, 'claim_date': parent.date}
|
||||
</attribute>
|
||||
</field>
|
||||
<field name="invoice_line_id" position="attributes">
|
||||
<attribute name="context">{'claim_id': parent.id, 'company_id': parent.company_id, 'warehouse_id':
|
||||
parent.warehouse_id, 'claim_type': parent.claim_type, 'claim_date': parent.date}
|
||||
</attribute>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Claim lines action -->
|
||||
<record model="ir.actions.act_window" id="act_crm_case_claim_lines">
|
||||
<field name="name">Claim lines</field>
|
||||
@@ -193,7 +166,7 @@
|
||||
<menuitem
|
||||
name="Claim lines"
|
||||
id="menu_crm_case_claims_claim_lines"
|
||||
parent="base.menu_aftersale"
|
||||
parent="crm_claim.base_menu_aftersale"
|
||||
action="act_crm_case_claim_lines"
|
||||
sequence="2"/>
|
||||
</odoo>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
<!-- CLAIM VIEWS -->
|
||||
<record model="ir.ui.view" id="crm_case_claims_tree_view">
|
||||
<field name="name">CRM - Claims Tree</field>
|
||||
@@ -249,11 +250,10 @@
|
||||
<field name="model">crm.claim</field>
|
||||
<field name="inherit_id" ref="crm_claim.crm_case_claims_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<data>
|
||||
<xpath expr="//field[@name='date_deadline']" position="after">
|
||||
<field name="rma_number"/>
|
||||
</xpath>
|
||||
</data>
|
||||
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -277,5 +277,7 @@
|
||||
<field name="rma_number"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
# © 2009-2013 Akretion,
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from openerp import api, fields, models
|
||||
from odoo import api, fields, models
|
||||
|
||||
|
||||
class AccountInvoiceRefund(models.TransientModel):
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
|
||||
import time
|
||||
|
||||
from openerp import models, fields, exceptions, api, _
|
||||
from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT as DT_FORMAT
|
||||
from odoo import models, fields, exceptions, api, _
|
||||
from odoo.tools import DEFAULT_SERVER_DATETIME_FORMAT as DT_FORMAT
|
||||
|
||||
|
||||
class ClaimMakePicking(models.TransientModel):
|
||||
|
||||
Reference in New Issue
Block a user