[ADD] add module product_simple_accounting to simplify the product form regarding accounting
This commit is contained in:
3
product_simple_accounting/__init__.py
Normal file
3
product_simple_accounting/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import models
|
||||
31
product_simple_accounting/__openerp__.py
Normal file
31
product_simple_accounting/__openerp__.py
Normal file
@@ -0,0 +1,31 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2017 Akretion (http://www.akretion.com).
|
||||
# @author Sébastien BEAU <sebastien.beau@akretion.com>
|
||||
# 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": [
|
||||
]
|
||||
}
|
||||
3
product_simple_accounting/models/__init__.py
Normal file
3
product_simple_accounting/models/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import product
|
||||
24
product_simple_accounting/models/product.py
Normal file
24
product_simple_accounting/models/product.py
Normal file
@@ -0,0 +1,24 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2017 Akretion (http://www.akretion.com).
|
||||
# @author Sébastien BEAU <sebastien.beau@akretion.com>
|
||||
# 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)
|
||||
22
product_simple_accounting/views/product_view.xml
Normal file
22
product_simple_accounting/views/product_view.xml
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="product_template_view_form" model="ir.ui.view">
|
||||
<field name="model">product.template</field>
|
||||
<field name="inherit_id" ref="product.product_template_form_view"/>
|
||||
<field name="priority" eval="64"/>
|
||||
<field name="arch" type="xml">
|
||||
<page string="Accounting" position="replace"/>
|
||||
<field name="profile_id" position="after">
|
||||
<field name="categ_id"/>
|
||||
<field name="fiscal_classification_id" widget="selection"/>
|
||||
</field>
|
||||
<field name="standard_price" position="after">
|
||||
<field name="valuation" attrs="{'invisible':[('type', 'in', ('service', 'consu'))]}"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
Reference in New Issue
Block a user