Browse Source

[REF] add _description on models

pull/142/head
robin.keunen 5 years ago
parent
commit
9afbaf77ca
  1. 1
      beesdoo_base/models/membercard.py
  2. 1
      beesdoo_base/models/partner.py
  3. 7
      beesdoo_base/wizard/member_card.py
  4. 1
      beesdoo_base/wizard/partner.py
  5. 2
      beesdoo_product/models/beesdoo_product.py
  6. 2
      beesdoo_product/wizard/label_printing_utils.py
  7. 4
      beesdoo_shift/models/cooperative_status.py
  8. 6
      beesdoo_shift/models/planning.py
  9. 1
      beesdoo_shift/wizard/assign_super_coop.py
  10. 4
      beesdoo_shift/wizard/batch_template.py
  11. 1
      beesdoo_shift/wizard/extension.py
  12. 1
      beesdoo_shift/wizard/holiday.py
  13. 3
      beesdoo_shift/wizard/instanciate_planning.py
  14. 2
      beesdoo_shift/wizard/subscribe.py
  15. 1
      beesdoo_shift/wizard/temporary_exemption.py
  16. 1
      beesdoo_shift_attendance/wizard/generate_missing_attendance_sheets.py

1
beesdoo_base/models/membercard.py

@ -14,6 +14,7 @@ class MemberCard(models.Model):
_name = 'member.card' _name = 'member.card'
_order = 'create_date desc' _order = 'create_date desc'
_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) barcode = fields.Char("Barcode", oldname='ean13', default=_compute_bar_code)

1
beesdoo_base/models/partner.py

@ -2,7 +2,6 @@ from odoo import models, fields, api, _
from odoo.exceptions import ValidationError from odoo.exceptions import ValidationError
class Partner(models.Model): class Partner(models.Model):
_inherit = 'res.partner' _inherit = 'res.partner'
eater = fields.Selection([('eater', 'Eater'), ('worker_eater', 'Worker and Eater')], string="Eater/Worker") eater = fields.Selection([('eater', 'Eater'), ('worker_eater', 'Worker and Eater')], string="Eater/Worker")

7
beesdoo_base/wizard/member_card.py

@ -7,6 +7,7 @@ class NewMemberCardWizard(models.TransientModel):
needed and the eater/worker that is concerned. needed and the eater/worker that is concerned.
""" """
_name = 'membercard.new.wizard' _name = 'membercard.new.wizard'
_description = "Member Card"
def _get_default_partner(self): def _get_default_partner(self):
return self.env.context['active_id'] return self.env.context['active_id']
@ -22,9 +23,10 @@ class NewMemberCardWizard(models.TransientModel):
client._new_card(self.new_comment, self.env.uid, barcode=self.force_barcode) client._new_card(self.new_comment, self.env.uid, barcode=self.force_barcode)
client.member_card_to_be_printed = True client.member_card_to_be_printed = True
class RequestMemberCardPrintingWizard(models.TransientModel):
class RequestMemberCardPrintingWizard(models.TransientModel):
_name = 'membercard.requestprinting.wizard' _name = 'membercard.requestprinting.wizard'
_description = "Member Card - Request Print Wizard"
def _get_selected_partners(self): def _get_selected_partners(self):
return self.env.context['active_ids'] return self.env.context['active_ids']
@ -36,9 +38,10 @@ class RequestMemberCardPrintingWizard(models.TransientModel):
def request_printing(self): def request_printing(self):
self.partner_ids.write({'member_card_to_be_printed' : True}) self.partner_ids.write({'member_card_to_be_printed' : True})
class SetAsPrintedWizard(models.TransientModel):
class SetAsPrintedWizard(models.TransientModel):
_name = 'membercard.set_as_printed.wizard' _name = 'membercard.set_as_printed.wizard'
_description = "Member card - Set as printed wizard"
def _get_selected_partners(self): def _get_selected_partners(self):
return self.env.context['active_ids'] return self.env.context['active_ids']

1
beesdoo_base/wizard/partner.py

@ -5,6 +5,7 @@ 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' _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']

2
beesdoo_product/models/beesdoo_product.py

@ -143,6 +143,7 @@ class BeesdooProduct(models.Model):
class BeesdooScaleCategory(models.Model): class BeesdooScaleCategory(models.Model):
_name = "beesdoo.scale.category" _name = "beesdoo.scale.category"
_description = "beesdoo.scale.category"
name = fields.Char(string="Scale name category") name = fields.Char(string="Scale name category")
code = fields.Integer(string="Category code") code = fields.Integer(string="Category code")
@ -153,6 +154,7 @@ class BeesdooScaleCategory(models.Model):
class BeesdooProductLabel(models.Model): class BeesdooProductLabel(models.Model):
_name = "beesdoo.product.label" _name = "beesdoo.product.label"
_description = "beesdoo.product.label"
name = fields.Char() name = fields.Char()
type = fields.Selection([('eco', 'Écologique'), ('local', 'Local'), ('fair', 'Équitable'), ('delivery', 'Distribution')]) type = fields.Selection([('eco', 'Écologique'), ('local', 'Local'), ('fair', 'Équitable'), ('delivery', 'Distribution')])

