Add module pos_config_single_user
Several usability enhancements in sale, purchase, product and account
This commit is contained in:
@@ -145,9 +145,14 @@ module -->
|
|||||||
<field name="context">{'journal_show_code_only': True}</field>
|
<field name="context">{'journal_show_code_only': True}</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
<!-- remove base.group_no_one on Journal Items-->
|
||||||
|
<record id="account.menu_action_account_moves_all" model="ir.ui.menu">
|
||||||
|
<field name="groups_id" eval="[(6, 0, [ref('account.group_account_user')])]"/>
|
||||||
|
</record>
|
||||||
<!-- model account.move / Journal Entries -->
|
<!-- model account.move / Journal Entries -->
|
||||||
<record id="account.action_move_journal_line" model="ir.actions.act_window">
|
<record id="account.action_move_journal_line" model="ir.actions.act_window">
|
||||||
<field name="limit">200</field>
|
<field name="limit">200</field>
|
||||||
|
<field name="context">{}</field> <!-- Don't filter by default on misc journal -->
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
@@ -165,14 +170,13 @@ module -->
|
|||||||
<field name="model">account.move.line</field>
|
<field name="model">account.move.line</field>
|
||||||
<field name="inherit_id" ref="account.view_account_move_line_filter"/>
|
<field name="inherit_id" ref="account.view_account_move_line_filter"/>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<!--
|
|
||||||
<field name="partner_id" position="after">
|
<field name="partner_id" position="after">
|
||||||
<field name="reconcile_ref" />
|
<field name="full_reconcile_id" />
|
||||||
</field>
|
</field>
|
||||||
<filter name="unreconciled" position="before">
|
<filter name="unreconciled" position="before">
|
||||||
<filter name="reconciled" string="Fully Reconciled" domain="[('reconcile_id', '!=', False)]"/>
|
<filter name="reconciled" string="Fully Reconciled" domain="[('full_reconcile_id', '!=', False)]"/>
|
||||||
<filter name="partial_reconciled" string="Partially Reconciled" domain="[('reconcile_partial_id', '!=', False)]"/>
|
<!-- <filter name="partial_reconciled" string="Partially Reconciled" domain="[('reconcile_partial_id', '!=', False)]"/> -->
|
||||||
</filter> -->
|
</filter>
|
||||||
<field name="name" position="attributes">
|
<field name="name" position="attributes">
|
||||||
<attribute name="string">Name or Reference</attribute>
|
<attribute name="string">Name or Reference</attribute>
|
||||||
</field>
|
</field>
|
||||||
|
|||||||
@@ -1,30 +1,12 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
##############################################################################
|
# © 2016 Akretion (http://www.akretion.com)
|
||||||
#
|
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||||
# Intrastat Product Type module for Odoo
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
# Copyright (C) 2016 Akretion (http://www.akretion.com)
|
|
||||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
|
||||||
#
|
|
||||||
# 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': 'Intrastat Product Type',
|
'name': 'Intrastat Product Type',
|
||||||
'version': '0.1',
|
'version': '10.0.1.0.0',
|
||||||
'category': 'Accounting & Finance',
|
'category': 'Accounting',
|
||||||
'license': 'AGPL-3',
|
'license': 'AGPL-3',
|
||||||
'summary': 'Adds a special field Intrastat Type on Products',
|
'summary': 'Adds a special field Intrastat Type on Products',
|
||||||
'description': """
|
'description': """
|
||||||
@@ -42,5 +24,5 @@ This module has been written by Alexis de Lattre from Akretion <alexis.delattre@
|
|||||||
'depends': ['intrastat_product', 'l10n_fr_intrastat_service'],
|
'depends': ['intrastat_product', 'l10n_fr_intrastat_service'],
|
||||||
'data': ['product_view.xml'],
|
'data': ['product_view.xml'],
|
||||||
'post_init_hook': 'set_intrastat_type_on_products',
|
'post_init_hook': 'set_intrastat_type_on_products',
|
||||||
'installable': False,
|
'installable': True,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,8 @@
|
|||||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||||
|
|
||||||
|
|
||||||
from openerp import models, fields, api, _
|
from odoo import models, fields, api, _
|
||||||
from openerp.exceptions import ValidationError
|
from odoo.exceptions import ValidationError
|
||||||
|
|
||||||
|
|
||||||
class ProductTemplate(models.Model):
|
class ProductTemplate(models.Model):
|
||||||
@@ -34,16 +34,12 @@ class ProductTemplate(models.Model):
|
|||||||
"(but you can set Product Type to 'Consumable' or "
|
"(but you can set Product Type to 'Consumable' or "
|
||||||
"'Service').") % pt.name)
|
"'Service').") % pt.name)
|
||||||
|
|
||||||
@api.multi
|
@api.onchange('type')
|
||||||
def onchange_type(self, type):
|
def intrastat_type_onchange(self):
|
||||||
res = super(ProductTemplate, self).onchange_type(type)
|
if self.type in ('product', 'consu'):
|
||||||
if 'value' not in res:
|
self.intrastat_type = 'product'
|
||||||
res['value'] = {}
|
elif self.type == 'service':
|
||||||
if type == 'product':
|
self.intrastat_type = 'service'
|
||||||
res['value']['intrastat_type'] = 'product'
|
|
||||||
elif type == 'service':
|
|
||||||
res['value']['intrastat_type'] = 'service'
|
|
||||||
return res
|
|
||||||
|
|
||||||
|
|
||||||
class L10nFrIntrastatServiceDeclaration(models.Model):
|
class L10nFrIntrastatServiceDeclaration(models.Model):
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
# © 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
|
|
||||||
def set_intrastat_type_on_products(cr, pool):
|
def set_intrastat_type_on_products(cr, registry):
|
||||||
cr.execute(
|
cr.execute(
|
||||||
"UPDATE product_template SET intrastat_type='service' "
|
"UPDATE product_template SET intrastat_type='service' "
|
||||||
"WHERE type='service'")
|
"WHERE type='service'")
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!--
|
<!--
|
||||||
Copyright (C) 2016 Akretion (http://www.akretion.com/)
|
© 2016 Akretion (http://www.akretion.com/)
|
||||||
@author Alexis de Lattre <alexis.delattre@akretion.com>
|
@author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||||
The licence is in the file __openerp__.py
|
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<openerp>
|
<odoo>
|
||||||
<data>
|
|
||||||
|
|
||||||
|
|
||||||
<record id="product_template_form_view" model="ir.ui.view">
|
<record id="product_template_form_view" model="ir.ui.view">
|
||||||
@@ -21,5 +20,4 @@
|
|||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
|
||||||
</data>
|
</odoo>
|
||||||
</openerp>
|
|
||||||
|
|||||||
3
pos_config_single_user/__init__.py
Normal file
3
pos_config_single_user/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
from . import pos
|
||||||
24
pos_config_single_user/__manifest__.py
Normal file
24
pos_config_single_user/__manifest__.py
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# © 2014-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
|
{
|
||||||
|
'name': 'POS Config Single User',
|
||||||
|
'version': '10.0.1.0.0',
|
||||||
|
'category': 'Point Of Sale',
|
||||||
|
'license': 'AGPL-3',
|
||||||
|
'summary': 'Configure on each pos.config a single user allowed to start it',
|
||||||
|
'description': """
|
||||||
|
POS Config Single User
|
||||||
|
======================
|
||||||
|
|
||||||
|
New parameter on pos.config: the (only) user allowed to start sessions of this pos.config.
|
||||||
|
|
||||||
|
This module has been written by Alexis de Lattre from Akretion <alexis.delattre@akretion.com>.
|
||||||
|
""",
|
||||||
|
'author': 'Akretion',
|
||||||
|
'website': 'http://www.akretion.com',
|
||||||
|
'depends': ['point_of_sale'],
|
||||||
|
'data': ['pos_view.xml'],
|
||||||
|
'installable': True,
|
||||||
|
}
|
||||||
27
pos_config_single_user/pos.py
Normal file
27
pos_config_single_user/pos.py
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# © 2014-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
|
from odoo import models, fields, api, _
|
||||||
|
from openerp.exceptions import UserError
|
||||||
|
|
||||||
|
|
||||||
|
class PosConfig(models.Model):
|
||||||
|
_inherit = 'pos.config'
|
||||||
|
|
||||||
|
allowed_user_id = fields.Many2one(
|
||||||
|
'res.users', string="Allowed User",
|
||||||
|
help="If you select a user, only this user will be allowed to start "
|
||||||
|
"sessions for this POS", ondelete='restrict')
|
||||||
|
|
||||||
|
@api.multi
|
||||||
|
def open_session_cb(self):
|
||||||
|
self.ensure_one()
|
||||||
|
if (
|
||||||
|
self.allowed_user_id and
|
||||||
|
self.allowed_user_id != self.env.user):
|
||||||
|
raise UserError(_(
|
||||||
|
"The POS '%s' can be used only by user '%s'.") % (
|
||||||
|
self.name,
|
||||||
|
self.allowed_user_id.name))
|
||||||
|
return super(PosConfig, self).open_session_cb()
|
||||||
21
pos_config_single_user/pos_view.xml
Normal file
21
pos_config_single_user/pos_view.xml
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
© 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||||
|
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
-->
|
||||||
|
|
||||||
|
<odoo>
|
||||||
|
|
||||||
|
|
||||||
|
<record id="view_pos_config_form" model="ir.ui.view">
|
||||||
|
<field name="name">pos_config_single_user.pos.config</field>
|
||||||
|
<field name="model">pos.config</field>
|
||||||
|
<field name="inherit_id" ref="point_of_sale.view_pos_config_form"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<field name="sequence_id" position="after">
|
||||||
|
<field name="allowed_user_id"/>
|
||||||
|
</field>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
</odoo>
|
||||||
BIN
pos_config_single_user/static/description/icon.png
Normal file
BIN
pos_config_single_user/static/description/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.5 KiB |
@@ -27,9 +27,11 @@
|
|||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<xpath expr="//field[@name='statement_ids']/tree/field[@name='total_entry_encoding']" position="attributes">
|
<xpath expr="//field[@name='statement_ids']/tree/field[@name='total_entry_encoding']" position="attributes">
|
||||||
<attribute name="sum">Total Transactions</attribute>
|
<attribute name="sum">Total Transactions</attribute>
|
||||||
|
<attribute name="widget">monetary</attribute>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//field[@name='statement_ids']/tree/field[@name='balance_end_real']" position="attributes">
|
<xpath expr="//field[@name='statement_ids']/tree/field[@name='balance_end_real']" position="attributes">
|
||||||
<attribute name="sum">Total Balance Finale</attribute>
|
<attribute name="sum">Total Balance Finale</attribute>
|
||||||
|
<attribute name="widget">monetary</attribute>
|
||||||
</xpath>
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|||||||
@@ -21,3 +21,10 @@ class ProductProduct(models.Model):
|
|||||||
'default_code_uniq',
|
'default_code_uniq',
|
||||||
'unique(default_code)',
|
'unique(default_code)',
|
||||||
'This internal reference already exists!')]
|
'This internal reference already exists!')]
|
||||||
|
|
||||||
|
|
||||||
|
class ProductSupplierinfo(models.Model):
|
||||||
|
_inherit = 'product.supplierinfo'
|
||||||
|
|
||||||
|
name = fields.Many2one(
|
||||||
|
domain=[('supplier', '=', True), ('parent_id', '=', False)])
|
||||||
|
|||||||
@@ -43,6 +43,7 @@
|
|||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<field name="state" position="after">
|
<field name="state" position="after">
|
||||||
<field name="is_shipped" invisible="not context.get('show_purchase', False)"/>
|
<field name="is_shipped" invisible="not context.get('show_purchase', False)"/>
|
||||||
|
<field name="currency_id" invisible="1"/>
|
||||||
</field>
|
</field>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|||||||
@@ -34,6 +34,7 @@
|
|||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<field name="amount_total" position="before">
|
<field name="amount_total" position="before">
|
||||||
<field name="amount_untaxed" sum="Total Untaxed" widget="monetary"/>
|
<field name="amount_untaxed" sum="Total Untaxed" widget="monetary"/>
|
||||||
|
<field name="currency_id" invisible="1"/>
|
||||||
</field>
|
</field>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
@@ -45,6 +46,7 @@
|
|||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<field name="amount_total" position="before">
|
<field name="amount_total" position="before">
|
||||||
<field name="amount_untaxed" sum="Total Untaxed" widget="monetary"/>
|
<field name="amount_untaxed" sum="Total Untaxed" widget="monetary"/>
|
||||||
|
<field name="currency_id" invisible="1"/>
|
||||||
</field>
|
</field>
|
||||||
<field name="date_order" position="attributes">
|
<field name="date_order" position="attributes">
|
||||||
<attribute name="invisible">1</attribute>
|
<attribute name="invisible">1</attribute>
|
||||||
|
|||||||
Reference in New Issue
Block a user