Skip to content

Commit

Permalink
[IMP] pos_place: pre-commit stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
legalsylvain committed Oct 28, 2024
1 parent ab86082 commit f216846
Show file tree
Hide file tree
Showing 26 changed files with 179 additions and 165 deletions.
18 changes: 9 additions & 9 deletions pos_place/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ Point of Sale - Places
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpos-lightgray.png?logo=github
:target: https://github.com/OCA/pos/tree/12.0/pos_place
:target: https://github.com/OCA/pos/tree/16.0/pos_place
:alt: OCA/pos
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/pos-12-0/pos-12-0-pos_place
:target: https://translation.odoo-community.org/projects/pos-16-0/pos-16-0-pos_place
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/pos&target_branch=12.0
:target: https://runboat.odoo-community.org/builds?repo=OCA/pos&target_branch=16.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|
Expand All @@ -50,7 +50,7 @@ To configure this module, you need to:

* Create your places

.. figure:: https://raw.githubusercontent.com/OCA/pos/12.0/pos_place/static/description/pos_place_tree.png
.. figure:: https://raw.githubusercontent.com/OCA/pos/16.0/pos_place/static/description/pos_place_tree.png

Usage
=====
Expand All @@ -61,24 +61,24 @@ To use this module, you need to

* Click on 'Place' Button and select the place where you are

.. figure:: https://raw.githubusercontent.com/OCA/pos/12.0/pos_place/static/description/pos_front_end_ui.png
.. figure:: https://raw.githubusercontent.com/OCA/pos/16.0/pos_place/static/description/pos_front_end_ui.png

* All the next Pos Order will be related to this place.

.. figure:: https://raw.githubusercontent.com/OCA/pos/12.0/pos_place/static/description/pos_order_tree.png
.. figure:: https://raw.githubusercontent.com/OCA/pos/16.0/pos_place/static/description/pos_order_tree.png


* You can then, make statistic over best places

.. figure:: https://raw.githubusercontent.com/OCA/pos/12.0/pos_place/static/description/report_pos_order_graph.png
.. figure:: https://raw.githubusercontent.com/OCA/pos/16.0/pos_place/static/description/report_pos_order_graph.png

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/pos/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/pos/issues/new?body=module:%20pos_place%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/pos/issues/new?body=module:%20pos_place%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Expand Down Expand Up @@ -116,6 +116,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-legalsylvain|

This module is part of the `OCA/pos <https://github.com/OCA/pos/tree/12.0/pos_place>`_ project on GitHub.
This module is part of the `OCA/pos <https://github.com/OCA/pos/tree/16.0/pos_place>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
60 changes: 30 additions & 30 deletions pos_place/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,39 @@
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
'name': 'Point of Sale - Places',
'summary': "Define places on PoS orders",
'version': '12.0.1.0.4',
'category': 'Point of Sale',
'author': 'GRAP,Odoo Community Association (OCA)',
'maintainers': ['legalsylvain'],
'website': 'https://github.com/OCA/pos',
'license': 'AGPL-3',
'depends': [
'point_of_sale',
"name": "Point of Sale - Places",
"summary": "Define places on PoS orders",
"version": "12.0.1.0.4",
"category": "Point of Sale",
"author": "GRAP,Odoo Community Association (OCA)",
"maintainers": ["legalsylvain"],
"website": "https://github.com/OCA/pos",
"license": "AGPL-3",
"depends": [
"point_of_sale",
],
'data': [
'security/ir_module_category.xml',
'security/ir_rule.xml',
'security/res_groups.xml',
'security/ir.model.access.csv',
'views/templates.xml',
'views/view_account_invoice.xml',
'views/view_pos_config.xml',
'views/view_pos_place.xml',
'views/view_pos_order.xml',
"data": [
"security/ir_module_category.xml",
"security/ir_rule.xml",
"security/res_groups.xml",
"security/ir.model.access.csv",
"views/templates.xml",
"views/view_account_invoice.xml",
"views/view_pos_config.xml",
"views/view_pos_place.xml",
"views/view_pos_order.xml",
],
'qweb': [
'static/src/xml/pos_place.xml',
"qweb": [
"static/src/xml/pos_place.xml",
],
'demo': [
'demo/res_groups.xml',
'demo/pos_config.xml',
'demo/pos_place.xml',
"demo": [
"demo/res_groups.xml",
"demo/pos_config.xml",
"demo/pos_place.xml",
],
'images': [
'static/description/pos_front_end_ui.png',
'static/description/pos_config_form.png',
'static/description/pos_order_search.png',
"images": [
"static/description/pos_front_end_ui.png",
"static/description/pos_config_form.png",
"static/description/pos_order_search.png",
],
}
5 changes: 2 additions & 3 deletions pos_place/demo/pos_config.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Copyright (C) 2022 - Today: GRAP (http://www.grap.coop)
@author: Sylvain LE GAL (https://twitter.com/legalsylvain)
Expand All @@ -7,8 +7,7 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
<odoo>

<record id="point_of_sale.pos_config_main" model="pos.config">
<field name="use_pos_place" eval="True"/>
<field name="use_pos_place" eval="True" />
</record>

</odoo>

3 changes: 1 addition & 2 deletions pos_place/demo/pos_place.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Copyright (C) 2014 - Today: GRAP (http://www.grap.coop)
@author: Sylvain LE GAL (https://twitter.com/legalsylvain)
Expand All @@ -22,4 +22,3 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
</record>

</odoo>

7 changes: 3 additions & 4 deletions pos_place/demo/res_groups.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Copyright (C) 2014 - Today: GRAP (http://www.grap.coop)
@author: Sylvain LE GAL (https://twitter.com/legalsylvain)
Expand All @@ -7,12 +7,11 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
<odoo>

<record id="base.group_multi_company" model="res.groups">
<field name="users" eval="[(4, ref('base.user_admin'))]"/>
<field name="users" eval="[(4, ref('base.user_admin'))]" />
</record>

<record id="group_pos_place_manager" model="res.groups">
<field name="users" eval="[(4, ref('base.user_admin'))]"/>
<field name="users" eval="[(4, ref('base.user_admin'))]" />
</record>

</odoo>

5 changes: 2 additions & 3 deletions pos_place/models/account_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


class AccountInvoice(models.Model):
_inherit = 'account.invoice'
_inherit = "account.invoice"

place_id = fields.Many2one(
string='Place', comodel_name='pos.place')
place_id = fields.Many2one(string="Place", comodel_name="pos.place")
19 changes: 10 additions & 9 deletions pos_place/models/pos_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,21 @@


class PosConfig(models.Model):
_inherit = 'pos.config'
_inherit = "pos.config"

use_pos_place = fields.Boolean(
string="Use Point of Sale places",
default=False)
use_pos_place = fields.Boolean(string="Use Point of Sale places", default=False)

group_pos_place_user_id = fields.Many2one(
'res.groups', string='Point of Sale Place User Group',
compute='_compute_group_pos_place_user_id',
"res.groups",
string="Point of Sale Place User Group",
compute="_compute_group_pos_place_user_id",
help="This field is there to pass the id of the pos place user"
" group to the point of sale client.")
" group to the point of sale client.",
)

@api.multi
def _compute_group_pos_place_user_id(self):
for config in self:
config.group_pos_place_user_id =\
self.env.ref('pos_place.group_pos_place_user')
config.group_pos_place_user_id = self.env.ref(
"pos_place.group_pos_place_user"
)
7 changes: 3 additions & 4 deletions pos_place/models/pos_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@


class PosOrder(models.Model):
_inherit = 'pos.order'
_inherit = "pos.order"

place_id = fields.Many2one(
string='Place', comodel_name='pos.place')
place_id = fields.Many2one(string="Place", comodel_name="pos.place")

@api.model
def _order_fields(self, ui_order):
res = super()._order_fields(ui_order)
res['place_id'] = ui_order.get('place_id', False)
res["place_id"] = ui_order.get("place_id", False)
return res

def _prepare_invoice(self):
Expand Down
10 changes: 5 additions & 5 deletions pos_place/models/pos_place.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from odoo import models, fields
from odoo import fields, models


class PosPlace(models.Model):
_name = 'pos.place'
_description = 'Point of Sale Places'
_name = "pos.place"
_description = "Point of Sale Places"

def _default_company_id(self):
return self.env.user.company_id.id
Expand All @@ -19,5 +19,5 @@ def _default_company_id(self):
active = fields.Boolean(default=True)

company_id = fields.Many2one(
string='Company', comodel_name='res.company',
default=_default_company_id)
string="Company", comodel_name="res.company", default=_default_company_id
)
7 changes: 3 additions & 4 deletions pos_place/report/report_pos_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@


class PosOrderReport(models.Model):
_inherit = 'report.pos.order'
_inherit = "report.pos.order"

place_id = fields.Many2one(
comodel_name='pos.place', string='Place', readonly=True)
place_id = fields.Many2one(comodel_name="pos.place", string="Place", readonly=True)

def _select(self):
res = super()._select()
res += ', s.place_id as place_id'
res += ", s.place_id as place_id"
return res
3 changes: 1 addition & 2 deletions pos_place/security/ir_module_category.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Copyright (C) 2019 - Today: GRAP (http://www.grap.coop)
@author: Sylvain LE GAL (https://twitter.com/legalsylvain)
Expand All @@ -11,4 +11,3 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
</record>

</odoo>

2 changes: 1 addition & 1 deletion pos_place/security/ir_rule.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Copyright (C) 2015 - Today: GRAP (http://www.grap.coop)
@author: Sylvain LE GAL (https://twitter.com/legalsylvain)
Expand Down
9 changes: 4 additions & 5 deletions pos_place/security/res_groups.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Copyright (C) 2015 - Today: GRAP (http://www.grap.coop)
@author: Sylvain LE GAL (https://twitter.com/legalsylvain)
Expand All @@ -8,14 +8,13 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

<record id="group_pos_place_user" model="res.groups">
<field name="name">User</field>
<field name="category_id" ref="module_category_pos_place"/>
<field name="category_id" ref="module_category_pos_place" />
</record>

<record id="group_pos_place_manager" model="res.groups">
<field name="name">Manager</field>
<field name="category_id" ref="module_category_pos_place"/>
<field name="implied_ids" eval="[(4, ref('group_pos_place_user'))]"/>
<field name="category_id" ref="module_category_pos_place" />
<field name="implied_ids" eval="[(4, ref('group_pos_place_user'))]" />
</record>

</odoo>

Loading

0 comments on commit f216846

Please sign in to comment.