add list of booking lines on scheduled bookings
This commit is contained in:
parent
be92110ae1
commit
9b0af0d64e
7 changed files with 118 additions and 3 deletions
21
planner.py
21
planner.py
|
@ -151,6 +151,10 @@ class ScheduledBooking(DeactivableMixin, ModelSQL, ModelView):
|
|||
booking_target = fields.Function(fields.Reference(
|
||||
string='Target', selection='get_booking_modelnames', readonly=True),
|
||||
'on_change_with_booking_target')
|
||||
cashbook_lines = fields.Many2Many(
|
||||
string='Cashbook lines', relation_name='cashbook.planner_rel',
|
||||
help='This cash book lines was generated by the current ' +
|
||||
'scheduled booking.', origin='planner', target='line')
|
||||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
|
@ -664,6 +668,7 @@ class ScheduledBooking(DeactivableMixin, ModelSQL, ModelView):
|
|||
line.update(add_asset_values(
|
||||
line, record.cashbook, record.booktransf))
|
||||
line['description'] = cls.fill_placeholder(line)
|
||||
line['planners'] = [('add', [record.id])]
|
||||
|
||||
if record.wfcheck:
|
||||
to_create_check.append(line)
|
||||
|
@ -694,4 +699,18 @@ class ScheduledBooking(DeactivableMixin, ModelSQL, ModelView):
|
|||
records,
|
||||
query_date=query_date + timedelta(days=1))
|
||||
|
||||
# ens ScheduledBooking
|
||||
# end ScheduledBooking
|
||||
|
||||
|
||||
class ScheduledBookingCashbookRel(ModelSQL):
|
||||
'Scheduled Booking - Cashbook Line - Relation'
|
||||
__name__ = 'cashbook.planner_rel'
|
||||
|
||||
planner = fields.Many2One(
|
||||
string='Scheduled Booking', required=True,
|
||||
model_name='cashbook.planner', ondelete='CASCADE')
|
||||
line = fields.Many2One(
|
||||
string='Cashbook Line', required=True,
|
||||
model_name='cashbook.line', ondelete='CASCADE')
|
||||
|
||||
# end ScheduledBookingCashbookRel
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue