[MIG][12.0] agreement_legal_sale

This commit is contained in:
Murtuza Saleh
2019-03-28 12:14:06 +05:30
parent dd6b4decee
commit b6b6efbc8c
21 changed files with 53 additions and 40 deletions

View File

@@ -1,6 +1,6 @@
================ ====================
Agreement - Sale Agreement Legal Sale
================ ====================
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !! !! This file is generated by oca-gen-addon-readme !!
@@ -14,13 +14,13 @@ Agreement - Sale
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3 :alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fcontract-lightgray.png?logo=github .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fcontract-lightgray.png?logo=github
:target: https://github.com/OCA/contract/tree/11.0/agreement_sale :target: https://github.com/OCA/contract/tree/12.0/agreement_legal_sale
:alt: OCA/contract :alt: OCA/contract
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/contract-11-0/contract-11-0-agreement_sale :target: https://translation.odoo-community.org/projects/contract-12-0/contract-12-0-agreement_legal_sale
:alt: Translate me on Weblate :alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/110/11.0 :target: https://runbot.odoo-community.org/runbot/110/12.0
:alt: Try me on Runbot :alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5| |badge1| |badge2| |badge3| |badge4| |badge5|
@@ -92,6 +92,7 @@ Contributors
* Steven Campbell <scampbell@opensourceintegrators.com> * Steven Campbell <scampbell@opensourceintegrators.com>
* Maxime Chambreuil <mchambreuil@opensourceintegrators.com> * Maxime Chambreuil <mchambreuil@opensourceintegrators.com>
* Serpent Consulting Services Pvt. Ltd. <support@serpentcs.com>
Other credits Other credits
~~~~~~~~~~~~~ ~~~~~~~~~~~~~
@@ -125,6 +126,6 @@ Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:
|maintainer-osi-scampbell| |maintainer-max3903| |maintainer-osi-scampbell| |maintainer-max3903|
This module is part of the `OCA/contract <https://github.com/OCA/contract/tree/11.0/agreement_sale>`_ project on GitHub. This module is part of the `OCA/contract <https://github.com/OCA/contract/tree/12.0/agreement_legal_sale>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View File

@@ -1,4 +1,3 @@
# Copyright (C) 2019 - TODAY, Open Source Integrators
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import models from . import models

View File

@@ -2,16 +2,16 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{ {
'name': 'Agreement - Sale', 'name': 'Agreement Legal Sale',
'summary': 'Create an agreement when the sales order is confirmed', 'summary': 'Create an agreement when the sale order is confirmed',
'version': '11.0.0.0.1', 'version': '12.0.1.0.0',
'license': 'AGPL-3', 'license': 'AGPL-3',
'author': 'Open Source Integrators, Odoo Community Association (OCA)', 'author': 'Open Source Integrators, Odoo Community Association (OCA)',
'category': 'Agreement', 'category': 'Agreement',
'website': 'https://github.com/OCA/contract', 'website': 'https://github.com/OCA/contract',
'depends': [ 'depends': [
'agreement', 'agreement_legal',
'sale', 'agreement_sale',
], ],
'data': [ 'data': [
'views/agreement.xml', 'views/agreement.xml',

View File

@@ -1,4 +1,3 @@
# Copyright (C) 2019 - TODAY, Open Source Integrators
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import ( from . import (

View File

@@ -0,0 +1,20 @@
# 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 Agreement(models.Model):
_inherit = 'agreement'
sale_id = fields.Many2one('sale.order', string='Sales Order')
analytic_account_id = fields.Many2one(
'account.analytic.account', 'Analytic Account', readonly=True,
copy=False)
class AgreementLine(models.Model):
_inherit = "agreement.line"
sale_line_id = fields.Many2one('sale.order.line',
string='Sales Order Line')

View File

@@ -11,7 +11,6 @@ class SaleOrder(models.Model):
'agreement', 'agreement',
string="Agreement Template", string="Agreement Template",
domain="[('is_template', '=', True)]") domain="[('is_template', '=', True)]")
agreement_id = fields.Many2one('agreement', string="Agreement", copy=False)
@api.multi @api.multi
def _action_confirm(self): def _action_confirm(self):
@@ -20,14 +19,14 @@ class SaleOrder(models.Model):
if order.agreement_template_id: if order.agreement_template_id:
order.agreement_id = order.agreement_template_id.copy(default={ order.agreement_id = order.agreement_template_id.copy(default={
'name': order.name, 'name': order.name,
'code': order.name,
'is_template': False, 'is_template': False,
'sale_id': order.id, 'sale_id': order.id,
'partner_id': order.partner_id.id, 'partner_id': order.partner_id.id,
'analytic_account_id': 'analytic_account_id': order.analytic_account_id and
order.analytic_account_id and order.analytic_account_id.id or False,
order.analytic_account_id.id or False,
}) })
for line in self.order_line: for line in order.order_line:
# Create agreement line # Create agreement line
self.env['agreement.line'].create({ self.env['agreement.line'].create({
'product_id': line.product_id.id, 'product_id': line.product_id.id,

View File

@@ -1,2 +1,3 @@
* Steven Campbell <scampbell@opensourceintegrators.com> * Steven Campbell <scampbell@opensourceintegrators.com>
* Maxime Chambreuil <mchambreuil@opensourceintegrators.com> * Maxime Chambreuil <mchambreuil@opensourceintegrators.com>
* Serpent Consulting Services Pvt. Ltd. <support@serpentcs.com>

View File

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

View File

@@ -367,7 +367,7 @@ ul.auto-toc {
!! This file is generated by oca-gen-addon-readme !! !! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !! !! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/contract/tree/11.0/agreement_sale"><img alt="OCA/contract" src="https://img.shields.io/badge/github-OCA%2Fcontract-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/contract-11-0/contract-11-0-agreement_sale"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/110/11.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p> <p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/contract/tree/12.0/agreement_legal_sale"><img alt="OCA/contract" src="https://img.shields.io/badge/github-OCA%2Fcontract-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/contract-11-0/contract-11-0-agreement_sale"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/110/12.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>Odoo Sales App does not support the management of legal content for agreements <p>Odoo Sales App does not support the management of legal content for agreements
and contracts. Its also not integrated with the Agreement App.</p> and contracts. Its also not integrated with the Agreement App.</p>
<p>This module is for companies that needs their customer to sign an agreement <p>This module is for companies that needs their customer to sign an agreement
@@ -426,7 +426,7 @@ sections, clauses, recitals and appendices</li>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/contract/issues">GitHub Issues</a>. <p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/contract/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported. In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed If you spotted it first, help us smashing it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/contract/issues/new?body=module:%20agreement_sale%0Aversion:%2011.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p> <a class="reference external" href="https://github.com/OCA/contract/issues/new?body=module:%20agreement_legal_sale%0Aversion:%2011.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p> <p>Do not contact contributors directly about support or help with technical issues.</p>
</div> </div>
<div class="section" id="credits"> <div class="section" id="credits">
@@ -461,7 +461,7 @@ mission is to support the collaborative development of Odoo features and
promote its widespread use.</p> promote its widespread use.</p>
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainers</a>:</p> <p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainers</a>:</p>
<p><a class="reference external" href="https://github.com/osi-scampbell"><img alt="osi-scampbell" src="https://github.com/osi-scampbell.png?size=40px" /></a> <a class="reference external" href="https://github.com/max3903"><img alt="max3903" src="https://github.com/max3903.png?size=40px" /></a></p> <p><a class="reference external" href="https://github.com/osi-scampbell"><img alt="osi-scampbell" src="https://github.com/osi-scampbell.png?size=40px" /></a> <a class="reference external" href="https://github.com/max3903"><img alt="max3903" src="https://github.com/max3903.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/contract/tree/11.0/agreement_sale">OCA/contract</a> project on GitHub.</p> <p>This module is part of the <a class="reference external" href="https://github.com/OCA/contract/tree/12.0/agreement_legal_sale">OCA/contract</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p> <p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div> </div>
</div> </div>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0"?> <?xml version="1.0" encoding="utf-8"?>
<odoo> <odoo>
<!-- Copyright 2019 Open Source Integrators <!-- Copyright 2019 Open Source Integrators
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). --> License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
@@ -7,19 +7,23 @@
<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="name">agreement.form.view</field>
<field name="model">agreement</field> <field name="model">agreement</field>
<field name="inherit_id" ref="agreement.partner_agreement_form_view"/> <field name="inherit_id"
ref="agreement_legal.partner_agreement_form_view"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<page name="signature" position="after"> <page name="signature" position="after">
<page name="sales" string="Sales"> <page name="sales" string="Sales">
<group> <group>
<group id="sale-left"> <group id="sale_left">
<field name="sale_id" readonly="1"/> <field name="sale_id" readonly="1"/>
<field name="analytic_account_id"/>
</group> </group>
<group id="sale-right"/> <group id="sale_right"/>
</group> </group>
</page> </page>
</page> </page>
</field> </field>
</record> </record>
<menuitem id="agreement.agreement_menu" action="agreement.agreement_action" sequence="100"/>
</odoo> </odoo>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0"?> <?xml version="1.0" encoding="utf-8"?>
<odoo> <odoo>
<!-- Copyright 2019 Open Source Integrators <!-- Copyright 2019 Open Source Integrators
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). --> License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
@@ -12,10 +12,10 @@
<xpath expr="//notebook" position="inside"> <xpath expr="//notebook" position="inside">
<page id="agreement" string="Agreement"> <page id="agreement" string="Agreement">
<group> <group>
<group id="agreement-left"> <group id="agreement_left">
<field name="is_serviceprofile"/> <field name="is_serviceprofile"/>
</group> </group>
<group id="agreement-right"/> <group id="agreement_right"/>
</group> </group>
</page> </page>
</xpath> </xpath>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0"?> <?xml version="1.0" encoding="utf-8"?>
<odoo> <odoo>
<!-- Copyright 2019 Open Source Integrators <!-- Copyright 2019 Open Source Integrators
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). --> License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->

View File

@@ -1,10 +0,0 @@
# 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 Agreement(models.Model):
_inherit = 'agreement'
sale_id = fields.Many2one('sale.order', string='Sales Order')