2
beesdoo_product/wizard/label_printing_utils.py

@ -1,8 +1,8 @@
from odoo import models, fields, api from odoo import models, fields, api
class RequestLabelPrintingWizard(models.TransientModel): class RequestLabelPrintingWizard(models.TransientModel):
_name = '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'] return self.env.context['active_ids']

4
beesdoo_shift/models/cooperative_status.py

@ -14,11 +14,13 @@ def add_days_delta(date_from, days_delta):
class ExemptReason(models.Model): class ExemptReason(models.Model):
_name = 'cooperative.exempt.reason' _name = 'cooperative.exempt.reason'
_description = 'cooperative.exempt.reason'
name = fields.Char(required=True) name = fields.Char(required=True)
class HistoryStatus(models.Model): class HistoryStatus(models.Model):
_name = 'cooperative.status.history' _name = 'cooperative.status.history'
_description = 'cooperative.status.history'
_order= 'create_date desc' _order= 'create_date desc'
@ -30,6 +32,7 @@ class HistoryStatus(models.Model):
class CooperativeStatus(models.Model): class CooperativeStatus(models.Model):
_name = 'cooperative.status' _name = 'cooperative.status'
_description = 'cooperative.status'
_rec_name = 'cooperator_id' _rec_name = 'cooperator_id'
_order = 'cooperator_id' _order = 'cooperator_id'
_period = 28 _period = 28
@ -296,6 +299,7 @@ class CooperativeStatus(models.Model):
class ShiftCronJournal(models.Model): class ShiftCronJournal(models.Model):
_name = 'beesdoo.shift.journal' _name = 'beesdoo.shift.journal'
_description = 'beesdoo.shift.journal'
_order = 'date desc' _order = 'date desc'
_rec_name = 'date' _rec_name = 'date'

6
beesdoo_shift/models/planning.py

@ -21,6 +21,7 @@ def get_first_day_of_week():
class TaskType(models.Model): class TaskType(models.Model):
_name = 'beesdoo.shift.type' _name = 'beesdoo.shift.type'
_description = 'beesdoo.shift.type'
name = fields.Char() name = fields.Char()
description = fields.Text() description = fields.Text()
@ -28,6 +29,7 @@ class TaskType(models.Model):
class DayNumber(models.Model): class DayNumber(models.Model):
_name = 'beesdoo.shift.daynumber' _name = 'beesdoo.shift.daynumber'
_description = 'beesdoo.shift.daynumber'
_order = 'number asc' _order = 'number asc'
@ -37,7 +39,7 @@ class DayNumber(models.Model):
class Planning(models.Model): class Planning(models.Model):
_name = 'beesdoo.shift.planning' _name = 'beesdoo.shift.planning'
_description = 'beesdoo.shift.planning'
_order = 'sequence asc' _order = 'sequence asc'
sequence = fields.Integer() sequence = fields.Integer()
@ -75,7 +77,7 @@ class Planning(models.Model):
class TaskTemplate(models.Model): class TaskTemplate(models.Model):
_name = 'beesdoo.shift.template' _name = 'beesdoo.shift.template'
_description = 'beesdoo.shift.template'
_order = 'start_time' _order = 'start_time'
name = fields.Char(required=True) name = fields.Char(required=True)

1
beesdoo_shift/wizard/assign_super_coop.py

@ -3,6 +3,7 @@ from odoo import models, fields, api, _
class AssignSuperCoop(models.TransientModel): class AssignSuperCoop(models.TransientModel):
_name = '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)]) 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')) shift_ids = fields.Many2many('beesdoo.shift.shift', readonly=True, default=lambda self: self._context.get('active_ids'))

4
beesdoo_shift/wizard/batch_template.py

@ -8,6 +8,7 @@ from odoo import models, fields, api, _
class GenerateShiftTemplate(models.TransientModel): class GenerateShiftTemplate(models.TransientModel):
_name = 'beesddoo.shift.generate_shift_template' _name = 'beesddoo.shift.generate_shift_template'
_description = 'beesddoo.shift.generate_shift_template'
day_ids = fields.Many2many('beesdoo.shift.daynumber', relation='template_gen_day_number_rel', column1='wizard_id', column2='day_id') day_ids = fields.Many2many('beesdoo.shift.daynumber', relation='template_gen_day_number_rel', column1='wizard_id', column2='day_id')
planning_id = fields.Many2one('beesdoo.shift.planning', required=True) planning_id = fields.Many2one('beesdoo.shift.planning', required=True)
@ -45,8 +46,9 @@ class GenerateShiftTemplate(models.TransientModel):
class GenerateShiftTemplateLine(models.TransientModel): class GenerateShiftTemplateLine(models.TransientModel):
_name = 'beesddoo.shift.generate_shift_template.line' _name = 'beesddoo.shift.generate_shift_template.line'
_description = 'beesddoo.shift.generate_shift_template.line'
wizard_id = fields.Many2one('beesddoo.shift.generate_shift_template') wizard_id = fields.Many2one('beesddoo.shift.generate_shift_template')
start_time = fields.Float(required=True) start_time = fields.Float(required=True)
end_time = fields.Float(required=True) end_time = fields.Float(required=True)
worker_nb = fields.Integer(default=1)
worker_nb = fields.Integer(default=1)

