changes in the crm_rma module and made it 10.0 compatible

This commit is contained in:
Techspawn Solutions
2017-01-11 16:12:08 +05:30
committed by Maxime Chambreuil
parent f83e7896f8
commit cb8ae2d63e
18 changed files with 59 additions and 70 deletions

View File

@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# © 2017 Techspawn Solutions
# © 2015 Vauxoo # © 2015 Vauxoo
# © 2015 Eezee-It # © 2015 Eezee-It
# © 2009-2013 Akretion # © 2009-2013 Akretion
@@ -10,6 +11,7 @@
'category': 'Generic Modules/CRM & SRM', 'category': 'Generic Modules/CRM & SRM',
'author': "Akretion, Camptocamp, Eezee-it, MONK Software, Vauxoo, " 'author': "Akretion, Camptocamp, Eezee-it, MONK Software, Vauxoo, "
"Odoo Community Association (OCA)", "Odoo Community Association (OCA)",
"Techspawn Solutions"
'website': 'http://www.akretion.com, http://www.camptocamp.com, ' 'website': 'http://www.akretion.com, http://www.camptocamp.com, '
'http://www.eezee-it.com, http://www.wearemonk.com, ' 'http://www.eezee-it.com, http://www.wearemonk.com, '
'http://www.vauxoo.com', 'http://www.vauxoo.com',
@@ -33,12 +35,12 @@
"views/claim_line.xml", "views/claim_line.xml",
'views/res_partner.xml', 'views/res_partner.xml',
'views/stock_view.xml', 'views/stock_view.xml',
'security/ir.model.access.csv', #'security/ir.model.access.csv',
], ],
'demo': [], 'demo': [],
'test': [ 'test': [
'test/test_invoice_refund.yml' 'test/test_invoice_refund.yml'
], ],
'installable': False, 'installable': True,
'auto_install': False, 'auto_install': False,
} }

View File

@@ -1,10 +1,11 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# © 2017 Techspawn Solutions
# © 2015 Eezee-It, MONK Software, Vauxoo # © 2015 Eezee-It, MONK Software, Vauxoo
# © 2013 Camptocamp # © 2013 Camptocamp
# © 2009-2013 Akretion, # © 2009-2013 Akretion,
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # 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): class AccountInvoice(models.Model):

View File

@@ -1,10 +1,11 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# © 2017 Techspawn Solutions
# © 2015 Vauxoo # © 2015 Vauxoo
# © 2013 Camptocamp # © 2013 Camptocamp
# © 2009-2013 Akretion, # © 2009-2013 Akretion,
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # 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): class AccountInvoiceLine(models.Model):

View File

@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# © 2017 Techspawn Solutions
# © 2015 Vauxoo # © 2015 Vauxoo
# © 2013 Camptocamp # © 2013 Camptocamp
# © 2009-2013 Akretion, # © 2009-2013 Akretion,
@@ -10,8 +11,8 @@ from datetime import datetime
from dateutil.relativedelta import relativedelta from dateutil.relativedelta import relativedelta
from openerp import _, api, exceptions, fields, models from odoo import _, api, exceptions, fields, models
from openerp.tools import (DEFAULT_SERVER_DATE_FORMAT, from odoo.tools import (DEFAULT_SERVER_DATE_FORMAT,
DEFAULT_SERVER_DATETIME_FORMAT) DEFAULT_SERVER_DATETIME_FORMAT)
from .invoice_no_date import InvoiceNoDate from .invoice_no_date import InvoiceNoDate
@@ -58,14 +59,14 @@ class ClaimLine(models.Model):
date = fields.Date('Claim Line Date', date = fields.Date('Claim Line Date',
select=True, select=True,
default=fields.date.today()) 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") help="More precise description of the problem")
priority = fields.Selection([('0_not_define', 'Not Define'), priority = fields.Selection([('0_not_define', 'Not Define'),
('1_normal', 'Normal'), ('1_normal', 'Normal'),
('2_high', 'High'), ('2_high', 'High'),
('3_very_high', 'Very High')], ('3_very_high', 'Very High')],
'Priority', default='0_not_define', 'Priority', default='0_not_define',
compute='_compute_priority', #compute='_compute_priority',
store=True, store=True,
readonly=False, readonly=False,
help="Priority attention of claim line") help="Priority attention of claim line")
@@ -77,7 +78,7 @@ class ClaimLine(models.Model):
], ],
help="To describe the line product diagnosis") help="To describe the line product diagnosis")
claim_origin = fields.Selection(SUBJECT_LIST, 'Claim Subject', claim_origin = fields.Selection(SUBJECT_LIST, 'Claim Subject',
required=True, help="To describe the " required=False, help="To describe the "
"line product problem") "line product problem")
product_id = fields.Many2one('product.product', string='Product', product_id = fields.Many2one('product.product', string='Product',
help="Returned product") help="Returned product")
@@ -115,20 +116,18 @@ class ClaimLine(models.Model):
@api.model @api.model
def get_warranty_return_partner(self): def get_warranty_return_partner(self):
return self.env['product.supplierinfo']._columns[ return self.env['product.supplierinfo'].warranty_return_partner
'warranty_return_partner'
].selection
warranty_type = fields.Selection( 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 " help="Who is in charge of the warranty return treatment towards "
"the end customer. Company will use the current company " "the end customer. Company will use the current company "
"delivery or default address and so on for supplier and brand " "delivery or default address and so on for supplier and brand "
"manufacturer. Does not necessarily mean that the warranty " "manufacturer. Does not necessarily mean that the warranty "
"to be applied is the one of the return partner (ie: can be " "to be applied is the one of the return partner (ie: can be "
"returned to the company and be under the brand warranty") "returned to the company and be under the brand warranty")
warranty_return_partner = \ warranty_return_partner = fields.Many2one('res.partner', string='Warranty Address',
fields.Many2one('res.partner', string='Warranty Address',
help="Where the customer has to " help="Where the customer has to "
"send back the product(s)") "send back the product(s)")
claim_id = fields.Many2one('crm.claim', string='Related claim', claim_id = fields.Many2one('crm.claim', string='Related claim',
@@ -278,6 +277,7 @@ class ClaimLine(models.Model):
'warning': warning} 'warning': warning}
def set_warranty_limit(self): def set_warranty_limit(self):
self.ensure_one() self.ensure_one()
claim = self.claim_id claim = self.claim_id

