mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
@@ -1,3 +1,4 @@
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
|
||||
# Copyright (C) 2019 - TODAY, Open Source Integrators
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from . import models
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# Copyright (C) 2018 - TODAY, Open Source Integrators
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
|
||||
# Copyright (C) 2019 - TODAY, Open Source Integrators
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
{
|
||||
'name': 'Agreement - Sale',
|
||||
@@ -15,7 +15,8 @@
|
||||
],
|
||||
'data': [
|
||||
'views/agreement.xml',
|
||||
'views/sale_order.xml'
|
||||
'views/product.xml',
|
||||
'views/sale_order.xml',
|
||||
],
|
||||
'installable': True,
|
||||
'development_status': 'Beta',
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
|
||||
# Copyright (C) 2019 - TODAY, Open Source Integrators
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from . import (
|
||||
sale_order,
|
||||
agreement,
|
||||
product,
|
||||
)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# Copyright (C) 2018 - TODAY, Open Source Integrators
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
|
||||
# Copyright (C) 2019 - TODAY, Open Source Integrators
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
13
agreement_sale/models/product.py
Normal file
13
agreement_sale/models/product.py
Normal file
@@ -0,0 +1,13 @@
|
||||
# Copyright (C) 2019 - TODAY, Open Source Integrators
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class ProductTemplate(models.Model):
|
||||
_inherit = 'product.template'
|
||||
|
||||
is_serviceprofile = fields.Boolean(
|
||||
string="Create a Service Profile",
|
||||
help="""If True, this product will create a service profile on the
|
||||
agreement when the sales order is confirmed.""")
|
||||
@@ -1,5 +1,5 @@
|
||||
# Copyright (C) 2018 - TODAY, Open Source Integrators
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
|
||||
# Copyright (C) 2019 - TODAY, Open Source Integrators
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import api, fields, models
|
||||
|
||||
@@ -37,11 +37,8 @@ class SaleOrder(models.Model):
|
||||
'sale_line_id': line.id,
|
||||
'uom_id': line.product_uom.id
|
||||
})
|
||||
# If the product sold has a BOM, create a service profile
|
||||
bom = self.env['mrp.bom'].search(
|
||||
[('product_tmpl_id', '=',
|
||||
line.product_id.product_tmpl_id.id)])
|
||||
if bom:
|
||||
# If the product is a service profile, create one
|
||||
if line.product_id.product_tmpl_id.is_serviceprofile:
|
||||
self.env['agreement.serviceprofile'].create({
|
||||
'name': line.name,
|
||||
'agreement_id': order.agreement_id.id,
|
||||
|
||||
@@ -1 +1 @@
|
||||
The roadmap is documented on https://github.com/OCA/contract/issues.
|
||||
The roadmap is documented on https://github.com/OCA/contract/issues.
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<?xml version="1.0"?>
|
||||
<odoo>
|
||||
<!-- Copyright 2018 Open Source Integrators
|
||||
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). -->
|
||||
<!-- Copyright 2019 Open Source Integrators
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
|
||||
|
||||
<!-- Agreement Form View -->
|
||||
<record id="agreement_sale_form_view" model="ir.ui.view">
|
||||
<record id="agreement_sale_form_view" model="ir.ui.view">
|
||||
<field name="name">agreement.form.view</field>
|
||||
<field name="model">agreement</field>
|
||||
<field name="inherit_id" ref="agreement.partner_agreement_form_view"/>
|
||||
|
||||
25
agreement_sale/views/product.xml
Normal file
25
agreement_sale/views/product.xml
Normal file
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0"?>
|
||||
<odoo>
|
||||
<!-- Copyright 2019 Open Source Integrators
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
|
||||
|
||||
<!-- Product Template Form View -->
|
||||
<record id="product_template_form_view" model="ir.ui.view">
|
||||
<field name="name">product.template.form.view</field>
|
||||
<field name="model">product.template</field>
|
||||
<field name="inherit_id" ref="product.product_template_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//notebook" position="inside">
|
||||
<page id="agreement" string="Agreement">
|
||||
<group>
|
||||
<group id="agreement-left">
|
||||
<field name="is_serviceprofile"/>
|
||||
</group>
|
||||
<group id="agreement-right"/>
|
||||
</group>
|
||||
</page>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
@@ -1,10 +1,10 @@
|
||||
<?xml version="1.0"?>
|
||||
<odoo>
|
||||
<!-- Copyright 2018 Open Source Integrators
|
||||
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). -->
|
||||
<!-- Copyright 2019 Open Source Integrators
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
|
||||
|
||||
<!-- Agreement Form View -->
|
||||
<record id="sale_order_agreement_form_view" model="ir.ui.view">
|
||||
<record id="sale_order_agreement_form_view" model="ir.ui.view">
|
||||
<field name="name">sale.order.agreement.form.view</field>
|
||||
<field name="model">sale.order</field>
|
||||
<field name="inherit_id" ref="sale.view_order_form"/>
|
||||
|
||||
Reference in New Issue
Block a user