-
-
Notifications
You must be signed in to change notification settings - Fork 788
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[9.0][PORT] purchase_analytic_global
- Loading branch information
Showing
9 changed files
with
109 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg | ||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html | ||
:alt: License: AGPL-3 | ||
|
||
================================== | ||
Purchase - Analytic Account Global | ||
================================== | ||
|
||
This module adds an analytic account on the purchases that is applied on all the lines. | ||
|
||
|
||
Usage | ||
===== | ||
|
||
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas | ||
:alt: Try me on Runbot | ||
:target: https://runbot.odoo-community.org/runbot/142/9.0 | ||
|
||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues | ||
<https://github.com/OCA/purchase-workflow/issues>`_. 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 feedback. | ||
|
||
Credits | ||
======= | ||
|
||
Images | ||
------ | ||
|
||
* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_. | ||
|
||
Contributors | ||
------------ | ||
|
||
* Guewen Baconnier <guewen.baconnier@camptocamp.com> | ||
* Yannick Vaucher <yannick.vaucher@camptocamp.com> | ||
|
||
Maintainer | ||
---------- | ||
|
||
.. image:: https://odoo-community.org/logo.png | ||
:alt: Odoo Community Association | ||
:target: https://odoo-community.org | ||
|
||
This module is maintained by the OCA. | ||
|
||
OCA, or the Odoo Community Association, is a nonprofit organization whose | ||
mission is to support the collaborative development of Odoo features and | ||
promote its widespread use. | ||
|
||
To contribute to this module, please visit https://odoo-community.org. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1 @@ | ||
# -*- coding: utf-8 -*- | ||
############################################################################## | ||
# | ||
# Author: Guewen Baconnier | ||
# Copyright 2014 Camptocamp SA | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Affero General Public License as | ||
# published by the Free Software Foundation, either version 3 of the | ||
# License, or (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Affero General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Affero General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
# | ||
############################################################################## | ||
|
||
from . import purchase | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,18 @@ | ||
# -*- coding: utf-8 -*- | ||
############################################################################## | ||
# | ||
# Author: Guewen Baconnier | ||
# Copyright 2014 Camptocamp SA | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Affero General Public License as | ||
# published by the Free Software Foundation, either version 3 of the | ||
# License, or (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Affero General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Affero General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
# | ||
############################################################################## | ||
|
||
# © 2014-2016 Camptocamp SA | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) | ||
{'name': 'Purchase - Analytic Account Global', | ||
'version': '1.0', | ||
'author': 'Camptocamp', | ||
'version': '9.0.1.0.0', | ||
'author': 'Camptocamp, Odoo Community Association (OCA)', | ||
'maintainer': 'Camptocamp', | ||
'license': 'AGPL-3', | ||
'category': 'Purchase Management', | ||
'complexity': "easy", | ||
'depends': ['purchase', | ||
], | ||
'description': """ | ||
Purchase - Analytic Account Global | ||
================================== | ||
Adds an analytic account on the purchases that is applied on all the lines. | ||
""", | ||
'website': 'http://www.camptocamp.com', | ||
'data': ['purchase_view.xml', | ||
'website': 'https://github.com/OCA/purchase-workflow', | ||
'data': ['views/purchase.xml', | ||
], | ||
'test': [], | ||
'installable': True, | ||
'auto_install': False, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import purchase |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# -*- coding: utf-8 -*- | ||
# © 2014-2016 Camptocamp SA | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) | ||
|
||
from openerp import api, fields, models | ||
|
||
|
||
class PurchaseOrder(models.Model): | ||
_inherit = 'purchase.order' | ||
|
||
account_analytic_id = fields.Many2one( | ||
'account.analytic.account', | ||
string='Analytic Account', | ||
states={'confirmed': [('readonly', True)], | ||
'approved': [('readonly', True)], | ||
'done': [('readonly', True)]}, | ||
help="The analytic account that will be set on all the lines. " | ||
"If you want to use different accounts, leave this field " | ||
"empty and set the accounts individually on the lines.") | ||
|
||
@api.onchange('account_analytic_id') | ||
def onchange_default_analytic_id(self): | ||
if not self.order_line: | ||
return | ||
for line in self.order_line: | ||
line.account_analytic_id = self.account_analytic_id |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<odoo> | ||
<record id="purchase_order_form" model="ir.ui.view"> | ||
<field name="name">purchase.order.form</field> | ||
<field name="model">purchase.order</field> | ||
<field name="inherit_id" ref="purchase.purchase_order_form"/> | ||
<field name="arch" type="xml"> | ||
<xpath expr="//field[@name='partner_ref']" position="after"> | ||
<field name="account_analytic_id" | ||
groups="purchase.group_analytic_accounting" | ||
domain="[('account_type','=','normal')]" | ||
/> | ||
</xpath> | ||
<field name="order_line" position="attributes"> | ||
<attribute name="context">{'default_account_analytic_id': account_analytic_id}</attribute> | ||
</field> | ||
</field> | ||
</record> | ||
|
||
</odoo> |