View File

@@ -1,10 +1,11 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# © 2017 Techspawn Solutions
# © 2015 Eezee-It, MONK Software, Vauxoo # © 2015 Eezee-It, MONK Software, Vauxoo
# © 2013 Camptocamp # © 2013 Camptocamp
# © 2009-2013 Akretion, # © 2009-2013 Akretion,
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # 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 .invoice_no_date import InvoiceNoDate
from .product_no_supplier import ProductNoSupplier from .product_no_supplier import ProductNoSupplier

View File

@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# © 2017 Techspawn Solutions
# © 2015 Eezee-It, MONK Software, Vauxoo # © 2015 Eezee-It, MONK Software, Vauxoo
# © 2013 Camptocamp # © 2013 Camptocamp
# © 2009-2013 Akretion, # © 2009-2013 Akretion,

View File

@@ -1,8 +1,9 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# © 2017 Techspawn Solutions
# © 2016 Cyril Gaudin (Camptocamp) # © 2016 Cyril Gaudin (Camptocamp)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # 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): class ProcurementGroup(models.Model):

View File

@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# © 2017 Techspawn Solutions
# © 2015 Vauxoo # © 2015 Vauxoo
# © 2015 Eezee-It, MONK Software # © 2015 Eezee-It, MONK Software
# © 2013 Camptocamp # © 2013 Camptocamp

View File

@@ -1,10 +1,11 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# © 2017 Techspawn Solutions
# © 2015 Eezee-It, MONK Software, Vauxoo # © 2015 Eezee-It, MONK Software, Vauxoo
# © 2013 Camptocamp # © 2013 Camptocamp
# © 2009-2013 Akretion, # © 2009-2013 Akretion,
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # 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): class StockMove(models.Model):

View File

@@ -1,10 +1,11 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# © 2017 Techspawn Solutions
# © 2015 Eezee-It, MONK Software, Vauxoo # © 2015 Eezee-It, MONK Software, Vauxoo
# © 2013 Camptocamp # © 2013 Camptocamp
# © 2009-2013 Akretion, # © 2009-2013 Akretion,
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # 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): class StockPicking(models.Model):

View File

@@ -1,10 +1,11 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# © 2017 Techspawn Solutions
# © 2015 Eezee-It, MONK Software, Vauxoo # © 2015 Eezee-It, MONK Software, Vauxoo
# © 2013 Camptocamp # © 2013 Camptocamp
# © 2009-2013 Akretion, # © 2009-2013 Akretion,
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # 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): class SubstateSubstate(models.Model):

View File

@@ -2,7 +2,7 @@
# © 2016 Cyril Gaudin (Camptocamp) # © 2016 Cyril Gaudin (Camptocamp)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # 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): class TestClaim(TransactionCase):

View File

@@ -3,7 +3,7 @@
# © 2014 Camptocamp SA # © 2014 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # 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): class TestPickingCreation(common.TransactionCase):

View File

