Compare commits
7 commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
6f27beb7a6 | ||
![]() |
722b265c33 | ||
![]() |
a3cba97892 | ||
![]() |
12839d06db | ||
![]() |
b47517c4d8 | ||
![]() |
b321965515 | ||
![]() |
170f5885d2 |
9 changed files with 43 additions and 13 deletions
12
README.rst
12
README.rst
|
@ -14,6 +14,14 @@ Requires
|
||||||
Changes
|
Changes
|
||||||
=======
|
=======
|
||||||
|
|
||||||
*7.0.0 - 24.02.2024*
|
*7.0.3 - 10.03.2024*
|
||||||
|
|
||||||
- init
|
- new placeholder 'rate' for description of booking
|
||||||
|
|
||||||
|
*7.0.2 - 10.03.2024*
|
||||||
|
|
||||||
|
- fix permissions
|
||||||
|
|
||||||
|
*7.0.1 - 09.03.2024*
|
||||||
|
|
||||||
|
- works
|
||||||
|
|
|
@ -7,6 +7,7 @@ full copyright notices and license terms. -->
|
||||||
|
|
||||||
<record model="res.group" id="group_planner">
|
<record model="res.group" id="group_planner">
|
||||||
<field name="name">Cashbook - Scheduled Bookings</field>
|
<field name="name">Cashbook - Scheduled Bookings</field>
|
||||||
|
<field name="parent" ref="cashbook.group_cashbook"/>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record model="res.user-res.group" id="user_admin-group_planner">
|
<record model="res.user-res.group" id="user_admin-group_planner">
|
||||||
|
|
4
ir.py
4
ir.py
|
@ -14,7 +14,9 @@ class Rule(metaclass=PoolMeta):
|
||||||
""" list of models to add 'user_id' to context
|
""" list of models to add 'user_id' to context
|
||||||
"""
|
"""
|
||||||
result = super(Rule, cls)._context_modelnames()
|
result = super(Rule, cls)._context_modelnames()
|
||||||
result.append('cashbook.planner')
|
result.extend([
|
||||||
|
'cashbook.planner',
|
||||||
|
'cashbook.planner.nextrun'])
|
||||||
return result
|
return result
|
||||||
|
|
||||||
# end Rule
|
# end Rule
|
||||||
|
|
|
@ -107,8 +107,8 @@ msgid "Booking text"
|
||||||
msgstr "Buchungstext"
|
msgstr "Buchungstext"
|
||||||
|
|
||||||
msgctxt "view:cashbook.planner:"
|
msgctxt "view:cashbook.planner:"
|
||||||
msgid "Available placeholders: ${date} ${month} ${year} ${amount} ${quantity}"
|
msgid "Available placeholders: ${date} ${month} ${year} ${amount} ${quantity} ${rate}"
|
||||||
msgstr "verfügbare Platzhalter: ${date} ${month} ${year} ${amount} ${quantity}"
|
msgstr "verfügbare Platzhalter: ${date} ${month} ${year} ${amount} ${quantity} ${rate}"
|
||||||
|
|
||||||
msgctxt "view:cashbook.planner:"
|
msgctxt "view:cashbook.planner:"
|
||||||
msgid "Cashbook lines"
|
msgid "Cashbook lines"
|
||||||
|
@ -318,6 +318,10 @@ msgctxt "help:cashbook.planner,cashbook_lines:"
|
||||||
msgid "This cash book lines was generated by the current scheduled booking."
|
msgid "This cash book lines was generated by the current scheduled booking."
|
||||||
msgstr "Diese Kassenbuchzeilen wurden durch die aktuelle geplante Buchung generiert."
|
msgstr "Diese Kassenbuchzeilen wurden durch die aktuelle geplante Buchung generiert."
|
||||||
|
|
||||||
|
msgctxt "field:cashbook.planner,party:"
|
||||||
|
msgid "Party"
|
||||||
|
msgstr "Partei"
|
||||||
|
|
||||||
|
|
||||||
############################
|
############################
|
||||||
# cashbook.planner.nextrun #
|
# cashbook.planner.nextrun #
|
||||||
|
|
|
@ -83,8 +83,8 @@ msgid "Booking text"
|
||||||
msgstr "Booking text"
|
msgstr "Booking text"
|
||||||
|
|
||||||
msgctxt "view:cashbook.planner:"
|
msgctxt "view:cashbook.planner:"
|
||||||
msgid "Available placeholders: ${date} ${month} ${year} ${amount} ${quantity}"
|
msgid "Available placeholders: ${date} ${month} ${year} ${amount} ${quantity} ${rate}"
|
||||||
msgstr "Available placeholders: ${date} ${month} ${year} ${amount} ${quantity}"
|
msgstr "Available placeholders: ${date} ${month} ${year} ${amount} ${quantity} ${rate}"
|
||||||
|
|
||||||
msgctxt "view:cashbook.planner:"
|
msgctxt "view:cashbook.planner:"
|
||||||
msgid "Cashbook lines"
|
msgid "Cashbook lines"
|
||||||
|
@ -294,6 +294,10 @@ msgctxt "help:cashbook.planner,cashbook_lines:"
|
||||||
msgid "This cash book lines was generated by the current scheduled booking."
|
msgid "This cash book lines was generated by the current scheduled booking."
|
||||||
msgstr "This cash book lines was generated by the current scheduled booking."
|
msgstr "This cash book lines was generated by the current scheduled booking."
|
||||||
|
|
||||||
|
msgctxt "field:cashbook.planner,party:"
|
||||||
|
msgid "Party"
|
||||||
|
msgstr "Party"
|
||||||
|
|
||||||
msgctxt "model:cashbook.planner.nextrun,name:"
|
msgctxt "model:cashbook.planner.nextrun,name:"
|
||||||
msgid "Next Execution Date"
|
msgid "Next Execution Date"
|
||||||
msgstr "Next Execution Date"
|
msgstr "Next Execution Date"
|
||||||
|
|
12
planner.py
12
planner.py
|
@ -515,6 +515,15 @@ class ScheduledBooking(DeactivableMixin, ModelSQL, ModelView):
|
||||||
quantity_txt = Report.format_number(
|
quantity_txt = Report.format_number(
|
||||||
quantity, lang=None, digits=uom_digits)
|
quantity, lang=None, digits=uom_digits)
|
||||||
|
|
||||||
|
asset_rate = '-'
|
||||||
|
if quantity and amount is not None:
|
||||||
|
asset_rate = '%(rate)s %(currency)s/%(uom)s' % {
|
||||||
|
'rate': Report.format_number(
|
||||||
|
amount / quantity, lang=None,
|
||||||
|
digits=to_book.currency.digits),
|
||||||
|
'currency': to_book.currency.symbol,
|
||||||
|
'uom': to_book.quantity_uom.symbol}
|
||||||
|
|
||||||
return Template(linedata.get('description')).safe_substitute({
|
return Template(linedata.get('description')).safe_substitute({
|
||||||
'date': Report.format_date(line_date, lang=None),
|
'date': Report.format_date(line_date, lang=None),
|
||||||
'month': line_date.month,
|
'month': line_date.month,
|
||||||
|
@ -522,7 +531,8 @@ class ScheduledBooking(DeactivableMixin, ModelSQL, ModelView):
|
||||||
'amount': Report.format_currency(
|
'amount': Report.format_currency(
|
||||||
amount, lang=None, currency=from_book.currency)
|
amount, lang=None, currency=from_book.currency)
|
||||||
if (amount is not None) and from_book else '-',
|
if (amount is not None) and from_book else '-',
|
||||||
'quantity': quantity_txt})
|
'quantity': quantity_txt,
|
||||||
|
'rate': asset_rate})
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def update_next_occurence(cls, records, query_date=None):
|
def update_next_occurence(cls, records, query_date=None):
|
||||||
|
|
|
@ -364,12 +364,13 @@ class PlannerTestCase(object):
|
||||||
asset_book = self.prep_planner_asset_book()
|
asset_book = self.prep_planner_asset_book()
|
||||||
self.assertEqual(Planner.fill_placeholder({
|
self.assertEqual(Planner.fill_placeholder({
|
||||||
'date': date(2022, 5, 2),
|
'date': date(2022, 5, 2),
|
||||||
'amount': Decimal('12.4567'),
|
'amount': Decimal('126.4567'),
|
||||||
'quantity': Decimal('32.4423'),
|
'quantity': Decimal('32.4423'),
|
||||||
'cashbook': asset_book.id,
|
'cashbook': asset_book.id,
|
||||||
|
'booktransf': asset_book.id,
|
||||||
'description': '- ${amount} - ${date} - ${month} - ' +
|
'description': '- ${amount} - ${date} - ${month} - ' +
|
||||||
'${year} - ${quantity}'}),
|
'${year} - ${quantity} - ${rate}'}),
|
||||||
'- usd12.46 - 05/02/2022 - 5 - 2022 - 32.4423\xa0u')
|
'- usd126.46 - 05/02/2022 - 5 - 2022 - 32.4423\xa0u - 3.90 usd/u')
|
||||||
|
|
||||||
@with_transaction()
|
@with_transaction()
|
||||||
def test_planner_cronjobs_booking_with_category(self):
|
def test_planner_cronjobs_booking_with_category(self):
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[tryton]
|
[tryton]
|
||||||
version=7.0.0
|
version=7.0.3
|
||||||
depends:
|
depends:
|
||||||
cashbook
|
cashbook
|
||||||
extras_depend:
|
extras_depend:
|
||||||
|
|
|
@ -59,7 +59,7 @@ full copyright notices and license terms. -->
|
||||||
<separator name="subject" colspan="4" string="Booking text"/>
|
<separator name="subject" colspan="4" string="Booking text"/>
|
||||||
<field name="subject" colspan="4"/>
|
<field name="subject" colspan="4"/>
|
||||||
<label id="lab1" colspan="4" xalign="0.0"
|
<label id="lab1" colspan="4" xalign="0.0"
|
||||||
string="Available placeholders: ${date} ${month} ${year} ${amount} ${quantity}"/>
|
string="Available placeholders: ${date} ${month} ${year} ${amount} ${quantity} ${rate}"/>
|
||||||
</page>
|
</page>
|
||||||
<page name="description" col="1" string="Description">
|
<page name="description" col="1" string="Description">
|
||||||
<field name="description"/>
|
<field name="description"/>
|
||||||
|
|
Loading…
Reference in a new issue