From 880cf7c7a9d9685e80e73597d37cc54054193f67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20BEAU?= Date: Mon, 9 Jan 2017 19:35:46 +0100 Subject: [PATCH] [ADD] add module product_simple_accounting to simplify the product form regarding accounting --- product_simple_accounting/__init__.py | 3 ++ product_simple_accounting/__openerp__.py | 31 +++++++++++++++++++ product_simple_accounting/models/__init__.py | 3 ++ product_simple_accounting/models/product.py | 24 ++++++++++++++ .../views/product_view.xml | 22 +++++++++++++ 5 files changed, 83 insertions(+) create mode 100644 product_simple_accounting/__init__.py create mode 100644 product_simple_accounting/__openerp__.py create mode 100644 product_simple_accounting/models/__init__.py create mode 100644 product_simple_accounting/models/product.py create mode 100644 product_simple_accounting/views/product_view.xml diff --git a/product_simple_accounting/__init__.py b/product_simple_accounting/__init__.py new file mode 100644 index 0000000..cde864b --- /dev/null +++ b/product_simple_accounting/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- + +from . import models diff --git a/product_simple_accounting/__openerp__.py b/product_simple_accounting/__openerp__.py new file mode 100644 index 0000000..51ff3cd --- /dev/null +++ b/product_simple_accounting/__openerp__.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 Akretion (http://www.akretion.com). +# @author Sébastien BEAU +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Product Simple Accounting", + "summary": "Simplify the accounting on product, remove accounting tab", + "version": "8.0.1.0.0", + "category": "Uncategorized", + "website": "www.akretion.com", + "author": " Akretion", + "license": "AGPL-3", + "application": False, + "installable": True, + "external_dependencies": { + "python": [], + "bin": [], + }, + "depends": [ + "product_profile", + "account_product_fiscal_classification", + ], + "data": [ + "views/product_view.xml", + ], + "demo": [ + ], + "qweb": [ + ] +} diff --git a/product_simple_accounting/models/__init__.py b/product_simple_accounting/models/__init__.py new file mode 100644 index 0000000..d7d7308 --- /dev/null +++ b/product_simple_accounting/models/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- + +from . import product diff --git a/product_simple_accounting/models/product.py b/product_simple_accounting/models/product.py new file mode 100644 index 0000000..30ff7a2 --- /dev/null +++ b/product_simple_accounting/models/product.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 Akretion (http://www.akretion.com). +# @author Sébastien BEAU +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from openerp import fields, models + + +class ProductProfile(models.Model): + _inherit = 'product.profile' + + def _get_types(self): + return [('product', 'Stockable Product'), + ('consu', 'Consumable'), + ('service', 'Service')] + + property_account_income = fields.Many2one( + 'account.account', + 'Property Account Income', + company_dependent=True) + property_account_expense = fields.Many2one( + 'account.account', + 'Property Account Expense', + company_dependent=True) diff --git a/product_simple_accounting/views/product_view.xml b/product_simple_accounting/views/product_view.xml new file mode 100644 index 0000000..cbdb5a6 --- /dev/null +++ b/product_simple_accounting/views/product_view.xml @@ -0,0 +1,22 @@ + + + + + + product.template + + + + + + + + + + + + + + + +