@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<odoo> <odoo>
<data>
<!-- INHERITED VIEW FOR THE OBJECT : account_invoice --> <!-- INHERITED VIEW FOR THE OBJECT : account_invoice -->
<record id="invoice_form" model="ir.ui.view"> <record id="invoice_form" model="ir.ui.view">
@@ -8,11 +9,13 @@
<field name="inherit_id" ref="account.invoice_form"/> <field name="inherit_id" ref="account.invoice_form"/>
<field eval="16" name="priority"/> <field eval="16" name="priority"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<data>
<field name='origin' position="after"> <field name='origin' position="after"/>
<field name="claim_id" attrs="{'invisible':[('type','!=','out_refund')]}"/> <xpath expr="//button[@name='action_invoice_cancel']" position="replace">
</field> <field name="claim_id" attrs="{'invisible':[('type','!=','out_refund')]}"/>
</data> </xpath>
</field> </field>
</record> </record>
</data>
</odoo> </odoo>

View File

@@ -110,7 +110,8 @@
<separator string="Problem" colspan="4"/> <separator string="Problem" colspan="4"/>
<group col="6" colspan="4"> <group col="6" colspan="4">
<field name="name" colspan="6"/> <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="prodlot_id" colspan="6"/>
<field name="claim_origin" colspan="6"/> <field name="claim_origin" colspan="6"/>
<field name="claim_diagnosis" colspan="6"/> <field name="claim_diagnosis" colspan="6"/>
@@ -119,26 +120,26 @@
<field name="unit_sale_price"/> <field name="unit_sale_price"/>
<field name="return_value"/> <field name="return_value"/>
</group> </group>
<group> <group>
<group string="Warranty"> <group string="Warranty">
<field name="guarantee_limit" readonly="1"/> <field name="guarantee_limit"/>
<field name="warning" readonly="1"/> <field name="warning"/>
<field name="warranty_type" readonly="1"/> <!-- <field name="warranty_type"/> -->
<field name="warranty_return_partner"/> <field name="warranty_return_partner"/>
</group> </group>
<group string="Linked Document"> <group string="Linked Document">
<field name="claim_id" readonly="1"/> <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="refund_line_id" readonly="1"/>
<field name="move_in_id" readonly="1"/> <field name="move_in_id" readonly="1"/>
<field name="move_out_id" readonly="1"/> <field name="move_out_id" readonly="1"/>
</group> </group>
</group>
<separator string="State" colspan="4"/> <separator string="State" colspan="4"/>
<group col="6" colspan="4"> <group col="6" colspan="4">
<field name="substate_id" widget='selection'/> <field name="substate_id" widget='selection'/>
<field name="last_state_change"/> <field name="last_state_change"/>
</group> </group>
</group>
</sheet> </sheet>
<div class="oe_chatter"> <div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers"/> <field name="message_follower_ids" widget="mail_followers"/>
@@ -148,34 +149,6 @@
</field> </field>
</record> </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 --> <!-- Claim lines action -->
<record model="ir.actions.act_window" id="act_crm_case_claim_lines"> <record model="ir.actions.act_window" id="act_crm_case_claim_lines">
<field name="name">Claim lines</field> <field name="name">Claim lines</field>
@@ -193,7 +166,7 @@
<menuitem <menuitem
name="Claim lines" name="Claim lines"
id="menu_crm_case_claims_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" action="act_crm_case_claim_lines"
sequence="2"/> sequence="2"/>
</odoo> </odoo>

View File

@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<odoo> <odoo>
<data>
<!-- CLAIM VIEWS --> <!-- CLAIM VIEWS -->
<record model="ir.ui.view" id="crm_case_claims_tree_view"> <record model="ir.ui.view" id="crm_case_claims_tree_view">
<field name="name">CRM - Claims Tree</field> <field name="name">CRM - Claims Tree</field>
@@ -249,11 +250,10 @@
<field name="model">crm.claim</field> <field name="model">crm.claim</field>
<field name="inherit_id" ref="crm_claim.crm_case_claims_form_view"/> <field name="inherit_id" ref="crm_claim.crm_case_claims_form_view"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<data>
<xpath expr="//field[@name='date_deadline']" position="after"> <xpath expr="//field[@name='date_deadline']" position="after">
<field name="rma_number"/> <field name="rma_number"/>
</xpath> </xpath>
</data>
</field> </field>
</record> </record>
@@ -277,5 +277,7 @@
<field name="rma_number"/> <field name="rma_number"/>
</xpath> </xpath>
</field> </field>
</record>
</record>
</data>
</odoo> </odoo>

View File

@@ -5,7 +5,7 @@
# © 2009-2013 Akretion, # © 2009-2013 Akretion,
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # 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): class AccountInvoiceRefund(models.TransientModel):

View File

@@ -6,8 +6,8 @@
import time import time
from openerp import models, fields, exceptions, api, _ from odoo import models, fields, exceptions, api, _
from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT as DT_FORMAT from odoo.tools import DEFAULT_SERVER_DATETIME_FORMAT as DT_FORMAT
class ClaimMakePicking(models.TransientModel): class ClaimMakePicking(models.TransientModel):