فهرست منبع

Monto en contrato de proveedor y columna de la vista.

sebas 4 سال پیش
کامیت
ae0f9e6696
7فایلهای تغییر یافته به همراه181 افزوده شده و 0 حذف شده
  1. 73 0
      README.rst
  2. 6 0
      __init__.py
  3. BIN
      __init__.pyc
  4. 45 0
      __openerp__.py
  5. 29 0
      account_analytic_account.py
  6. BIN
      account_analytic_account.pyc
  7. 28 0
      account_analyticpurchase_account_view.xml

+ 73 - 0
README.rst

@@ -0,0 +1,73 @@
+.. 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
+
+=========================
+Contracts Recurring Total
+=========================
+
+Add recurring total amount for contracts on tree and form view
+
+Installation
+============
+
+To install this module, you need to:
+
+#. Just Install this module
+
+Configuration
+=============
+
+To configure this module, you need to:
+
+#. No configuration needed
+
+Usage
+=====
+
+To use this module, you need to:
+
+#. Go to contracts and check for new fiel "Recurring Total"
+
+.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
+   :alt: Try me on Runbot
+   :target: https://runbot.adhoc.com.ar/
+
+.. repo_id is available in https://github.com/OCA/maintainer-tools/blob/master/tools/repos_with_ids.txt
+.. branch is "8.0" for example
+
+Known issues / Roadmap
+======================
+
+* ...
+
+Bug Tracker
+===========
+
+Bugs are tracked on `GitHub Issues
+<https://github.com/ingadhoc/{project_repo}/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
+------
+
+* ADHOC SA: `Icon <http://fotos.subefotos.com/83fed853c1e15a8023b86b2b22d6145bo.png>`_.
+
+Contributors
+------------
+
+
+Maintainer
+----------
+
+.. image:: http://fotos.subefotos.com/83fed853c1e15a8023b86b2b22d6145bo.png
+   :alt: Odoo Community Association
+   :target: https://www.adhoc.com.ar
+
+This module is maintained by the ADHOC SA.
+
+To contribute to this module, please visit https://www.adhoc.com.ar.

+ 6 - 0
__init__.py

@@ -0,0 +1,6 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+# For copyright and license notices, see __openerp__.py file in module root
+# directory
+##############################################################################
+from . import account_analytic_account

BIN
__init__.pyc


+ 45 - 0
__openerp__.py

@@ -0,0 +1,45 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    Copyright (C) 2016  ADHOC SA  (http://www.adhoc.com.ar)
+#    All Rights Reserved.
+#
+#    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/>.
+#
+##############################################################################
+{
+    'name': 'Contracts Supplier Recurring Total',
+    'version': '8.0.1.0.0',
+    'category': 'Purchases Management',
+    'sequence': 14,
+    'summary': '',
+    'author': 'Eiru Software',
+    'website': 'www.eiru.com.py',
+    'license': 'AGPL-3',
+    'images': [
+    ],
+    'depends': [
+        'account_analytic_analysis', 'account_analytic_purchase_contract',
+    ],
+    'data': [
+        'account_analyticpurchase_account_view.xml',
+    ],
+    'demo': [
+    ],
+    'test': [
+    ],
+    'installable': True,
+    'auto_install': False,
+    'application': False,
+}

+ 29 - 0
account_analytic_account.py

@@ -0,0 +1,29 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+# For copyright and license notices, see __openerp__.py file in module root
+# directory
+##############################################################################
+from openerp import models, fields, api
+from openerp.addons.decimal_precision import decimal_precision as dp
+
+
+class account_analytic_account(models.Model):
+    _inherit = "account.analytic.account"
+
+    recurring_total_amount = fields.Float(
+        'Monto',
+        compute='_compute_recurring_total_amount',
+        # we dont make storable so it is compatible with contract
+        # discount
+        # store=True,
+        digits=dp.get_precision('Account'),
+    )
+
+    @api.one
+    @api.depends(
+        'recurring_invoice_line_ids.quantity',
+        'recurring_invoice_line_ids.price_unit',
+    )
+    def _compute_recurring_total_amount(self):
+        self.recurring_total_amount = sum(
+            self.recurring_invoice_line_ids.mapped('price_subtotal'))

BIN
account_analytic_account.pyc


+ 28 - 0
account_analyticpurchase_account_view.xml

@@ -0,0 +1,28 @@
+<?xml version="1.0"?>
+<openerp>
+<data>
+
+<record id="view_account_analyticpurchase_account_form" model="ir.ui.view">
+    <field name="name">account.analyticpurchase.account.form</field>
+    <field name="model">account.analytic.account</field>
+    <field name="inherit_id" ref="account_analytic_purchase_contract.view_purchase_contract_form"/>
+    <field name="arch" type="xml">
+        <field name="price_subtotal" position="attributes">
+            <attribute name="sum">Total</attribute>
+        </field>
+    </field>
+</record>
+
+<record id="view_account_analytic_account_tree_purchase" model="ir.ui.view">
+    <field name="name">account.analytic.account.list</field>
+    <field name="model">account.analytic.account</field>
+    <field name="inherit_id" ref="account.view_account_analytic_account_list"/>
+    <field name="arch" type="xml">
+        <field name="company_id" position="after">
+            <field name="recurring_total_amount" sum="Total"/>
+        </field>
+    </field>
+</record>
+
+</data>
+</openerp>