@ -0,0 +1,48 @@ |
|||||
|
.. image:: https://img.shields.io/badge/license-LGPL--3-green.svg |
||||
|
:target: https://www.gnu.org/licenses/agpl-3.0-standalone.html |
||||
|
:alt: License: LGPL-3 |
||||
|
|
||||
|
Payroll Management In Pantry |
||||
|
============================ |
||||
|
This module allow us to manage payroll in pantry. |
||||
|
|
||||
|
Configuration |
||||
|
============= |
||||
|
* No additional configurations needed |
||||
|
|
||||
|
Company |
||||
|
------- |
||||
|
* `Cybrosys Techno Solutions <https://cybrosys.com/>`__ |
||||
|
|
||||
|
License |
||||
|
======= |
||||
|
General Public License, version 3 (LGPL v3). |
||||
|
(https://www.gnu.org/licenses/lgpl-3.0-standalone.html) |
||||
|
|
||||
|
Credits |
||||
|
------- |
||||
|
* Developer : (V17) Bhagyadev KP, |
||||
|
(V18) Nivedhya T, |
||||
|
* Contact: odoo@cybrosys.com |
||||
|
|
||||
|
Contacts |
||||
|
-------- |
||||
|
* Mail Contact : odoo@cybrosys.com |
||||
|
* Website : https://cybrosys.com |
||||
|
|
||||
|
Bug Tracker |
||||
|
----------- |
||||
|
Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. |
||||
|
|
||||
|
Maintainer |
||||
|
========== |
||||
|
.. image:: https://cybrosys.com/images/logo.png |
||||
|
:target: https://cybrosys.com |
||||
|
|
||||
|
This module is maintained by Cybrosys Technologies. |
||||
|
|
||||
|
For support and more information, please visit `Our Website <https://cybrosys.com/>`__ |
||||
|
|
||||
|
Further information |
||||
|
=================== |
||||
|
HTML Description: `<static/description/index.html>`__ |
@ -0,0 +1,22 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU LESSER |
||||
|
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
||||
|
# |
||||
|
# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
||||
|
# (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from . import models |
@ -0,0 +1,51 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU LESSER |
||||
|
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
||||
|
# |
||||
|
# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
||||
|
# (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
{ |
||||
|
'name': 'Payroll Management In Pantry', |
||||
|
'version': '18.0.1.0.0', |
||||
|
'category': 'Human Resources', |
||||
|
'summary': """Efficiently oversee payroll operations by factoring in |
||||
|
pantry expenditures through seamless deductions""", |
||||
|
'description': """This app will allow us to Manage Payroll of Pantry. |
||||
|
While creating Employee Payslip ,Salary Rule will be Added to that |
||||
|
Employee. The Amount of Product will Deduct from Salary.""", |
||||
|
'author': 'Cybrosys Techno Solutions', |
||||
|
'company': 'Cybrosys Techno Solutions', |
||||
|
'maintainer': 'Cybrosys Techno Solutions', |
||||
|
'website': "http://www.cybrosys.com", |
||||
|
'depends': ['sale_management', 'hr_payroll_community'], |
||||
|
'data': [ |
||||
|
'security/pantry_payroll_security.xml', |
||||
|
'security/ir.model.access.csv', |
||||
|
'data/salary_rule_data.xml', |
||||
|
'data/ir_sequence_data.xml', |
||||
|
'views/product_product_views.xml', |
||||
|
'views/product_template_views.xml', |
||||
|
'views/pantry_order_views.xml', |
||||
|
], |
||||
|
'images': ['static/description/banner.jpg'], |
||||
|
'license': 'LGPL-3', |
||||
|
'installable': True, |
||||
|
'auto_install': False, |
||||
|
'application': False, |
||||
|
} |
||||
|
|
@ -0,0 +1,15 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
<odoo> |
||||
|
<data noupdate="1"> |
||||
|
<!-- Pantry order sequence --> |
||||
|
<record id="pantry_order_sequence" model="ir.sequence"> |
||||
|
<field name="name">Pantry Order sequence</field> |
||||
|
<field name="code">pantry.order</field> |
||||
|
<field name="active">TRUE</field> |
||||
|
<field name="prefix">PAO/</field> |
||||
|
<field name="number_increment">1</field> |
||||
|
<field name="number_next">1</field> |
||||
|
<field name="padding">4</field> |
||||
|
</record> |
||||
|
</data> |
||||
|
</odoo> |
@ -0,0 +1,48 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
<odoo> |
||||
|
<data noupdate="1"> |
||||
|
<!-- Create salary rule --> |
||||
|
<record id="pantry_rule" model="hr.salary.rule"> |
||||
|
<field name="code">PR</field> |
||||
|
<field name="name">Pantry</field> |
||||
|
<field name="category_id" ref="hr_payroll_community.DED"/> |
||||
|
<field name="amount_select">code</field> |
||||
|
<field name="amount_python_compute">result = inputs.PR and - (inputs.PR.amount) |
||||
|
</field> |
||||
|
<field name="appears_on_payslip" eval="True"/> |
||||
|
<field name="sequence" eval="190"/> |
||||
|
</record> |
||||
|
<record id="hr_rule_input_loan" model="hr.rule.input"> |
||||
|
<field name="code">PR</field> |
||||
|
<field name="name">Pantry</field> |
||||
|
<field name="input_id" ref="pantry_rule"/> |
||||
|
</record> |
||||
|
<!--Adding salary rule into salary structure--> |
||||
|
<record id="hr_payroll_community.structure_base" |
||||
|
model="hr.payroll.structure"> |
||||
|
<field name="code">BASE</field> |
||||
|
<field name="name">Base for new structures</field> |
||||
|
<field eval="[(6, 0, [ref('hr_payroll_community.hr_rule_basic'), ref('hr_payroll_community.hr_rule_taxable'),ref('hr_payroll_community.hr_rule_net'),ref('pantry_rule')])]" |
||||
|
name="rule_ids"/> |
||||
|
<field name="company_id" ref="base.main_company"/> |
||||
|
</record> |
||||
|
<record id="hr_payroll_community.structure_001" |
||||
|
model="hr.payroll.structure"> |
||||
|
<field name="code">ME</field> |
||||
|
<field name="name">Marketing Executive</field> |
||||
|
<field eval="[(6, 0, [ref('hr_payroll_community.hr_salary_rule_house_rent_allowance1'), ref('hr_payroll_community.hr_salary_rule_convance_allowance1'),ref('hr_payroll_community.hr_salary_rule_profession_altax1'),ref('hr_payroll_community.hr_salary_rule_provident_fund1'),ref('pantry_rule')])]" |
||||
|
name="rule_ids"/> |
||||
|
<field name="company_id" ref="base.main_company"/> |
||||
|
<field name="parent_id" ref="hr_payroll_community.structure_base"/> |
||||
|
</record> |
||||
|
<record id="hr_payroll_community.structure_002" |
||||
|
model="hr.payroll.structure"> |
||||
|
<field name="code">MEGG</field> |
||||
|
<field name="name">Marketing Executive for Gilles Gravie</field> |
||||
|
<field eval="[(6, 0, [ref('hr_payroll_community.hr_salary_rule_ca_gravie'), ref('hr_payroll_community.hr_salary_rule_meal_voucher'),ref('pantry_rule')])]" |
||||
|
name="rule_ids"/> |
||||
|
<field name="company_id" ref="base.main_company"/> |
||||
|
<field name="parent_id" ref="hr_payroll_community.structure_001"/> |
||||
|
</record> |
||||
|
</data> |
||||
|
</odoo> |
@ -0,0 +1,6 @@ |
|||||
|
## Module <pantry_payroll> |
||||
|
|
||||
|
#### 27.12.2024 |
||||
|
#### Version 18.0.1.0.0 |
||||
|
#### ADD |
||||
|
- Initial Commit for Payroll Management In Pantry |
@ -0,0 +1,25 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU LESSER |
||||
|
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
||||
|
# |
||||
|
# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
||||
|
# (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from . import hr_payslip |
||||
|
from . import pantry_order |
||||
|
from . import product_product |
||||
|
from . import product_template |
@ -0,0 +1,45 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU LESSER |
||||
|
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
||||
|
# |
||||
|
# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
||||
|
# (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from odoo import api, models |
||||
|
|
||||
|
|
||||
|
class HrPayslip(models.Model): |
||||
|
"""Class for HR Payslip""" |
||||
|
_inherit = 'hr.payslip' |
||||
|
|
||||
|
@api.model |
||||
|
def get_inputs(self, contracts, date_from, date_to): |
||||
|
"""This function calculates the additional inputs |
||||
|
for the employee payslip.""" |
||||
|
res = super(HrPayslip, self).get_inputs(contracts, date_from, date_to) |
||||
|
amount_employee = 0 |
||||
|
employee_id = self.env['hr.contract'].browse( |
||||
|
contracts.id).employee_id |
||||
|
pantry_lines = self.env['pantry.order'].search([ |
||||
|
('partner_id', '=', employee_id.user_id.partner_id.id) |
||||
|
]) |
||||
|
for adv_obj in pantry_lines: |
||||
|
if self.date_from <= adv_obj.date_order.date() <= self.date_to: |
||||
|
amount_employee += adv_obj.amount_total |
||||
|
for result in res: |
||||
|
result['amount'] = amount_employee |
||||
|
return res |
@ -0,0 +1,93 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU LESSER |
||||
|
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
||||
|
# |
||||
|
# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
||||
|
# (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from odoo import api, fields, models |
||||
|
|
||||
|
|
||||
|
class PantryOrder(models.Model): |
||||
|
"""A class that represents a new model pantry order""" |
||||
|
_name = 'pantry.order' |
||||
|
_description = 'Pantry Order' |
||||
|
_inherit = ['mail.thread', 'mail.activity.mixin'] |
||||
|
|
||||
|
name = fields.Char(string='Order Sequence', readonly=True, |
||||
|
help='Sequence of the order') |
||||
|
partner_id = fields.Many2one('res.partner', string='Order User', |
||||
|
readonly=True, |
||||
|
default=lambda self: self.env.user.partner_id, |
||||
|
help='The user who is ordering') |
||||
|
state = fields.Selection(string='Status', required=True, selection=[ |
||||
|
('draft', 'Draft'), ('confirmed', 'Confirmed')], default='draft', |
||||
|
help='The current status of the order') |
||||
|
date_order = fields.Datetime(string='Order Date', |
||||
|
default=fields.Datetime.now, readonly=True, |
||||
|
help='The date order') |
||||
|
order_line_ids = fields.One2many('pantry.order.line', |
||||
|
'pantry_order_id', |
||||
|
string='Order Line', help="Order lines") |
||||
|
amount_total = fields.Float(string='Total', compute='_compute_amount_total', |
||||
|
help='The total amount of the order') |
||||
|
|
||||
|
@api.model |
||||
|
def create(self, vals): |
||||
|
"""Sequence for the order""" |
||||
|
if vals.get('name', 'New') == 'New': |
||||
|
vals['name'] = self.env['ir.sequence'].next_by_code( |
||||
|
'pantry.order') or 'New' |
||||
|
res = super(PantryOrder, self).create(vals) |
||||
|
return res |
||||
|
|
||||
|
@api.depends('order_line_ids') |
||||
|
def _compute_amount_total(self): |
||||
|
"""Calculates the amount_total""" |
||||
|
for rec in self: |
||||
|
rec.amount_total = sum( |
||||
|
rec.mapped('order_line_ids').mapped('subtotal')) |
||||
|
|
||||
|
def action_confirm_pantry_order(self): |
||||
|
"""Change the state to confirmed""" |
||||
|
self.state = 'confirmed' |
||||
|
|
||||
|
|
||||
|
class PantryOrderLine(models.Model): |
||||
|
"""A class that represents a new model pantry order line""" |
||||
|
_name = 'pantry.order.line' |
||||
|
_description = 'Pantry Order Line' |
||||
|
|
||||
|
pantry_order_id = fields.Many2one('pantry.order', string='Pantry Order', |
||||
|
required=True, |
||||
|
help='The corresponding pantry order') |
||||
|
product_id = fields.Many2one('product.product', string='Product', |
||||
|
required=True, |
||||
|
domain=[('pantry_product', '=', True)], |
||||
|
help='The product to order') |
||||
|
quantity = fields.Float(string='Quantity', |
||||
|
help='The quantity of the product') |
||||
|
unit_price = fields.Float(string='Unit Price', |
||||
|
help='The unit price of the product') |
||||
|
subtotal = fields.Float(string='Subtotal', compute='_compute_subtotal', |
||||
|
help='The subtotal of the order line') |
||||
|
|
||||
|
@api.depends('quantity') |
||||
|
def _compute_subtotal(self): |
||||
|
"""Calculates the subtotal""" |
||||
|
for rec in self: |
||||
|
rec.subtotal = rec.quantity * rec.unit_price |
@ -0,0 +1,72 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU LESSER |
||||
|
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
||||
|
# |
||||
|
# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
||||
|
# (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from odoo import fields, models |
||||
|
|
||||
|
|
||||
|
class ProductProduct(models.Model): |
||||
|
"""Class for adding quantity button on product kanban view.""" |
||||
|
_inherit = "product.product" |
||||
|
|
||||
|
quantity = fields.Integer(string="Quantity", help="Quantity of the product", default=1) |
||||
|
|
||||
|
def action_quantity_decrement(self): |
||||
|
"""Function for increment the quantity of product""" |
||||
|
if self.quantity > 1: |
||||
|
self.quantity -= 1 |
||||
|
|
||||
|
def action_quantity_increment(self): |
||||
|
"""Function for decrement the quantity of product""" |
||||
|
self.quantity += 1 |
||||
|
|
||||
|
def action_buy_pantry(self): |
||||
|
"""Make a quotation while purchasing a product from the pantry.""" |
||||
|
quotation = self.env['pantry.order'].search( |
||||
|
[('partner_id', '=', self.env.user.partner_id.id), |
||||
|
('state', '=', 'draft')]) |
||||
|
val_list = { |
||||
|
'product_id': self.id, |
||||
|
'unit_price': self.lst_price, |
||||
|
'quantity': self.quantity, |
||||
|
} |
||||
|
if quotation: |
||||
|
val_list['pantry_order_id'] = quotation[0].id |
||||
|
product = quotation.order_line_ids.filtered( |
||||
|
lambda sol: sol.product_id == self) |
||||
|
if product: |
||||
|
product[0].quantity += self.quantity |
||||
|
else: |
||||
|
quotation.write( |
||||
|
{'order_line_ids': [fields.Command.create(val_list)]}) |
||||
|
else: |
||||
|
quotation = self.env['pantry.order'].create([{ |
||||
|
'partner_id': self.env.user.partner_id.id, |
||||
|
'order_line_ids': [fields.Command.create(val_list)] |
||||
|
}]) |
||||
|
self.quantity = 1 |
||||
|
return { |
||||
|
'type': 'ir.actions.act_window', |
||||
|
'res_model': 'pantry.order', |
||||
|
'res_id': quotation.id, |
||||
|
'view_mode': 'form', |
||||
|
'target': 'current', |
||||
|
'views': [[False, "form"]], |
||||
|
} |
@ -0,0 +1,30 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU LESSER |
||||
|
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
||||
|
# |
||||
|
# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
||||
|
# (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from odoo import fields, models |
||||
|
|
||||
|
|
||||
|
class ProductTemplate(models.Model): |
||||
|
"""A class that represents already existing model product template""" |
||||
|
_inherit = 'product.template' |
||||
|
|
||||
|
pantry_product = fields.Boolean(string="Pantry Product", |
||||
|
help='Is this a pantry product or not') |
|
@ -0,0 +1,25 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
<odoo> |
||||
|
<data> |
||||
|
<!-- Pantry admin user group --> |
||||
|
<record id="group_pantry_admin" model="res.groups"> |
||||
|
<field name="name">Pantry Admin</field> |
||||
|
</record> |
||||
|
<!-- Pantry admin rule --> |
||||
|
<record id="pantry_admin_rule" model="ir.rule"> |
||||
|
<field name="name">Pantry admin rule</field> |
||||
|
<field name="model_id" ref="model_pantry_order"/> |
||||
|
<field name="domain_force">[]</field> |
||||
|
<field name="groups" |
||||
|
eval="[(4, ref('pantry_payroll.group_pantry_admin'))]"/> |
||||
|
</record> |
||||
|
<!-- Pantry user rule --> |
||||
|
<record id="pantry_users_rule" model="ir.rule"> |
||||
|
<field name="name">Pantry user rule</field> |
||||
|
<field name="model_id" ref="model_pantry_order"/> |
||||
|
<field name="domain_force">[('partner_id','=',user.partner_id.id)]</field> |
||||
|
<field name="groups" |
||||
|
eval="[(4, ref('base.group_user'))]"/> |
||||
|
</record> |
||||
|
</data> |
||||
|
</odoo> |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 628 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 210 KiB |
After Width: | Height: | Size: 209 KiB |
After Width: | Height: | Size: 109 KiB |
After Width: | Height: | Size: 495 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 624 B |
After Width: | Height: | Size: 136 KiB |
After Width: | Height: | Size: 214 KiB |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 310 B |
After Width: | Height: | Size: 929 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 542 B |
After Width: | Height: | Size: 576 B |
After Width: | Height: | Size: 733 B |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 270 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 911 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 600 B |
After Width: | Height: | Size: 673 B |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 462 B |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 926 B |
After Width: | Height: | Size: 9.0 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 7.0 KiB |
After Width: | Height: | Size: 878 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 653 B |
After Width: | Height: | Size: 800 B |
After Width: | Height: | Size: 905 B |
After Width: | Height: | Size: 189 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 839 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 5.9 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 427 B |
After Width: | Height: | Size: 627 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 988 B |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 875 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 130 KiB |
After Width: | Height: | Size: 196 KiB |
After Width: | Height: | Size: 198 KiB |
After Width: | Height: | Size: 205 KiB |
After Width: | Height: | Size: 133 KiB |
After Width: | Height: | Size: 201 KiB |
After Width: | Height: | Size: 119 KiB |
After Width: | Height: | Size: 135 KiB |
After Width: | Height: | Size: 133 KiB |
After Width: | Height: | Size: 125 KiB |
After Width: | Height: | Size: 76 KiB |
After Width: | Height: | Size: 111 KiB |
After Width: | Height: | Size: 110 KiB |
After Width: | Height: | Size: 73 KiB |
After Width: | Height: | Size: 880 KiB |
After Width: | Height: | Size: 749 KiB |
After Width: | Height: | Size: 55 KiB |
@ -0,0 +1,80 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
<odoo> |
||||
|
<!-- Pantry order action --> |
||||
|
<record id="action_pantry_order" model="ir.actions.act_window"> |
||||
|
<field name="name">Pantry Order</field> |
||||
|
<field name="type">ir.actions.act_window</field> |
||||
|
<field name="res_model">pantry.order</field> |
||||
|
<field name="view_mode">list,form</field> |
||||
|
<field name="help" type="html"> |
||||
|
<p class="o_view_nocontent_smiling_face"> |
||||
|
Create a new pantry order |
||||
|
</p> |
||||
|
</field> |
||||
|
</record> |
||||
|
<!-- Pantry order menu --> |
||||
|
<menuitem id="pantry_order_menu" name="Pantry Order" |
||||
|
action="pantry_payroll.action_pantry_order" parent="hr_pantry_menu"/> |
||||
|
<!-- Pantry order tree view --> |
||||
|
<record id="pantry_order_view_list" model="ir.ui.view"> |
||||
|
<field name="name">pantry.order.view.list</field> |
||||
|
<field name="model">pantry.order</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<list> |
||||
|
<field name="name"/> |
||||
|
<field name="partner_id"/> |
||||
|
<field name="date_order"/> |
||||
|
<field name="amount_total"/> |
||||
|
<field name="state" widget="badge" |
||||
|
decoration-info="state == 'draft'" |
||||
|
decoration-success="state == 'confirmed'"/> |
||||
|
</list> |
||||
|
</field> |
||||
|
</record> |
||||
|
<!-- Pantry order form view --> |
||||
|
<record id="pantry_order_view_form" model="ir.ui.view"> |
||||
|
<field name="name">pantry.order.view.form</field> |
||||
|
<field name="model">pantry.order</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<form> |
||||
|
<header> |
||||
|
<field name="state" widget="statusbar"/> |
||||
|
<button string="Confirm" class="btn btn-primary" type="object" name="action_confirm_pantry_order" invisible="state == 'confirmed'"/> |
||||
|
</header> |
||||
|
<sheet> |
||||
|
<div class="oe_title"> |
||||
|
<h1> |
||||
|
<field name="name"/> |
||||
|
</h1> |
||||
|
</div> |
||||
|
<group> |
||||
|
<group> |
||||
|
<field name="partner_id"/> |
||||
|
</group> |
||||
|
<group> |
||||
|
<field name="date_order"/> |
||||
|
</group> |
||||
|
</group> |
||||
|
<notebook> |
||||
|
<page string="Order Lines"> |
||||
|
<field name="order_line_ids" readonly="state == 'confirmed'"> |
||||
|
<list editable="bottom"> |
||||
|
<field name="product_id"/> |
||||
|
<field name="quantity"/> |
||||
|
<field name="unit_price"/> |
||||
|
<field name="subtotal"/> |
||||
|
</list> |
||||
|
</field> |
||||
|
<h2 class="oe_subtotal_footer oe_right"> |
||||
|
<group> |
||||
|
<field name="amount_total"/> |
||||
|
</group> |
||||
|
</h2> |
||||
|
</page> |
||||
|
</notebook> |
||||
|
</sheet> |
||||
|
<chatter/> |
||||
|
</form> |
||||
|
</field> |
||||
|
</record> |
||||
|
</odoo> |