first commit
This commit is contained in:
2
modules/sale_history/__init__.py
Normal file
2
modules/sale_history/__init__.py
Normal file
@@ -0,0 +1,2 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
BIN
modules/sale_history/__pycache__/__init__.cpython-311.pyc
Normal file
BIN
modules/sale_history/__pycache__/__init__.cpython-311.pyc
Normal file
Binary file not shown.
BIN
modules/sale_history/__pycache__/sale.cpython-311.pyc
Normal file
BIN
modules/sale_history/__pycache__/sale.cpython-311.pyc
Normal file
Binary file not shown.
19
modules/sale_history/locale/bg.po
Normal file
19
modules/sale_history/locale/bg.po
Normal file
@@ -0,0 +1,19 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:sale.sale,revision:"
|
||||
msgid "Revision"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "field:sale.subscription,revision:"
|
||||
msgid "Revision"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "view:sale.sale:"
|
||||
msgid "/"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "view:sale.subscription:"
|
||||
msgid "/"
|
||||
msgstr ""
|
||||
19
modules/sale_history/locale/ca.po
Normal file
19
modules/sale_history/locale/ca.po
Normal file
@@ -0,0 +1,19 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:sale.sale,revision:"
|
||||
msgid "Revision"
|
||||
msgstr "Revisió"
|
||||
|
||||
msgctxt "field:sale.subscription,revision:"
|
||||
msgid "Revision"
|
||||
msgstr "Revisió"
|
||||
|
||||
msgctxt "view:sale.sale:"
|
||||
msgid "/"
|
||||
msgstr "/"
|
||||
|
||||
msgctxt "view:sale.subscription:"
|
||||
msgid "/"
|
||||
msgstr "/"
|
||||
19
modules/sale_history/locale/cs.po
Normal file
19
modules/sale_history/locale/cs.po
Normal file
@@ -0,0 +1,19 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:sale.sale,revision:"
|
||||
msgid "Revision"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "field:sale.subscription,revision:"
|
||||
msgid "Revision"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "view:sale.sale:"
|
||||
msgid "/"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "view:sale.subscription:"
|
||||
msgid "/"
|
||||
msgstr ""
|
||||
19
modules/sale_history/locale/de.po
Normal file
19
modules/sale_history/locale/de.po
Normal file
@@ -0,0 +1,19 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:sale.sale,revision:"
|
||||
msgid "Revision"
|
||||
msgstr "Version"
|
||||
|
||||
msgctxt "field:sale.subscription,revision:"
|
||||
msgid "Revision"
|
||||
msgstr "Version"
|
||||
|
||||
msgctxt "view:sale.sale:"
|
||||
msgid "/"
|
||||
msgstr "/"
|
||||
|
||||
msgctxt "view:sale.subscription:"
|
||||
msgid "/"
|
||||
msgstr "/"
|
||||
19
modules/sale_history/locale/es.po
Normal file
19
modules/sale_history/locale/es.po
Normal file
@@ -0,0 +1,19 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:sale.sale,revision:"
|
||||
msgid "Revision"
|
||||
msgstr "Revisión"
|
||||
|
||||
msgctxt "field:sale.subscription,revision:"
|
||||
msgid "Revision"
|
||||
msgstr "Revisión"
|
||||
|
||||
msgctxt "view:sale.sale:"
|
||||
msgid "/"
|
||||
msgstr "/"
|
||||
|
||||
msgctxt "view:sale.subscription:"
|
||||
msgid "/"
|
||||
msgstr "/"
|
||||
19
modules/sale_history/locale/es_419.po
Normal file
19
modules/sale_history/locale/es_419.po
Normal file
@@ -0,0 +1,19 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:sale.sale,revision:"
|
||||
msgid "Revision"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "field:sale.subscription,revision:"
|
||||
msgid "Revision"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "view:sale.sale:"
|
||||
msgid "/"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "view:sale.subscription:"
|
||||
msgid "/"
|
||||
msgstr ""
|
||||
19
modules/sale_history/locale/et.po
Normal file
19
modules/sale_history/locale/et.po
Normal file
@@ -0,0 +1,19 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:sale.sale,revision:"
|
||||
msgid "Revision"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "field:sale.subscription,revision:"
|
||||
msgid "Revision"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "view:sale.sale:"
|
||||
msgid "/"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "view:sale.subscription:"
|
||||
msgid "/"
|
||||
msgstr ""
|
||||
19
modules/sale_history/locale/fa.po
Normal file
19
modules/sale_history/locale/fa.po
Normal file
@@ -0,0 +1,19 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:sale.sale,revision:"
|
||||
msgid "Revision"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "field:sale.subscription,revision:"
|
||||
msgid "Revision"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "view:sale.sale:"
|
||||
msgid "/"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "view:sale.subscription:"
|
||||
msgid "/"
|
||||
msgstr ""
|
||||
19
modules/sale_history/locale/fi.po
Normal file
19
modules/sale_history/locale/fi.po
Normal file
@@ -0,0 +1,19 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:sale.sale,revision:"
|
||||
msgid "Revision"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "field:sale.subscription,revision:"
|
||||
msgid "Revision"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "view:sale.sale:"
|
||||
msgid "/"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "view:sale.subscription:"
|
||||
msgid "/"
|
||||
msgstr ""
|
||||
19
modules/sale_history/locale/fr.po
Normal file
19
modules/sale_history/locale/fr.po
Normal file
@@ -0,0 +1,19 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:sale.sale,revision:"
|
||||
msgid "Revision"
|
||||
msgstr "Révision"
|
||||
|
||||
msgctxt "field:sale.subscription,revision:"
|
||||
msgid "Revision"
|
||||
msgstr "Révision"
|
||||
|
||||
msgctxt "view:sale.sale:"
|
||||
msgid "/"
|
||||
msgstr "/"
|
||||
|
||||
msgctxt "view:sale.subscription:"
|
||||
msgid "/"
|
||||
msgstr "/"
|
||||
19
modules/sale_history/locale/hu.po
Normal file
19
modules/sale_history/locale/hu.po
Normal file
@@ -0,0 +1,19 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:sale.sale,revision:"
|
||||
msgid "Revision"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "field:sale.subscription,revision:"
|
||||
msgid "Revision"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "view:sale.sale:"
|
||||
msgid "/"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "view:sale.subscription:"
|
||||
msgid "/"
|
||||
msgstr ""
|
||||
21
modules/sale_history/locale/id.po
Normal file
21
modules/sale_history/locale/id.po
Normal file
@@ -0,0 +1,21 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:sale.sale,revision:"
|
||||
msgid "Revision"
|
||||
msgstr "Revisi"
|
||||
|
||||
#, fuzzy
|
||||
msgctxt "field:sale.subscription,revision:"
|
||||
msgid "Revision"
|
||||
msgstr "Revisi"
|
||||
|
||||
msgctxt "view:sale.sale:"
|
||||
msgid "/"
|
||||
msgstr "/"
|
||||
|
||||
#, fuzzy
|
||||
msgctxt "view:sale.subscription:"
|
||||
msgid "/"
|
||||
msgstr "/"
|
||||
19
modules/sale_history/locale/it.po
Normal file
19
modules/sale_history/locale/it.po
Normal file
@@ -0,0 +1,19 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:sale.sale,revision:"
|
||||
msgid "Revision"
|
||||
msgstr "Revisione"
|
||||
|
||||
msgctxt "field:sale.subscription,revision:"
|
||||
msgid "Revision"
|
||||
msgstr "Revisione"
|
||||
|
||||
msgctxt "view:sale.sale:"
|
||||
msgid "/"
|
||||
msgstr "/"
|
||||
|
||||
msgctxt "view:sale.subscription:"
|
||||
msgid "/"
|
||||
msgstr "/"
|
||||
19
modules/sale_history/locale/lo.po
Normal file
19
modules/sale_history/locale/lo.po
Normal file
@@ -0,0 +1,19 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:sale.sale,revision:"
|
||||
msgid "Revision"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "field:sale.subscription,revision:"
|
||||
msgid "Revision"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "view:sale.sale:"
|
||||
msgid "/"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "view:sale.subscription:"
|
||||
msgid "/"
|
||||
msgstr ""
|
||||
19
modules/sale_history/locale/lt.po
Normal file
19
modules/sale_history/locale/lt.po
Normal file
@@ -0,0 +1,19 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:sale.sale,revision:"
|
||||
msgid "Revision"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "field:sale.subscription,revision:"
|
||||
msgid "Revision"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "view:sale.sale:"
|
||||
msgid "/"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "view:sale.subscription:"
|
||||
msgid "/"
|
||||
msgstr ""
|
||||
19
modules/sale_history/locale/nl.po
Normal file
19
modules/sale_history/locale/nl.po
Normal file
@@ -0,0 +1,19 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:sale.sale,revision:"
|
||||
msgid "Revision"
|
||||
msgstr "Herziening"
|
||||
|
||||
msgctxt "field:sale.subscription,revision:"
|
||||
msgid "Revision"
|
||||
msgstr "Revisie"
|
||||
|
||||
msgctxt "view:sale.sale:"
|
||||
msgid "/"
|
||||
msgstr "/"
|
||||
|
||||
msgctxt "view:sale.subscription:"
|
||||
msgid "/"
|
||||
msgstr "/"
|
||||
21
modules/sale_history/locale/pl.po
Normal file
21
modules/sale_history/locale/pl.po
Normal file
@@ -0,0 +1,21 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:sale.sale,revision:"
|
||||
msgid "Revision"
|
||||
msgstr "Wersja"
|
||||
|
||||
#, fuzzy
|
||||
msgctxt "field:sale.subscription,revision:"
|
||||
msgid "Revision"
|
||||
msgstr "Wersja"
|
||||
|
||||
msgctxt "view:sale.sale:"
|
||||
msgid "/"
|
||||
msgstr "/"
|
||||
|
||||
#, fuzzy
|
||||
msgctxt "view:sale.subscription:"
|
||||
msgid "/"
|
||||
msgstr "/"
|
||||
20
modules/sale_history/locale/pt.po
Normal file
20
modules/sale_history/locale/pt.po
Normal file
@@ -0,0 +1,20 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:sale.sale,revision:"
|
||||
msgid "Revision"
|
||||
msgstr "Revisão"
|
||||
|
||||
#, fuzzy
|
||||
msgctxt "field:sale.subscription,revision:"
|
||||
msgid "Revision"
|
||||
msgstr "Revisão"
|
||||
|
||||
msgctxt "view:sale.sale:"
|
||||
msgid "/"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "view:sale.subscription:"
|
||||
msgid "/"
|
||||
msgstr ""
|
||||
19
modules/sale_history/locale/ro.po
Normal file
19
modules/sale_history/locale/ro.po
Normal file
@@ -0,0 +1,19 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:sale.sale,revision:"
|
||||
msgid "Revision"
|
||||
msgstr "Revizuire"
|
||||
|
||||
msgctxt "field:sale.subscription,revision:"
|
||||
msgid "Revision"
|
||||
msgstr "Revizie"
|
||||
|
||||
msgctxt "view:sale.sale:"
|
||||
msgid "/"
|
||||
msgstr "/"
|
||||
|
||||
msgctxt "view:sale.subscription:"
|
||||
msgid "/"
|
||||
msgstr "/"
|
||||
19
modules/sale_history/locale/ru.po
Normal file
19
modules/sale_history/locale/ru.po
Normal file
@@ -0,0 +1,19 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:sale.sale,revision:"
|
||||
msgid "Revision"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "field:sale.subscription,revision:"
|
||||
msgid "Revision"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "view:sale.sale:"
|
||||
msgid "/"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "view:sale.subscription:"
|
||||
msgid "/"
|
||||
msgstr ""
|
||||
19
modules/sale_history/locale/sl.po
Normal file
19
modules/sale_history/locale/sl.po
Normal file
@@ -0,0 +1,19 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:sale.sale,revision:"
|
||||
msgid "Revision"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "field:sale.subscription,revision:"
|
||||
msgid "Revision"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "view:sale.sale:"
|
||||
msgid "/"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "view:sale.subscription:"
|
||||
msgid "/"
|
||||
msgstr ""
|
||||
19
modules/sale_history/locale/tr.po
Normal file
19
modules/sale_history/locale/tr.po
Normal file
@@ -0,0 +1,19 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:sale.sale,revision:"
|
||||
msgid "Revision"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "field:sale.subscription,revision:"
|
||||
msgid "Revision"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "view:sale.sale:"
|
||||
msgid "/"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "view:sale.subscription:"
|
||||
msgid "/"
|
||||
msgstr ""
|
||||
19
modules/sale_history/locale/uk.po
Normal file
19
modules/sale_history/locale/uk.po
Normal file
@@ -0,0 +1,19 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:sale.sale,revision:"
|
||||
msgid "Revision"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "field:sale.subscription,revision:"
|
||||
msgid "Revision"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "view:sale.sale:"
|
||||
msgid "/"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "view:sale.subscription:"
|
||||
msgid "/"
|
||||
msgstr ""
|
||||
19
modules/sale_history/locale/zh_CN.po
Normal file
19
modules/sale_history/locale/zh_CN.po
Normal file
@@ -0,0 +1,19 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:sale.sale,revision:"
|
||||
msgid "Revision"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "field:sale.subscription,revision:"
|
||||
msgid "Revision"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "view:sale.sale:"
|
||||
msgid "/"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "view:sale.subscription:"
|
||||
msgid "/"
|
||||
msgstr ""
|
||||
77
modules/sale_history/sale.py
Normal file
77
modules/sale_history/sale.py
Normal file
@@ -0,0 +1,77 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
|
||||
from trytond.model import ModelView, Workflow, fields
|
||||
from trytond.pool import PoolMeta
|
||||
from trytond.pyson import Eval
|
||||
from trytond.tools import grouped_slice, reduce_ids
|
||||
from trytond.transaction import Transaction
|
||||
|
||||
|
||||
class RevisionMixin:
|
||||
__slots__ = ()
|
||||
revision = fields.Integer(
|
||||
"Revision", required=True, readonly=True,
|
||||
states={
|
||||
'invisible': Eval('revision', 0) == 0,
|
||||
})
|
||||
|
||||
@classmethod
|
||||
def default_revision(cls):
|
||||
return 0
|
||||
|
||||
@property
|
||||
def full_number(self):
|
||||
number = super().full_number
|
||||
if number is not None and self.revision:
|
||||
number += '/%d' % self.revision
|
||||
return number
|
||||
|
||||
@classmethod
|
||||
def copy(cls, records, default=None):
|
||||
default = default.copy() if default is not None else {}
|
||||
default.setdefault('revision', cls.default_revision())
|
||||
return super().copy(records, default=default)
|
||||
|
||||
@classmethod
|
||||
@ModelView.button
|
||||
@Workflow.transition('draft')
|
||||
def draft(cls, records):
|
||||
cursor = Transaction().connection.cursor()
|
||||
table = cls.__table__()
|
||||
|
||||
# Use SQL and before super to avoid two history entries
|
||||
for sub_records in grouped_slice(records):
|
||||
cursor.execute(*table.update(
|
||||
[table.revision],
|
||||
[table.revision + 1],
|
||||
where=reduce_ids(table.id, sub_records)))
|
||||
|
||||
super().draft(records)
|
||||
|
||||
|
||||
class Sale(RevisionMixin, metaclass=PoolMeta):
|
||||
__name__ = 'sale.sale'
|
||||
_history = True
|
||||
|
||||
|
||||
class Line(metaclass=PoolMeta):
|
||||
__name__ = 'sale.line'
|
||||
_history = True
|
||||
|
||||
|
||||
class LineTax(metaclass=PoolMeta):
|
||||
__name__ = 'sale.line-account.tax'
|
||||
_history = True
|
||||
|
||||
|
||||
class Subscription(RevisionMixin, metaclass=PoolMeta):
|
||||
__name__ = 'sale.subscription'
|
||||
_history = True
|
||||
|
||||
|
||||
class SubscriptionLine(metaclass=PoolMeta):
|
||||
__name__ = 'sale.subscription.line'
|
||||
_history = True
|
||||
|
||||
# TODO: add rental
|
||||
30
modules/sale_history/sale.xml
Normal file
30
modules/sale_history/sale.xml
Normal file
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
this repository contains the full copyright notices and license terms. -->
|
||||
<tryton>
|
||||
<data>
|
||||
<record model="ir.ui.view" id="sale_view_form">
|
||||
<field name="model">sale.sale</field>
|
||||
<field name="inherit" ref="sale.sale_view_form"/>
|
||||
<field name="name">sale_form</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="sale_view_tree">
|
||||
<field name="model">sale.sale</field>
|
||||
<field name="inherit" ref="sale.sale_view_tree"/>
|
||||
<field name="name">sale_tree</field>
|
||||
</record>
|
||||
</data>
|
||||
<data depends="sale_subscription">
|
||||
<record model="ir.ui.view" id="subscription_view_form">
|
||||
<field name="model">sale.subscription</field>
|
||||
<field name="inherit" ref="sale_subscription.subscription_view_form"/>
|
||||
<field name="name">sale_form</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="subscription_view_list">
|
||||
<field name="model">sale.subscription</field>
|
||||
<field name="inherit" ref="sale_subscription.subscription_view_list"/>
|
||||
<field name="name">sale_tree</field>
|
||||
</record>
|
||||
</data>
|
||||
|
||||
</tryton>
|
||||
2
modules/sale_history/tests/__init__.py
Normal file
2
modules/sale_history/tests/__init__.py
Normal file
@@ -0,0 +1,2 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
BIN
modules/sale_history/tests/__pycache__/__init__.cpython-311.pyc
Normal file
BIN
modules/sale_history/tests/__pycache__/__init__.cpython-311.pyc
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
42
modules/sale_history/tests/scenario_sale_history.rst
Normal file
42
modules/sale_history/tests/scenario_sale_history.rst
Normal file
@@ -0,0 +1,42 @@
|
||||
=====================
|
||||
Sale History Scenario
|
||||
=====================
|
||||
|
||||
Imports::
|
||||
|
||||
>>> from proteus import Model
|
||||
>>> from trytond.modules.company.tests.tools import create_company
|
||||
>>> from trytond.tests.tools import activate_modules
|
||||
|
||||
Activate modules::
|
||||
|
||||
>>> config = activate_modules('sale_history', create_company)
|
||||
|
||||
Create customer::
|
||||
|
||||
>>> Party = Model.get('party.party')
|
||||
>>> customer = Party(name='Customer')
|
||||
>>> customer.save()
|
||||
|
||||
Create a sale::
|
||||
|
||||
>>> Sale = Model.get('sale.sale')
|
||||
>>> sale = Sale()
|
||||
>>> sale.party = customer
|
||||
>>> sale.click('quote')
|
||||
|
||||
>>> sale.number
|
||||
'1'
|
||||
>>> sale.revision
|
||||
0
|
||||
>>> sale.rec_name
|
||||
'1'
|
||||
|
||||
Reset to draft increases revision::
|
||||
|
||||
>>> sale.click('draft')
|
||||
|
||||
>>> sale.revision
|
||||
1
|
||||
>>> sale.rec_name
|
||||
'1/1'
|
||||
13
modules/sale_history/tests/test_module.py
Normal file
13
modules/sale_history/tests/test_module.py
Normal file
@@ -0,0 +1,13 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
|
||||
from trytond.tests.test_tryton import ModuleTestCase
|
||||
|
||||
|
||||
class SaleHistoryTestCase(ModuleTestCase):
|
||||
'Test Sale History module'
|
||||
module = 'sale_history'
|
||||
extras = ['sale_subscription']
|
||||
|
||||
|
||||
del ModuleTestCase
|
||||
8
modules/sale_history/tests/test_scenario.py
Normal file
8
modules/sale_history/tests/test_scenario.py
Normal file
@@ -0,0 +1,8 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
|
||||
from trytond.tests.test_tryton import load_doc_tests
|
||||
|
||||
|
||||
def load_tests(*args, **kwargs):
|
||||
return load_doc_tests(__name__, __file__, *args, **kwargs)
|
||||
20
modules/sale_history/tryton.cfg
Normal file
20
modules/sale_history/tryton.cfg
Normal file
@@ -0,0 +1,20 @@
|
||||
[tryton]
|
||||
version=7.8.0
|
||||
depends:
|
||||
ir
|
||||
sale
|
||||
extras_depend:
|
||||
sale_subscription
|
||||
xml:
|
||||
sale.xml
|
||||
|
||||
[register]
|
||||
model:
|
||||
sale.Sale
|
||||
sale.Line
|
||||
sale.LineTax
|
||||
|
||||
[register sale_subscription]
|
||||
model:
|
||||
sale.Subscription
|
||||
sale.SubscriptionLine
|
||||
12
modules/sale_history/view/sale_form.xml
Normal file
12
modules/sale_history/view/sale_form.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
this repository contains the full copyright notices and license terms. -->
|
||||
<data>
|
||||
<xpath expr="/form/field[@name='number']" position="replace">
|
||||
<group id="number">
|
||||
<field name="number"/>
|
||||
<label name="revision" string="/"/>
|
||||
<field name="revision"/>
|
||||
</group>
|
||||
</xpath>
|
||||
</data>
|
||||
8
modules/sale_history/view/sale_tree.xml
Normal file
8
modules/sale_history/view/sale_tree.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
this repository contains the full copyright notices and license terms. -->
|
||||
<data>
|
||||
<xpath expr="//field[@name='number']" position="after">
|
||||
<field name="revision"/>
|
||||
</xpath>
|
||||
</data>
|
||||
Reference in New Issue
Block a user