1
beesdoo_shift/wizard/extension.py

@ -3,6 +3,7 @@ from odoo.exceptions import UserError
class Subscribe(models.TransientModel): class Subscribe(models.TransientModel):
_name = 'beesdoo.shift.extension' _name = 'beesdoo.shift.extension'
_description = 'beesdoo.shift.extension'
_inherit = 'beesdoo.shift.action_mixin' _inherit = 'beesdoo.shift.action_mixin'
def _get_default_extension_delay(self): def _get_default_extension_delay(self):

1
beesdoo_shift/wizard/holiday.py

@ -3,6 +3,7 @@ from odoo.exceptions import ValidationError
class Subscribe(models.TransientModel): class Subscribe(models.TransientModel):
_name = 'beesdoo.shift.holiday' _name = 'beesdoo.shift.holiday'
_description = 'beesdoo.shift.holiday'
_inherit = 'beesdoo.shift.action_mixin' _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)

3
beesdoo_shift/wizard/instanciate_planning.py

@ -3,6 +3,7 @@ from odoo import models, fields, api, _
class InstanciatePlanning(models.TransientModel): class InstanciatePlanning(models.TransientModel):
_name = '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')
@ -24,4 +25,4 @@ class InstanciatePlanning(models.TransientModel):
'target': 'current', 'target': 'current',
'domain': [('id', 'in', shifts.ids)], 'domain': [('id', 'in', shifts.ids)],
'context' : {'search_default_gb_day': 1} 'context' : {'search_default_gb_day': 1}
}
}

2
beesdoo_shift/wizard/subscribe.py

@ -3,6 +3,7 @@ from odoo.exceptions import UserError
class StatusActionMixin(models.AbstractModel): class StatusActionMixin(models.AbstractModel):
_name = "beesdoo.shift.action_mixin" _name = "beesdoo.shift.action_mixin"
_description = "beesdoo.shift.action_mixin"
cooperator_id = fields.Many2one('res.partner', default=lambda self: self.env['res.partner'].browse(self._context.get('active_id')), required=True) cooperator_id = fields.Many2one('res.partner', default=lambda self: self.env['res.partner'].browse(self._context.get('active_id')), required=True)
@ -16,6 +17,7 @@ class StatusActionMixin(models.AbstractModel):
class Subscribe(models.TransientModel): class Subscribe(models.TransientModel):
_name = 'beesdoo.shift.subscribe' _name = 'beesdoo.shift.subscribe'
_description = 'beesdoo.shift.subscribe'
_inherit = 'beesdoo.shift.action_mixin' _inherit = 'beesdoo.shift.action_mixin'
def _get_date(self): def _get_date(self):

1
beesdoo_shift/wizard/temporary_exemption.py

@ -3,6 +3,7 @@ from odoo.exceptions import ValidationError
class TemporaryExemption(models.TransientModel): class TemporaryExemption(models.TransientModel):
_name = 'beesdoo.shift.temporary_exemption' _name = 'beesdoo.shift.temporary_exemption'
_description = 'beesdoo.shift.temporary_exemption'
_inherit = 'beesdoo.shift.action_mixin' _inherit = 'beesdoo.shift.action_mixin'
temporary_exempt_reason_id = fields.Many2one('cooperative.exempt.reason', 'Exempt Reason', required=True) temporary_exempt_reason_id = fields.Many2one('cooperative.exempt.reason', 'Exempt Reason', required=True)

1
beesdoo_shift_attendance/wizard/generate_missing_attendance_sheets.py

@ -10,6 +10,7 @@ class GenerateMissingAttendanceSheets(models.TransientModel):
""" """
_name = "beesdoo.shift.generate_missing_attendance_sheets" _name = "beesdoo.shift.generate_missing_attendance_sheets"
_description = "beesdoo.shift.generate_missing_attendance_sheets"
date_start = fields.Datetime("Start date", required=True) date_start = fields.Datetime("Start date", required=True)
date_end = fields.Datetime("End date", required=True) date_end = fields.Datetime("End date", required=True)

Loading…
Cancel
Save