robin.keunen
5 years ago
96 changed files with 2501 additions and 1766 deletions
-
1.dockerignore
-
1README.md
-
2beesdoo_account/readme/CONTRIBUTORS.rst
-
44beesdoo_base/__manifest__.py
-
1beesdoo_base/demo/eaters.xml
-
29beesdoo_base/models/membercard.py
-
88beesdoo_base/models/partner.py
-
2beesdoo_base/readme/CONTRIBUTORS.rst
-
47beesdoo_base/wizard/member_card.py
-
18beesdoo_base/wizard/partner.py
-
30beesdoo_base/wizard/portal_wizard.py
-
23beesdoo_crelan_csv/__manifest__.py
-
2beesdoo_crelan_csv/models/account_journal.py
-
123beesdoo_crelan_csv/wizard/import_crelan_csv.py
-
47beesdoo_easy_my_coop/__manifest__.py
-
27beesdoo_easy_my_coop/controllers/main.py
-
8beesdoo_easy_my_coop/models/product.py
-
20beesdoo_easy_my_coop/models/res_company.py
-
40beesdoo_easy_my_coop/models/res_partner.py
-
13beesdoo_easy_my_coop/models/subscription_request.py
-
50beesdoo_easy_my_coop/tests/test_res_partner.py
-
13beesdoo_easy_my_coop/wizards/beesdoo_shift_subscribe.py
-
25beesdoo_inventory/__manifest__.py
-
41beesdoo_inventory/models/stock.py
-
2beesdoo_inventory/readme/CONTRIBUTORS.rst
-
32beesdoo_pos/__manifest__.py
-
4beesdoo_pos/models/beesdoo_pos.py
-
2beesdoo_pos/readme/CONTRIBUTORS.rst
-
2beesdoo_pos_reporting/models/res_partner.py
-
2beesdoo_pos_reporting/readme/CONTRIBUTORS.rst
-
38beesdoo_product/__manifest__.py
-
281beesdoo_product/models/beesdoo_product.py
-
2beesdoo_product/readme/CONTRIBUTORS.rst
-
24beesdoo_product/wizard/label_printing_utils.py
-
28beesdoo_product_usability/__manifest__.py
-
16beesdoo_product_usability/models/beesdoo_product.py
-
5beesdoo_purchase/__manifest__.py
-
38beesdoo_shift/__manifest__.py
-
1beesdoo_shift/models/__init__.py
-
295beesdoo_shift/models/cooperative_status.py
-
223beesdoo_shift/models/planning.py
-
127beesdoo_shift/models/res_partner.py
-
236beesdoo_shift/models/task.py
-
2beesdoo_shift/readme/CONTRIBUTORS.rst
-
21beesdoo_shift/wizard/assign_super_coop.py
-
72beesdoo_shift/wizard/batch_template.py
-
64beesdoo_shift/wizard/extension.py
-
41beesdoo_shift/wizard/holiday.py
-
36beesdoo_shift/wizard/instanciate_planning.py
-
193beesdoo_shift/wizard/subscribe.py
-
50beesdoo_shift/wizard/temporary_exemption.py
-
38beesdoo_shift_attendance/__manifest__.py
-
47beesdoo_shift_attendance/models/attendance_sheet.py
-
4beesdoo_shift_attendance/models/res_config_settings.py
-
22beesdoo_shift_attendance/tests/test_beesdoo_shift.py
-
8beesdoo_shift_attendance/wizard/generate_missing_attendance_sheets.py
-
7beesdoo_shift_attendance/wizard/validate_attendance_sheet.py
-
10beesdoo_stock/__manifest__.py
-
30beesdoo_stock/models/stock.py
-
2beesdoo_stock_coverage/models/product_template.py
-
1beesdoo_stock_coverage/readme/CONTRIBUTORS.rst
-
5beesdoo_stock_coverage/tests/test_stock_coverage.py
-
31beesdoo_website_eater/__manifest__.py
-
10beesdoo_website_eater/controllers/main.py
-
22beesdoo_website_posorder_amount/controllers/main.py
-
6beesdoo_website_shift/__manifest__.py
-
355beesdoo_website_shift/controllers/main.py
-
29beesdoo_website_shift/models/res_config.py
-
21beesdoo_website_shift/models/website.py
-
2beesdoo_website_shift/readme/CONTRIBUTORS.rst
-
29beesdoo_website_theme/__manifest__.py
-
2beesdoo_website_theme/readme/CONTRIBUTORS.rst
-
40beesdoo_worker_status/__manifest__.py
-
256beesdoo_worker_status/models/cooperative_status.py
-
44beesdoo_worker_status/models/task.py
-
28install-odoo-linux-server.md
-
1install-odoo-linux.md
-
26macavrac_base/__manifest__.py
-
74macavrac_base/models/res_partner.py
-
2purchase_order_generator/models/product_template.py
-
2purchase_order_generator/models/purchase_order.py
-
5purchase_order_generator/models/purchase_order_generator.py
-
4purchase_order_generator/models/purchase_order_generator_line.py
-
2purchase_order_generator/tests/test_pog.py
-
4website_portal_restrict_modification/controllers/main.py
@ -1,2 +1 @@ |
|||||
* |
* |
||||
|
|
@ -0,0 +1,2 @@ |
|||||
|
* Beescoop - Cellule IT |
||||
|
* Coop IT Easy SCRLfs |
@ -1,24 +1,35 @@ |
|||||
from odoo import models, fields, api |
|
||||
import uuid |
import uuid |
||||
|
|
||||
class MemberCard(models.Model): |
|
||||
|
from odoo import api, fields, models |
||||
|
|
||||
|
|
||||
|
class MemberCard(models.Model): |
||||
def _get_current_user(self): |
def _get_current_user(self): |
||||
return self.env.uid |
return self.env.uid |
||||
|
|
||||
def _compute_bar_code(self): |
def _compute_bar_code(self): |
||||
rule = self.env['barcode.rule'].search([('name', '=', 'Customer Barcodes')])[0] |
|
||||
|
rule = self.env["barcode.rule"].search( |
||||
|
[("name", "=", "Customer Barcodes")] |
||||
|
)[0] |
||||
size = 13 - len(rule.pattern) |
size = 13 - len(rule.pattern) |
||||
ean = rule.pattern + str(uuid.uuid4().fields[-1])[:size] |
ean = rule.pattern + str(uuid.uuid4().fields[-1])[:size] |
||||
return ean[0:12] + str(self.env['barcode.nomenclature'].ean_checksum(ean)) |
|
||||
|
return ean[0:12] + str( |
||||
|
self.env["barcode.nomenclature"].ean_checksum(ean) |
||||
|
) |
||||
|
|
||||
_name = 'member.card' |
|
||||
_order = 'create_date desc' |
|
||||
|
_name = "member.card" |
||||
|
_order = "create_date desc" |
||||
_description = "Member Card" |
_description = "Member Card" |
||||
|
|
||||
valid = fields.Boolean(default=True, string="Active") |
valid = fields.Boolean(default=True, string="Active") |
||||
barcode = fields.Char("Barcode", oldname='ean13', default=_compute_bar_code) |
|
||||
partner_id = fields.Many2one('res.partner') #, default=_get_current_client) |
|
||||
responsible_id = fields.Many2one('res.users', default=_get_current_user, string="Responsible") |
|
||||
|
barcode = fields.Char( |
||||
|
"Barcode", oldname="ean13", default=_compute_bar_code |
||||
|
) |
||||
|
partner_id = fields.Many2one( |
||||
|
"res.partner" |
||||
|
) # , default=_get_current_client) |
||||
|
responsible_id = fields.Many2one( |
||||
|
"res.users", default=_get_current_user, string="Responsible" |
||||
|
) |
||||
end_date = fields.Date(readonly=True, string="Expiration Date") |
end_date = fields.Date(readonly=True, string="Expiration Date") |
||||
comment = fields.Char("Reason", required=True) |
comment = fields.Char("Reason", required=True) |
@ -0,0 +1,2 @@ |
|||||
|
* Beescoop - Cellule IT |
||||
|
* Coop IT Easy SCRLfs |
@ -1,20 +1,22 @@ |
|||||
from odoo import models, fields, api |
|
||||
|
from odoo import api, fields, models |
||||
|
|
||||
|
|
||||
class NewEaterWizard(models.TransientModel): |
class NewEaterWizard(models.TransientModel): |
||||
""" |
""" |
||||
A transient model for the creation of a eater related to a worker. |
A transient model for the creation of a eater related to a worker. |
||||
""" |
""" |
||||
_name = 'eater.new.wizard' |
|
||||
_description = 'eater.new.wizard' |
|
||||
|
|
||||
|
_name = "eater.new.wizard" |
||||
|
_description = "eater.new.wizard" |
||||
|
|
||||
def _get_default_partner(self): |
def _get_default_partner(self): |
||||
return self.env.context['active_id'] |
|
||||
|
return self.env.context["active_id"] |
||||
|
|
||||
first_name = fields.Char('First Name', required=True) |
|
||||
last_name = fields.Char('Last Name', required=True) |
|
||||
email = fields.Char('Email') |
|
||||
|
first_name = fields.Char("First Name", required=True) |
||||
|
last_name = fields.Char("Last Name", required=True) |
||||
|
email = fields.Char("Email") |
||||
|
|
||||
partner_id = fields.Many2one('res.partner', default=_get_default_partner) |
|
||||
|
partner_id = fields.Many2one("res.partner", default=_get_default_partner) |
||||
|
|
||||
@api.one |
@api.one |
||||
def create_new_eater(self): |
def create_new_eater(self): |
||||
|
@ -1,25 +1,29 @@ |
|||||
from odoo import models, fields, api |
|
||||
from odoo import SUPERUSER_ID |
|
||||
|
from odoo import SUPERUSER_ID, api, fields, models |
||||
|
|
||||
|
|
||||
class BeesdooWizard(models.TransientModel): |
class BeesdooWizard(models.TransientModel): |
||||
|
|
||||
_inherit = 'portal.wizard' |
|
||||
|
_inherit = "portal.wizard" |
||||
|
|
||||
@api.onchange('portal_id') |
|
||||
|
@api.onchange("portal_id") |
||||
def onchange_portal(self): |
def onchange_portal(self): |
||||
# for each partner, determine corresponding portal.wizard.user records |
# for each partner, determine corresponding portal.wizard.user records |
||||
res_partner = self.env['res.partner'] |
|
||||
partner_ids = self._context.get('active_ids', []) |
|
||||
|
res_partner = self.env["res.partner"] |
||||
|
partner_ids = self._context.get("active_ids", []) |
||||
|
|
||||
contact_ids = set() |
contact_ids = set() |
||||
for partner in res_partner.browse(partner_ids): |
for partner in res_partner.browse(partner_ids): |
||||
for contact in (partner.child_ids | partner): |
|
||||
|
for contact in partner.child_ids | partner: |
||||
# make sure that each contact appears at most once in the list |
# make sure that each contact appears at most once in the list |
||||
if contact.id not in contact_ids: |
if contact.id not in contact_ids: |
||||
contact_ids.add(contact.id) |
contact_ids.add(contact.id) |
||||
in_portal = self.portal_id in contact.user_ids.mapped('groups_id') |
|
||||
self.user_ids |= self.env['portal.wizard.user'].new({ |
|
||||
'partner_id': contact.id, |
|
||||
'email': contact.email, |
|
||||
'in_portal': in_portal, |
|
||||
}) |
|
||||
|
in_portal = self.portal_id in contact.user_ids.mapped( |
||||
|
"groups_id" |
||||
|
) |
||||
|
self.user_ids |= self.env["portal.wizard.user"].new( |
||||
|
{ |
||||
|
"partner_id": contact.id, |
||||
|
"email": contact.email, |
||||
|
"in_portal": in_portal, |
||||
|
} |
||||
|
) |
@ -1,35 +1,28 @@ |
|||||
{ |
{ |
||||
'name': "Beescoop link with easy my coop", |
|
||||
|
|
||||
'summary': """ |
|
||||
|
"name": "Beescoop link with easy my coop", |
||||
|
"summary": """ |
||||
Module that made the link between beesdoo customization |
Module that made the link between beesdoo customization |
||||
and easy_my_coop |
and easy_my_coop |
||||
""", |
""", |
||||
|
|
||||
'description': """ |
|
||||
|
"description": """ |
||||
""", |
""", |
||||
|
|
||||
'author': "BEES coop, Coop IT Easy", |
|
||||
'website': "https://github.com/beescoop/Obeesdoo", |
|
||||
|
|
||||
'category': 'Cooperative management', |
|
||||
'version': '12.0.1.0.0', |
|
||||
|
|
||||
'depends': ['beesdoo_base', |
|
||||
'beesdoo_shift', |
|
||||
'easy_my_coop', |
|
||||
'easy_my_coop_website', |
|
||||
'partner_age', |
|
||||
], |
|
||||
|
|
||||
'data': [ |
|
||||
'views/res_company.xml', |
|
||||
'views/subscription_request.xml', |
|
||||
'views/subscription_templates.xml', |
|
||||
'views/product.xml' |
|
||||
|
"author": "BEES coop, Coop IT Easy", |
||||
|
"website": "https://github.com/beescoop/Obeesdoo", |
||||
|
"category": "Cooperative management", |
||||
|
"version": "12.0.1.0.0", |
||||
|
"depends": [ |
||||
|
"beesdoo_base", |
||||
|
"beesdoo_shift", |
||||
|
"easy_my_coop", |
||||
|
"easy_my_coop_website", |
||||
|
"partner_age", |
||||
], |
], |
||||
'demo': [ |
|
||||
'demo/product_share.xml', |
|
||||
|
"data": [ |
||||
|
"views/res_company.xml", |
||||
|
"views/subscription_request.xml", |
||||
|
"views/subscription_templates.xml", |
||||
|
"views/product.xml", |
||||
], |
], |
||||
'auto_install': True, |
|
||||
|
"demo": ["demo/product_share.xml"], |
||||
|
"auto_install": True, |
||||
} |
} |
@ -1,19 +1,22 @@ |
|||||
from odoo import http |
from odoo import http |
||||
from odoo.http import request |
from odoo.http import request |
||||
|
|
||||
from odoo.addons.easy_my_coop_website.controllers.main import WebsiteSubscription as Base |
|
||||
|
from odoo.addons.easy_my_coop_website.controllers.main import ( |
||||
|
WebsiteSubscription as Base, |
||||
|
) |
||||
|
|
||||
class WebsiteSubscription(Base): |
|
||||
|
|
||||
|
class WebsiteSubscription(Base): |
||||
def fill_values(self, values, is_company, logged, load_from_user=False): |
def fill_values(self, values, is_company, logged, load_from_user=False): |
||||
values = super(WebsiteSubscription, self).fill_values(values, |
|
||||
is_company, |
|
||||
logged, |
|
||||
load_from_user) |
|
||||
cmp = request.env['res.company']._company_default_get() |
|
||||
values.update({ |
|
||||
'display_info_session': cmp.display_info_session_confirmation, |
|
||||
'info_session_required': cmp.info_session_confirmation_required, |
|
||||
'info_session_text': cmp.info_session_confirmation_text, |
|
||||
}) |
|
||||
|
values = super(WebsiteSubscription, self).fill_values( |
||||
|
values, is_company, logged, load_from_user |
||||
|
) |
||||
|
cmp = request.env["res.company"]._company_default_get() |
||||
|
values.update( |
||||
|
{ |
||||
|
"display_info_session": cmp.display_info_session_confirmation, |
||||
|
"info_session_required": cmp.info_session_confirmation_required, |
||||
|
"info_session_text": cmp.info_session_confirmation_text, |
||||
|
} |
||||
|
) |
||||
return values |
return values |
@ -1,26 +1,25 @@ |
|||||
# Copyright 2019 Coop IT Easy SCRLfs |
# Copyright 2019 Coop IT Easy SCRLfs |
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
||||
|
|
||||
from odoo import api, fields, models, _ |
|
||||
|
from odoo import _, api, fields, models |
||||
|
|
||||
|
|
||||
class SubscriptionRequest(models.Model): |
class SubscriptionRequest(models.Model): |
||||
|
|
||||
_inherit = 'subscription.request' |
|
||||
|
_inherit = "subscription.request" |
||||
|
|
||||
info_session_confirmed = fields.Boolean( |
info_session_confirmed = fields.Boolean( |
||||
string="Confirmed Info Session", |
|
||||
default=False, |
|
||||
|
string="Confirmed Info Session", default=False |
||||
) |
) |
||||
|
|
||||
def get_partner_vals(self): |
def get_partner_vals(self): |
||||
partner_vals = super(SubscriptionRequest, self).get_partner_vals() |
partner_vals = super(SubscriptionRequest, self).get_partner_vals() |
||||
partner_vals['info_session_confirmed'] = self.info_session_confirmed |
|
||||
|
partner_vals["info_session_confirmed"] = self.info_session_confirmed |
||||
return partner_vals |
return partner_vals |
||||
|
|
||||
def get_required_field(self): |
def get_required_field(self): |
||||
required_fields = super(SubscriptionRequest, self).get_required_field() |
required_fields = super(SubscriptionRequest, self).get_required_field() |
||||
company = self.env['res.company']._company_default_get() |
|
||||
|
company = self.env["res.company"]._company_default_get() |
||||
if company.info_session_confirmation_required: |
if company.info_session_confirmation_required: |
||||
required_fields.append('info_session_confirmed') |
|
||||
|
required_fields.append("info_session_confirmed") |
||||
return required_fields |
return required_fields |
@ -0,0 +1,2 @@ |
|||||
|
* Beescoop - Cellule IT |
||||
|
* Coop IT Easy SCRLfs |
@ -0,0 +1,2 @@ |
|||||
|
* Beescoop - Cellule IT |
||||
|
* Coop IT Easy SCRLfs |
@ -0,0 +1,2 @@ |
|||||
|
* Beescoop - Cellule IT |
||||
|
* Coop IT Easy SCRLfs |
@ -0,0 +1,2 @@ |
|||||
|
* Beescoop - Cellule IT |
||||
|
* Coop IT Easy SCRLfs |
@ -1,20 +1,26 @@ |
|||||
from odoo import models, fields, api |
|
||||
|
from odoo import api, fields, models |
||||
|
|
||||
|
|
||||
class RequestLabelPrintingWizard(models.TransientModel): |
class RequestLabelPrintingWizard(models.TransientModel): |
||||
_name = 'label.printing.wizard' |
|
||||
_description = 'label.printing.wizard' |
|
||||
|
_name = "label.printing.wizard" |
||||
|
_description = "label.printing.wizard" |
||||
|
|
||||
def _get_selected_products(self): |
def _get_selected_products(self): |
||||
return self.env.context['active_ids'] |
|
||||
|
|
||||
product_ids = fields.Many2many('product.template', default=_get_selected_products) |
|
||||
|
return self.env.context["active_ids"] |
||||
|
|
||||
|
product_ids = fields.Many2many( |
||||
|
"product.template", default=_get_selected_products |
||||
|
) |
||||
|
|
||||
@api.one |
@api.one |
||||
def request_printing(self): |
def request_printing(self): |
||||
self.product_ids.write({'label_to_be_printed' : True}) |
|
||||
|
|
||||
|
self.product_ids.write({"label_to_be_printed": True}) |
||||
|
|
||||
@api.one |
@api.one |
||||
def set_as_printed(self): |
def set_as_printed(self): |
||||
self.product_ids.write({'label_to_be_printed' : False, 'label_last_printed' : fields.Datetime.now()}) |
|
||||
|
self.product_ids.write( |
||||
|
{ |
||||
|
"label_to_be_printed": False, |
||||
|
"label_last_printed": fields.Datetime.now(), |
||||
|
} |
||||
|
) |
@ -1,22 +1,18 @@ |
|||||
# Copyright 2017 - 2020 BEES coop SCRLfs |
# Copyright 2017 - 2020 BEES coop SCRLfs |
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
||||
{ |
{ |
||||
'name': "BEES coop Product Usability", |
|
||||
|
|
||||
'description': """ |
|
||||
Adapt the |
|
||||
|
"name": "BEES coop Product Usability", |
||||
|
"summary": """ |
||||
|
Adapt the product views. |
||||
""", |
""", |
||||
|
|
||||
'author': "Beescoop - Cellule IT, Coop IT Easy", |
|
||||
'website': "https://github.com/beescoop/Obeesdoo", |
|
||||
'category': 'Sales Management', |
|
||||
'version': '12.0.1.0.0', |
|
||||
'depends': [ |
|
||||
'beesdoo_product', |
|
||||
'beesdoo_stock_coverage', |
|
||||
'beesdoo_purchase', |
|
||||
], |
|
||||
'data': [ |
|
||||
'views/beesdoo_product.xml', |
|
||||
|
"author": "Beescoop - Cellule IT, Coop IT Easy SCRLfs", |
||||
|
"website": "https://github.com/beescoop/Obeesdoo", |
||||
|
"category": "Sales Management", |
||||
|
"version": "12.0.1.0.0", |
||||
|
"depends": [ |
||||
|
"beesdoo_product", |
||||
|
"beesdoo_stock_coverage", |
||||
|
"beesdoo_purchase", |
||||
], |
], |
||||
|
"data": ["views/beesdoo_product.xml",], |
||||
} |
} |
@ -1,4 +1,3 @@ |
|||||
# -*- coding: utf-8 -*- |
|
||||
from . import task |
from . import task |
||||
from . import planning |
from . import planning |
||||
from . import cooperative_status |
from . import cooperative_status |
||||
|
@ -0,0 +1,2 @@ |
|||||
|
* Beescoop - Cellule IT |
||||
|
* Coop IT Easy SCRLfs |
@ -1,14 +1,23 @@ |
|||||
from odoo import models, fields, api, _ |
|
||||
|
from odoo import _, api, fields, models |
||||
|
|
||||
|
|
||||
class AssignSuperCoop(models.TransientModel): |
class AssignSuperCoop(models.TransientModel): |
||||
_name = 'beesddoo.shift.assign_super_coop' |
|
||||
_description = 'beesddoo.shift.assign_super_coop' |
|
||||
|
_name = "beesddoo.shift.assign_super_coop" |
||||
|
_description = "beesddoo.shift.assign_super_coop" |
||||
|
|
||||
super_coop_id = fields.Many2one('res.users', 'New Super Cooperative', required=True, domain=[('super', '=', True)]) |
|
||||
shift_ids = fields.Many2many('beesdoo.shift.shift', readonly=True, default=lambda self: self._context.get('active_ids')) |
|
||||
|
super_coop_id = fields.Many2one( |
||||
|
"res.users", |
||||
|
"New Super Cooperative", |
||||
|
required=True, |
||||
|
domain=[("super", "=", True)], |
||||
|
) |
||||
|
shift_ids = fields.Many2many( |
||||
|
"beesdoo.shift.shift", |
||||
|
readonly=True, |
||||
|
default=lambda self: self._context.get("active_ids"), |
||||
|
) |
||||
|
|
||||
@api.multi |
@api.multi |
||||
def write_super_coop(self): |
def write_super_coop(self): |
||||
self.ensure_one() |
self.ensure_one() |
||||
self.shift_ids.write({'super_coop_id' : self.super_coop_id.id}) |
|
||||
|
self.shift_ids.write({"super_coop_id": self.super_coop_id.id}) |
@ -1,33 +1,63 @@ |
|||||
from odoo import models, fields, api, _ |
|
||||
|
from odoo import _, api, fields, models |
||||
from odoo.exceptions import UserError |
from odoo.exceptions import UserError |
||||
|
|
||||
|
|
||||
class Subscribe(models.TransientModel): |
class Subscribe(models.TransientModel): |
||||
_name = 'beesdoo.shift.extension' |
|
||||
_description = 'beesdoo.shift.extension' |
|
||||
_inherit = 'beesdoo.shift.action_mixin' |
|
||||
|
_name = "beesdoo.shift.extension" |
||||
|
_description = "beesdoo.shift.extension" |
||||
|
_inherit = "beesdoo.shift.action_mixin" |
||||
|
|
||||
def _get_default_extension_delay(self): |
def _get_default_extension_delay(self): |
||||
return int(self.env['ir.config_parameter'].sudo().get_param('default_extension_delay', 28)) |
|
||||
|
|
||||
|
return int( |
||||
|
self.env["ir.config_parameter"] |
||||
|
.sudo() |
||||
|
.get_param("default_extension_delay", 28) |
||||
|
) |
||||
|
|
||||
extension_start_date = fields.Date(string="Start date for the extension", default=fields.Date.today, readonly=True) |
|
||||
|
extension_start_date = fields.Date( |
||||
|
string="Start date for the extension", |
||||
|
default=fields.Date.today, |
||||
|
readonly=True, |
||||
|
) |
||||
auto = fields.Boolean("Auto Extension", default=False) |
auto = fields.Boolean("Auto Extension", default=False) |
||||
extension_days = fields.Integer(default=_get_default_extension_delay) |
extension_days = fields.Integer(default=_get_default_extension_delay) |
||||
|
|
||||
@api.multi |
@api.multi |
||||
def auto_ext(self): |
def auto_ext(self): |
||||
self = self._check(group='beesdoo_shift.group_shift_attendance') |
|
||||
status_id = self.env['cooperative.status'].search([('cooperator_id', '=', self.cooperator_id.id)]) |
|
||||
status_id.sudo().write({'extension_start_time': self.extension_start_date}) |
|
||||
|
self = self._check(group="beesdoo_shift.group_shift_attendance") |
||||
|
status_id = self.env["cooperative.status"].search( |
||||
|
[("cooperator_id", "=", self.cooperator_id.id)] |
||||
|
) |
||||
|
status_id.sudo().write( |
||||
|
{"extension_start_time": self.extension_start_date} |
||||
|
) |
||||
|
|
||||
@api.multi |
@api.multi |
||||
def extension(self): |
def extension(self): |
||||
self = self._check() #maybe a different group |
|
||||
grace_delay = int(self.env['ir.config_parameter'].sudo().get_param('default_grace_delay', 10)) |
|
||||
status_id = self.env['cooperative.status'].search([('cooperator_id', '=', self.cooperator_id.id)]) |
|
||||
|
self = self._check() # maybe a different group |
||||
|
grace_delay = int( |
||||
|
self.env["ir.config_parameter"] |
||||
|
.sudo() |
||||
|
.get_param("default_grace_delay", 10) |
||||
|
) |
||||
|
status_id = self.env["cooperative.status"].search( |
||||
|
[("cooperator_id", "=", self.cooperator_id.id)] |
||||
|
) |
||||
if not status_id.extension_start_time: |
if not status_id.extension_start_time: |
||||
raise UserError(_('You should not make a manual extension when the grace delay has not been triggered yet')) |
|
||||
today_delay = (status_id.today - status_id.extension_start_time).days - grace_delay |
|
||||
|
raise UserError( |
||||
|
_( |
||||
|
"You should not make a manual extension when the grace delay has not been triggered yet" |
||||
|
) |
||||
|
) |
||||
|
today_delay = ( |
||||
|
status_id.today - status_id.extension_start_time |
||||
|
).days - grace_delay |
||||
if today_delay < 0: |
if today_delay < 0: |
||||
raise UserError(_('You should not start a manual extension during the grace delay')) |
|
||||
status_id.sudo().write({'time_extension': self.extension_days + today_delay}) |
|
||||
|
raise UserError( |
||||
|
_( |
||||
|
"You should not start a manual extension during the grace delay" |
||||
|
) |
||||
|
) |
||||
|
status_id.sudo().write( |
||||
|
{"time_extension": self.extension_days + today_delay} |
||||
|
) |
@ -1,19 +1,40 @@ |
|||||
from odoo import models, fields, api, _ |
|
||||
|
from odoo import _, api, fields, models |
||||
from odoo.exceptions import ValidationError |
from odoo.exceptions import ValidationError |
||||
|
|
||||
|
|
||||
class Subscribe(models.TransientModel): |
class Subscribe(models.TransientModel): |
||||
_name = 'beesdoo.shift.holiday' |
|
||||
_description = 'beesdoo.shift.holiday' |
|
||||
_inherit = 'beesdoo.shift.action_mixin' |
|
||||
|
_name = "beesdoo.shift.holiday" |
||||
|
_description = "beesdoo.shift.holiday" |
||||
|
_inherit = "beesdoo.shift.action_mixin" |
||||
|
|
||||
holiday_start_day = fields.Date(string="Start date for the holiday", default=fields.Date.today) |
|
||||
|
holiday_start_day = fields.Date( |
||||
|
string="Start date for the holiday", default=fields.Date.today |
||||
|
) |
||||
holiday_end_day = fields.Date(string="End date for the holiday (included)") |
holiday_end_day = fields.Date(string="End date for the holiday (included)") |
||||
|
|
||||
@api.multi |
@api.multi |
||||
def holidays(self): |
def holidays(self): |
||||
self = self._check() # maybe a different group |
self = self._check() # maybe a different group |
||||
status_id = self.env['cooperative.status'].search([('cooperator_id', '=', self.cooperator_id.id)]) |
|
||||
if status_id.holiday_end_time and status_id.holiday_end_time >= status_id.today: |
|
||||
raise ValidationError(_("You cannot encode new holidays since the previous holidays encoded are not over yet")) |
|
||||
status_id.sudo().write({'holiday_start_time': self.holiday_start_day, 'holiday_end_time': self.holiday_end_day}) |
|
||||
self.env['beesdoo.shift.shift'].sudo().unsubscribe_from_today([self.cooperator_id.id], today=self.holiday_start_day, end_date=self.holiday_end_day) |
|
||||
|
status_id = self.env["cooperative.status"].search( |
||||
|
[("cooperator_id", "=", self.cooperator_id.id)] |
||||
|
) |
||||
|
if ( |
||||
|
status_id.holiday_end_time |
||||
|
and status_id.holiday_end_time >= status_id.today |
||||
|
): |
||||
|
raise ValidationError( |
||||
|
_( |
||||
|
"You cannot encode new holidays since the previous holidays encoded are not over yet" |
||||
|
) |
||||
|
) |
||||
|
status_id.sudo().write( |
||||
|
{ |
||||
|
"holiday_start_time": self.holiday_start_day, |
||||
|
"holiday_end_time": self.holiday_end_day, |
||||
|
} |
||||
|
) |
||||
|
self.env["beesdoo.shift.shift"].sudo().unsubscribe_from_today( |
||||
|
[self.cooperator_id.id], |
||||
|
today=self.holiday_start_day, |
||||
|
end_date=self.holiday_end_day, |
||||
|
) |
@ -1,28 +1,34 @@ |
|||||
from odoo import models, fields, api, _ |
|
||||
|
from odoo import _, api, fields, models |
||||
|
|
||||
|
|
||||
class InstanciatePlanning(models.TransientModel): |
class InstanciatePlanning(models.TransientModel): |
||||
_name = 'beesddoo.shift.generate_planning' |
|
||||
_description = 'beesddoo.shift.generate_planning' |
|
||||
|
_name = "beesddoo.shift.generate_planning" |
||||
|
_description = "beesddoo.shift.generate_planning" |
||||
|
|
||||
def _get_planning(self): |
def _get_planning(self): |
||||
return self._context.get('active_id') |
|
||||
|
return self._context.get("active_id") |
||||
|
|
||||
date_start = fields.Date("First Day of planning (should be monday)", required=True) |
|
||||
planning_id = fields.Many2one('beesdoo.shift.planning', readonly=True, default=_get_planning) |
|
||||
|
date_start = fields.Date( |
||||
|
"First Day of planning (should be monday)", required=True |
||||
|
) |
||||
|
planning_id = fields.Many2one( |
||||
|
"beesdoo.shift.planning", readonly=True, default=_get_planning |
||||
|
) |
||||
|
|
||||
@api.multi |
@api.multi |
||||
def generate_task(self): |
def generate_task(self): |
||||
self.ensure_one() |
self.ensure_one() |
||||
self = self.with_context(visualize_date=self.date_start, tracking_disable=True) |
|
||||
|
self = self.with_context( |
||||
|
visualize_date=self.date_start, tracking_disable=True |
||||
|
) |
||||
shifts = self.planning_id.task_template_ids._generate_task_day() |
shifts = self.planning_id.task_template_ids._generate_task_day() |
||||
return { |
return { |
||||
'name': _('Generated Shift'), |
|
||||
'type': 'ir.actions.act_window', |
|
||||
'view_type': 'form', |
|
||||
'view_mode': 'kanban,calendar,tree,form,pivot', |
|
||||
'res_model': 'beesdoo.shift.shift', |
|
||||
'target': 'current', |
|
||||
'domain': [('id', 'in', shifts.ids)], |
|
||||
'context' : {'search_default_gb_day': 1} |
|
||||
|
"name": _("Generated Shift"), |
||||
|
"type": "ir.actions.act_window", |
||||
|
"view_type": "form", |
||||
|
"view_mode": "kanban,calendar,tree,form,pivot", |
||||
|
"res_model": "beesdoo.shift.shift", |
||||
|
"target": "current", |
||||
|
"domain": [("id", "in", shifts.ids)], |
||||
|
"context": {"search_default_gb_day": 1}, |
||||
} |
} |
@ -1,24 +1,44 @@ |
|||||
from odoo import models, fields, api, _ |
|
||||
|
from odoo import _, api, fields, models |
||||
from odoo.exceptions import ValidationError |
from odoo.exceptions import ValidationError |
||||
|
|
||||
|
|
||||
class TemporaryExemption(models.TransientModel): |
class TemporaryExemption(models.TransientModel): |
||||
_name = 'beesdoo.shift.temporary_exemption' |
|
||||
_description = 'beesdoo.shift.temporary_exemption' |
|
||||
_inherit = 'beesdoo.shift.action_mixin' |
|
||||
|
_name = "beesdoo.shift.temporary_exemption" |
||||
|
_description = "beesdoo.shift.temporary_exemption" |
||||
|
_inherit = "beesdoo.shift.action_mixin" |
||||
|
|
||||
temporary_exempt_reason_id = fields.Many2one('cooperative.exempt.reason', 'Exempt Reason', required=True) |
|
||||
temporary_exempt_start_date = fields.Date(default=fields.Date.today, required=True) |
|
||||
|
temporary_exempt_reason_id = fields.Many2one( |
||||
|
"cooperative.exempt.reason", "Exempt Reason", required=True |
||||
|
) |
||||
|
temporary_exempt_start_date = fields.Date( |
||||
|
default=fields.Date.today, required=True |
||||
|
) |
||||
temporary_exempt_end_date = fields.Date(required=True) |
temporary_exempt_end_date = fields.Date(required=True) |
||||
|
|
||||
@api.multi |
@api.multi |
||||
def exempt(self): |
def exempt(self): |
||||
self = self._check() # maybe a different group |
self = self._check() # maybe a different group |
||||
status_id = self.env['cooperative.status'].search([('cooperator_id', '=', self.cooperator_id.id)]) |
|
||||
if status_id.temporary_exempt_end_date and status_id.temporary_exempt_end_date >= status_id.today: |
|
||||
raise ValidationError(_("You cannot encode new temporary exemptuon since the previous one are not over yet")) |
|
||||
status_id.sudo().write({ |
|
||||
'temporary_exempt_start_date': self.temporary_exempt_start_date, |
|
||||
'temporary_exempt_end_date': self.temporary_exempt_end_date, |
|
||||
'temporary_exempt_reason_id': self.temporary_exempt_reason_id.id, |
|
||||
}) |
|
||||
self.env['beesdoo.shift.shift'].sudo().unsubscribe_from_today([self.cooperator_id.id], today=self.temporary_exempt_start_date, end_date=self.temporary_exempt_end_date) |
|
||||
|
status_id = self.env["cooperative.status"].search( |
||||
|
[("cooperator_id", "=", self.cooperator_id.id)] |
||||
|
) |
||||
|
if ( |
||||
|
status_id.temporary_exempt_end_date |
||||
|
and status_id.temporary_exempt_end_date >= status_id.today |
||||
|
): |
||||
|
raise ValidationError( |
||||
|
_( |
||||
|
"You cannot encode new temporary exemptuon since the previous one are not over yet" |
||||
|
) |
||||
|
) |
||||
|
status_id.sudo().write( |
||||
|
{ |
||||
|
"temporary_exempt_start_date": self.temporary_exempt_start_date, |
||||
|
"temporary_exempt_end_date": self.temporary_exempt_end_date, |
||||
|
"temporary_exempt_reason_id": self.temporary_exempt_reason_id.id, |
||||
|
} |
||||
|
) |
||||
|
self.env["beesdoo.shift.shift"].sudo().unsubscribe_from_today( |
||||
|
[self.cooperator_id.id], |
||||
|
today=self.temporary_exempt_start_date, |
||||
|
end_date=self.temporary_exempt_end_date, |
||||
|
) |
@ -1,2 +1 @@ |
|||||
* Robin Keunen <robin@keunen.net> |
* Robin Keunen <robin@keunen.net> |
||||
|
|
@ -0,0 +1,2 @@ |
|||||
|
* Beescoop - Cellule IT |
||||
|
* Coop IT Easy SCRLfs |
@ -1,23 +1,16 @@ |
|||||
{ |
{ |
||||
'name': 'BEES coop Website Theme', |
|
||||
|
|
||||
'summary': """ |
|
||||
|
"name": "BEES coop Website Theme", |
||||
|
"summary": """ |
||||
Apply BEES coop design rules. |
Apply BEES coop design rules. |
||||
""", |
""", |
||||
'description': """ |
|
||||
|
"description": """ |
||||
""", |
""", |
||||
|
|
||||
'author': 'Rémy Taymans', |
|
||||
'website': "https://github.com/beescoop/Obeesdoo", |
|
||||
|
|
||||
'license': "AGPL-3", |
|
||||
'category': 'Themes', |
|
||||
'version': '12.0.0.1', |
|
||||
'application': True, |
|
||||
|
|
||||
'depends': ['website'], |
|
||||
|
|
||||
'data': [ |
|
||||
'views/assets.xml', |
|
||||
] |
|
||||
|
"author": "Rémy Taymans", |
||||
|
"website": "https://github.com/beescoop/Obeesdoo", |
||||
|
"license": "AGPL-3", |
||||
|
"category": "Themes", |
||||
|
"version": "12.0.0.1", |
||||
|
"application": True, |
||||
|
"depends": ["website"], |
||||
|
"data": ["views/assets.xml"], |
||||
} |
} |
@ -0,0 +1,2 @@ |
|||||
|
* Beescoop - Cellule IT |
||||
|
* Coop IT Easy SCRLfs |
@ -1,28 +1,16 @@ |
|||||
|
# Copyright 2020 Coop IT Easy SCRL fs |
||||
|
# Elouan Le Bars <elouan@coopiteasy.be> |
||||
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). |
||||
{ |
{ |
||||
'name': "Beescoop Worker Status manager", |
|
||||
|
|
||||
'summary': """ |
|
||||
Worker status management specific to beescoop""", |
|
||||
|
|
||||
'description': """ |
|
||||
|
|
||||
""", |
|
||||
|
|
||||
'author': "Thibault Francois, Elouan Le Bars, Coop It Easy", |
|
||||
'website': "https://github.com/beescoop/Obeesdoo", |
|
||||
|
|
||||
'category': 'Cooperative management', |
|
||||
'version': '12.0.1.0.0', |
|
||||
|
|
||||
'depends': [ |
|
||||
'beesdoo_base', |
|
||||
'beesdoo_shift', |
|
||||
], |
|
||||
|
|
||||
'data': [ |
|
||||
], |
|
||||
'demo': [ |
|
||||
"demo/cooperators.xml", |
|
||||
"demo/tasks.xml", |
|
||||
] |
|
||||
|
"name": "Beescoop Worker Status manager", |
||||
|
"summary": """ |
||||
|
Worker status management specific to beescoop.""", |
||||
|
"author": "Thibault Francois, Elouan Le Bars, Coop IT Easy SCRLfs", |
||||
|
"website": "https://github.com/beescoop/Obeesdoo", |
||||
|
"category": "Cooperative management", |
||||
|
"version": "12.0.1.0.0", |
||||
|
"depends": ["beesdoo_base", "beesdoo_shift",], |
||||
|
"data": [], |
||||
|
"demo": ["demo/cooperators.xml", "demo/tasks.xml",], |
||||
|
"license": "AGPL-3", |
||||
} |
} |
@ -1,23 +1,15 @@ |
|||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
||||
{ |
{ |
||||
'name': "Macavrac Base Module", |
|
||||
|
|
||||
'summary': """ |
|
||||
|
"name": "Macavrac Base Module", |
||||
|
"summary": """ |
||||
Module with basic customizations for the Macavrac cooperative. |
Module with basic customizations for the Macavrac cooperative. |
||||
""", |
""", |
||||
|
|
||||
'description': """ |
|
||||
|
"description": """ |
||||
""", |
""", |
||||
|
|
||||
'author': "Patricia Daloze", |
|
||||
|
|
||||
'category': 'Sales', |
|
||||
'version': '12.0.1.0.0', |
|
||||
|
|
||||
'depends': ['beesdoo_shift', 'contacts'], |
|
||||
|
|
||||
'data': [ |
|
||||
'views/res_partner.xml', |
|
||||
], |
|
||||
'installable': True, |
|
||||
|
"author": "Patricia Daloze", |
||||
|
"category": "Sales", |
||||
|
"version": "12.0.1.0.0", |
||||
|
"depends": ["beesdoo_shift", "contacts"], |
||||
|
"data": ["views/res_partner.xml"], |
||||
|
"installable": True, |
||||
} |
} |
@ -1,49 +1,81 @@ |
|||||
from odoo import models, fields, api, _ |
|
||||
|
from odoo import _, api, fields, models |
||||
from odoo.exceptions import ValidationError |
from odoo.exceptions import ValidationError |
||||
|
|
||||
|
|
||||
class Partner(models.Model): |
class Partner(models.Model): |
||||
|
|
||||
_inherit = 'res.partner' |
|
||||
|
_inherit = "res.partner" |
||||
|
|
||||
date_stamp = fields.Date(string="Timestamp", help="Date de remplissage du formulaire") |
|
||||
|
date_stamp = fields.Date( |
||||
|
string="Timestamp", help="Date de remplissage du formulaire" |
||||
|
) |
||||
birthdate = fields.Date(string="Date d'anniversaire") |
birthdate = fields.Date(string="Date d'anniversaire") |
||||
payment_date = fields.Date(string="Date de paiement") |
payment_date = fields.Date(string="Date de paiement") |
||||
certificate_sent_date = fields.Date(string="Certificat envoyé le") |
certificate_sent_date = fields.Date(string="Certificat envoyé le") |
||||
fiscal_certificate_sent_date = fields.Date(string="Attestation fiscale envoyée le") |
|
||||
|
fiscal_certificate_sent_date = fields.Date( |
||||
|
string="Attestation fiscale envoyée le" |
||||
|
) |
||||
|
|
||||
coop_number = fields.Integer(string="Coop N°") |
coop_number = fields.Integer(string="Coop N°") |
||||
share_qty = fields.Integer(string="Nombre de part") |
share_qty = fields.Integer(string="Nombre de part") |
||||
|
|
||||
share_amount = fields.Float(string="Montant", compute="_compute_share_amount") |
|
||||
|
share_amount = fields.Float( |
||||
|
string="Montant", compute="_compute_share_amount" |
||||
|
) |
||||
|
|
||||
gender = fields.Selection([('female','Féminin'),('male','Masculin'),('other','Autre')], string="Genre") |
|
||||
cooperator_type = fields.Selection([('share_a', 'Part A'), ('share_b', 'Part B'), ('share_c', 'Part C'), ('share_d', 'Part D')], string="Type de Part") |
|
||||
state_request = fields.Selection([('ok',"En ordre"),('waiting_payment','En attente de paiement'), |
|
||||
('certificate_to_send', 'Certificat à envoyer'), ('resigning', 'Parts revendues')]) #TODO should we use the cooperative.status model instead? |
|
||||
|
gender = fields.Selection( |
||||
|
[("female", "Féminin"), ("male", "Masculin"), ("other", "Autre")], |
||||
|
string="Genre", |
||||
|
) |
||||
|
cooperator_type = fields.Selection( |
||||
|
[ |
||||
|
("share_a", "Part A"), |
||||
|
("share_b", "Part B"), |
||||
|
("share_c", "Part C"), |
||||
|
("share_d", "Part D"), |
||||
|
], |
||||
|
string="Type de Part", |
||||
|
) |
||||
|
state_request = fields.Selection( |
||||
|
[ |
||||
|
("ok", "En ordre"), |
||||
|
("waiting_payment", "En attente de paiement"), |
||||
|
("certificate_to_send", "Certificat à envoyer"), |
||||
|
("resigning", "Parts revendues"), |
||||
|
] |
||||
|
) # TODO should we use the cooperative.status model instead? |
||||
|
|
||||
national_register_number = fields.Char(string="Numéro de registre national") #TODO add constraint / check consistancy |
|
||||
|
national_register_number = fields.Char( |
||||
|
string="Numéro de registre national" |
||||
|
) # TODO add constraint / check consistancy |
||||
share_numbers = fields.Char(string="Numéro de parts") |
share_numbers = fields.Char(string="Numéro de parts") |
||||
payment_details = fields.Char(string="Détail de paiement") |
payment_details = fields.Char(string="Détail de paiement") |
||||
iban = fields.Char(string="IBAN") #TODO remove. Temp for import purpose. |
|
||||
|
iban = fields.Char(string="IBAN") # TODO remove. Temp for import purpose. |
||||
comment_request = fields.Char(string="Commentaire") |
comment_request = fields.Char(string="Commentaire") |
||||
|
|
||||
email_sent = fields.Boolean(string="Email envoyé") |
email_sent = fields.Boolean(string="Email envoyé") |
||||
is_worker = fields.Boolean(compute="_compute_is_worker", search="_search_is_worker", string="is Worker", readonly=True, related="") |
|
||||
|
|
||||
|
is_worker = fields.Boolean( |
||||
|
compute="_compute_is_worker", |
||||
|
search="_search_is_worker", |
||||
|
string="is Worker", |
||||
|
readonly=True, |
||||
|
related="", |
||||
|
) |
||||
|
|
||||
@api.depends('share_qty') |
|
||||
|
@api.depends("share_qty") |
||||
def _compute_share_amount(self): |
def _compute_share_amount(self): |
||||
for rec in self: |
for rec in self: |
||||
rec.share_amount = rec.share_qty * 25.0 #TODO add ir.config_parameter to make this amount editable |
|
||||
|
|
||||
|
rec.share_amount = ( |
||||
|
rec.share_qty * 25.0 |
||||
|
) # TODO add ir.config_parameter to make this amount editable |
||||
|
|
||||
@api.depends('cooperator_type') |
|
||||
|
@api.depends("cooperator_type") |
||||
def _compute_is_worker(self): |
def _compute_is_worker(self): |
||||
for rec in self: |
for rec in self: |
||||
rec.is_worker = rec.cooperator_type == 'share_b' |
|
||||
|
rec.is_worker = rec.cooperator_type == "share_b" |
||||
|
|
||||
def _search_is_worker(self, operator, value): |
def _search_is_worker(self, operator, value): |
||||
if (operator == '=' and value) or (operator == '!=' and not value): |
|
||||
return [('cooperator_type', '=', 'share_b')] |
|
||||
|
if (operator == "=" and value) or (operator == "!=" and not value): |
||||
|
return [("cooperator_type", "=", "share_b")] |
||||
else: |
else: |
||||
return [('cooperator_type', '!=', 'share_b')] |
|
||||
|
return [("cooperator_type", "!=", "share_b")] |
Write
Preview
Loading…
Cancel
Save
Reference in new issue