[tryton-debian-vcs] tryton-modules-sale-price-list branch upstream updated. upstream/4.0.0-1-gd688718

Mathias Behrle tryton-debian-vcs at alioth.debian.org
Tue Dec 6 16:05:59 UTC 2016


The following commit has been merged in the upstream branch:
https://alioth.debian.org/plugins/scmgit/cgi-bin/gitweb.cgi/?p=tryton/tryton-modules-sale-price-list.git;a=commitdiff;h=upstream/4.0.0-1-gd688718

commit d688718ca3eba60ccbe08f65009398ce8b417d13
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Mon Dec 5 09:34:42 2016 +0100

    Adding upstream version 4.2.0.
    
    Signed-off-by: Mathias Behrle <mathiasb at m9s.biz>

diff --git a/CHANGELOG b/CHANGELOG
index 0956a7f..a8aa25b 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+Version 4.2.0 - 2016-11-28
+* Bug fixes (see mercurial logs for details)
+
 Version 4.0.0 - 2016-05-02
 * Bug fixes (see mercurial logs for details)
 * Add Python3 support
diff --git a/INSTALL b/INSTALL
index e919d37..58ac17b 100644
--- a/INSTALL
+++ b/INSTALL
@@ -25,7 +25,7 @@ site-packages directory on your system.
 For advanced options, please refer to the easy_install and/or the distutils
 documentation:
 
-  http://peak.telecommunity.com/DevCenter/EasyInstall
+  http://setuptools.readthedocs.io/en/latest/easy_install.html
   http://docs.python.org/inst/inst.html
 
 To use without installation, extract the archive into ``trytond/modules`` with
diff --git a/PKG-INFO b/PKG-INFO
index cd78ea4..819cf4c 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,12 +1,12 @@
 Metadata-Version: 1.1
 Name: trytond_sale_price_list
-Version: 4.0.0
+Version: 4.2.0
 Summary: Tryton module to add price list on sale
 Home-page: http://www.tryton.org/
 Author: Tryton
 Author-email: issue_tracker at tryton.org
 License: GPL-3
-Download-URL: http://downloads.tryton.org/4.0/
+Download-URL: http://downloads.tryton.org/4.2/
 Description: trytond_sale_price_list
         =======================
         
@@ -62,6 +62,7 @@ Classifier: Natural Language :: French
 Classifier: Natural Language :: German
 Classifier: Natural Language :: Hungarian
 Classifier: Natural Language :: Italian
+Classifier: Natural Language :: Polish
 Classifier: Natural Language :: Portuguese (Brazilian)
 Classifier: Natural Language :: Russian
 Classifier: Natural Language :: Slovenian
diff --git a/__init__.py b/__init__.py
index 0965925..9bacf39 100644
--- a/__init__.py
+++ b/__init__.py
@@ -5,6 +5,7 @@ from trytond.pool import Pool
 from .party import *
 from .sale import *
 from .product import *
+from . import configuration
 
 
 def register():
@@ -13,4 +14,5 @@ def register():
         Sale,
         SaleLine,
         Product,
+        configuration.Configuration,
         module='sale_price_list', type_='model')
diff --git a/configuration.py b/configuration.py
new file mode 100644
index 0000000..c2547fa
--- /dev/null
+++ b/configuration.py
@@ -0,0 +1,65 @@
+# 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 fields
+from trytond.pyson import Eval
+from trytond.transaction import Transaction
+from trytond.pool import PoolMeta, Pool
+
+__all__ = ['Configuration']
+
+
+class Configuration:
+    __metaclass__ = PoolMeta
+    __name__ = 'sale.configuration'
+    sale_price_list = fields.Function(fields.Many2One(
+        'product.price_list', 'Sale Price List',
+        domain=[
+            ('company', '=', Eval('context', {}).get('company', -1)),
+            ],
+        states={
+            'invisible': ~Eval('context', {}).get('company'),
+            }),
+        'get_sale_price_list', setter='set_sale_price_list')
+
+    @classmethod
+    def _get_sale_price_list_field(cls):
+        pool = Pool()
+        ModelField = pool.get('ir.model.field')
+        field, = ModelField.search([
+            ('model.model', '=', 'party.party'),
+            ('name', '=', 'sale_price_list'),
+            ], limit=1)
+        return field
+
+    def get_sale_price_list(self, name):
+        pool = Pool()
+        Property = pool.get('ir.property')
+        company_id = Transaction().context.get('company')
+        sale_price_list_field = self._get_sale_price_list_field()
+        properties = Property.search([
+            ('field', '=', sale_price_list_field.id),
+            ('res', '=', None),
+            ('company', '=', company_id),
+            ], limit=1)
+        if properties:
+            prop, = properties
+            return prop.value.id
+
+    @classmethod
+    def set_sale_price_list(cls, configurations, name, value):
+        pool = Pool()
+        Property = pool.get('ir.property')
+        company_id = Transaction().context.get('company')
+        sale_price_list_field = cls._get_sale_price_list_field()
+        properties = Property.search([
+            ('field', '=', sale_price_list_field.id),
+            ('res', '=', None),
+            ('company', '=', company_id),
+            ])
+        Property.delete(properties)
+        if value:
+            Property.create([{
+                        'field': sale_price_list_field.id,
+                        'value': 'product.price_list,%s' % value,
+                        'company': company_id,
+                        }])
diff --git a/configuration.xml b/configuration.xml
new file mode 100644
index 0000000..1be072a
--- /dev/null
+++ b/configuration.xml
@@ -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. -->
+<tryton>
+    <data>
+        <record model="ir.ui.view" id="sale_configuration_view_form">
+            <field name="model">sale.configuration</field>
+            <field name="inherit" ref="sale.sale_configuration_view_form"/>
+            <field name="name">configuration_form</field>
+        </record>
+    </data>
+</tryton>
diff --git a/locale/bg_BG.po b/locale/bg.po
similarity index 66%
rename from locale/bg_BG.po
rename to locale/bg.po
index e2a4f4a..12beaf3 100644
--- a/locale/bg_BG.po
+++ b/locale/bg.po
@@ -6,6 +6,11 @@ msgctxt "field:party.party,sale_price_list:"
 msgid "Sale Price List"
 msgstr "Ценова листа при продажба"
 
+#, fuzzy
+msgctxt "field:sale.configuration,sale_price_list:"
+msgid "Sale Price List"
+msgstr "Ценова листа при продажба"
+
 msgctxt "field:sale.sale,price_list:"
 msgid "Price List"
 msgstr "Ценова листа"
diff --git a/locale/ca_ES.po b/locale/ca.po
similarity index 69%
rename from locale/ca_ES.po
rename to locale/ca.po
index 86bb228..80d51f8 100644
--- a/locale/ca_ES.po
+++ b/locale/ca.po
@@ -6,6 +6,10 @@ msgctxt "field:party.party,sale_price_list:"
 msgid "Sale Price List"
 msgstr "Tarifa de venda"
 
+msgctxt "field:sale.configuration,sale_price_list:"
+msgid "Sale Price List"
+msgstr "Tarifa de venda"
+
 msgctxt "field:sale.sale,price_list:"
 msgid "Price List"
 msgstr "Tarifa"
diff --git a/locale/cs_CZ.po b/locale/cs.po
similarity index 70%
rename from locale/cs_CZ.po
rename to locale/cs.po
index 1456ca5..dc6bf1b 100644
--- a/locale/cs_CZ.po
+++ b/locale/cs.po
@@ -6,6 +6,10 @@ msgctxt "field:party.party,sale_price_list:"
 msgid "Sale Price List"
 msgstr ""
 
+msgctxt "field:sale.configuration,sale_price_list:"
+msgid "Sale Price List"
+msgstr ""
+
 msgctxt "field:sale.sale,price_list:"
 msgid "Price List"
 msgstr ""
diff --git a/locale/de_DE.po b/locale/de.po
similarity index 69%
rename from locale/de_DE.po
rename to locale/de.po
index e1fc03f..541fe3b 100644
--- a/locale/de_DE.po
+++ b/locale/de.po
@@ -6,6 +6,10 @@ msgctxt "field:party.party,sale_price_list:"
 msgid "Sale Price List"
 msgstr "Preisliste Verkauf"
 
+msgctxt "field:sale.configuration,sale_price_list:"
+msgid "Sale Price List"
+msgstr "Preisliste Verkauf"
+
 msgctxt "field:sale.sale,price_list:"
 msgid "Price List"
 msgstr "Preisliste"
diff --git a/locale/es_ES.po b/locale/es.po
similarity index 69%
rename from locale/es_ES.po
rename to locale/es.po
index 8ca0f1a..07c4988 100644
--- a/locale/es_ES.po
+++ b/locale/es.po
@@ -6,6 +6,10 @@ msgctxt "field:party.party,sale_price_list:"
 msgid "Sale Price List"
 msgstr "Tarifa de venta"
 
+msgctxt "field:sale.configuration,sale_price_list:"
+msgid "Sale Price List"
+msgstr "Tarifa de venta"
+
 msgctxt "field:sale.sale,price_list:"
 msgid "Price List"
 msgstr "Tarifa"
diff --git a/locale/es_AR.po b/locale/es_419.po
similarity index 59%
rename from locale/es_AR.po
rename to locale/es_419.po
index dc506ee..caef891 100644
--- a/locale/es_AR.po
+++ b/locale/es_419.po
@@ -4,7 +4,11 @@ msgstr "Content-Type: text/plain; charset=utf-8\n"
 
 msgctxt "field:party.party,sale_price_list:"
 msgid "Sale Price List"
-msgstr "Lista de precios de venta"
+msgstr "Lista de precio de venta"
+
+msgctxt "field:sale.configuration,sale_price_list:"
+msgid "Sale Price List"
+msgstr "Lista de precio de venta"
 
 msgctxt "field:sale.sale,price_list:"
 msgid "Price List"
diff --git a/locale/es_CO.po b/locale/es_CO.po
deleted file mode 100644
index aae3135..0000000
--- a/locale/es_CO.po
+++ /dev/null
@@ -1,11 +0,0 @@
-# 
-msgid ""
-msgstr "Content-Type: text/plain; charset=utf-8\n"
-
-msgctxt "field:party.party,sale_price_list:"
-msgid "Sale Price List"
-msgstr "Lista de Precios de Venta"
-
-msgctxt "field:sale.sale,price_list:"
-msgid "Price List"
-msgstr "Lista de Precios"
diff --git a/locale/es_EC.po b/locale/es_EC.po
deleted file mode 100644
index dc506ee..0000000
--- a/locale/es_EC.po
+++ /dev/null
@@ -1,11 +0,0 @@
-# 
-msgid ""
-msgstr "Content-Type: text/plain; charset=utf-8\n"
-
-msgctxt "field:party.party,sale_price_list:"
-msgid "Sale Price List"
-msgstr "Lista de precios de venta"
-
-msgctxt "field:sale.sale,price_list:"
-msgid "Price List"
-msgstr "Lista de precios"
diff --git a/locale/es_MX.po b/locale/es_MX.po
deleted file mode 100644
index 8ca0f1a..0000000
--- a/locale/es_MX.po
+++ /dev/null
@@ -1,11 +0,0 @@
-# 
-msgid ""
-msgstr "Content-Type: text/plain; charset=utf-8\n"
-
-msgctxt "field:party.party,sale_price_list:"
-msgid "Sale Price List"
-msgstr "Tarifa de venta"
-
-msgctxt "field:sale.sale,price_list:"
-msgid "Price List"
-msgstr "Tarifa"
diff --git a/locale/fr_FR.po b/locale/fr.po
similarity index 69%
rename from locale/fr_FR.po
rename to locale/fr.po
index a5bb660..a9ab1b0 100644
--- a/locale/fr_FR.po
+++ b/locale/fr.po
@@ -6,6 +6,10 @@ msgctxt "field:party.party,sale_price_list:"
 msgid "Sale Price List"
 msgstr "Liste de prix de vente"
 
+msgctxt "field:sale.configuration,sale_price_list:"
+msgid "Sale Price List"
+msgstr "Liste de prix de vente"
+
 msgctxt "field:sale.sale,price_list:"
 msgid "Price List"
 msgstr "Liste de prix"
diff --git a/locale/hu_HU.po b/locale/hu_HU.po
index 1456ca5..14db542 100644
--- a/locale/hu_HU.po
+++ b/locale/hu_HU.po
@@ -6,6 +6,11 @@ msgctxt "field:party.party,sale_price_list:"
 msgid "Sale Price List"
 msgstr ""
 
+msgctxt "field:sale.configuration,sale_price_list:"
+msgid "Sale Price List"
+msgstr ""
+
+#, fuzzy
 msgctxt "field:sale.sale,price_list:"
 msgid "Price List"
-msgstr ""
+msgstr "Árlista"
diff --git a/locale/it_IT.po b/locale/it_IT.po
index 1456ca5..0bae128 100644
--- a/locale/it_IT.po
+++ b/locale/it_IT.po
@@ -4,8 +4,12 @@ msgstr "Content-Type: text/plain; charset=utf-8\n"
 
 msgctxt "field:party.party,sale_price_list:"
 msgid "Sale Price List"
-msgstr ""
+msgstr "Listino di vendita"
+
+msgctxt "field:sale.configuration,sale_price_list:"
+msgid "Sale Price List"
+msgstr "Listino di vendita"
 
 msgctxt "field:sale.sale,price_list:"
 msgid "Price List"
-msgstr ""
+msgstr "Listino"
diff --git a/locale/ja_JP.po b/locale/ja_JP.po
index 1456ca5..dc6bf1b 100644
--- a/locale/ja_JP.po
+++ b/locale/ja_JP.po
@@ -6,6 +6,10 @@ msgctxt "field:party.party,sale_price_list:"
 msgid "Sale Price List"
 msgstr ""
 
+msgctxt "field:sale.configuration,sale_price_list:"
+msgid "Sale Price List"
+msgstr ""
+
 msgctxt "field:sale.sale,price_list:"
 msgid "Price List"
 msgstr ""
diff --git a/locale/lo.po b/locale/lo.po
new file mode 100644
index 0000000..2ecb01a
--- /dev/null
+++ b/locale/lo.po
@@ -0,0 +1,16 @@
+# 
+msgid ""
+msgstr "Content-Type: text/plain; charset=utf-8\n"
+
+msgctxt "field:party.party,sale_price_list:"
+msgid "Sale Price List"
+msgstr "ລາຍການລາຄາຂາຍ"
+
+#, fuzzy
+msgctxt "field:sale.configuration,sale_price_list:"
+msgid "Sale Price List"
+msgstr "ລາຍການລາຄາຂາຍ"
+
+msgctxt "field:sale.sale,price_list:"
+msgid "Price List"
+msgstr "ລາຍການລາຄາ"
diff --git a/locale/lo_LA.po b/locale/lo_LA.po
deleted file mode 100644
index 1456ca5..0000000
--- a/locale/lo_LA.po
+++ /dev/null
@@ -1,11 +0,0 @@
-# 
-msgid ""
-msgstr "Content-Type: text/plain; charset=utf-8\n"
-
-msgctxt "field:party.party,sale_price_list:"
-msgid "Sale Price List"
-msgstr ""
-
-msgctxt "field:sale.sale,price_list:"
-msgid "Price List"
-msgstr ""
diff --git a/locale/hu_HU.po b/locale/lt.po
similarity index 70%
copy from locale/hu_HU.po
copy to locale/lt.po
index 1456ca5..dc6bf1b 100644
--- a/locale/hu_HU.po
+++ b/locale/lt.po
@@ -6,6 +6,10 @@ msgctxt "field:party.party,sale_price_list:"
 msgid "Sale Price List"
 msgstr ""
 
+msgctxt "field:sale.configuration,sale_price_list:"
+msgid "Sale Price List"
+msgstr ""
+
 msgctxt "field:sale.sale,price_list:"
 msgid "Price List"
 msgstr ""
diff --git a/locale/lt_LT.po b/locale/lt_LT.po
deleted file mode 100644
index 1456ca5..0000000
--- a/locale/lt_LT.po
+++ /dev/null
@@ -1,11 +0,0 @@
-# 
-msgid ""
-msgstr "Content-Type: text/plain; charset=utf-8\n"
-
-msgctxt "field:party.party,sale_price_list:"
-msgid "Sale Price List"
-msgstr ""
-
-msgctxt "field:sale.sale,price_list:"
-msgid "Price List"
-msgstr ""
diff --git a/locale/hu_HU.po b/locale/nl.po
similarity index 70%
copy from locale/hu_HU.po
copy to locale/nl.po
index 1456ca5..dc6bf1b 100644
--- a/locale/hu_HU.po
+++ b/locale/nl.po
@@ -6,6 +6,10 @@ msgctxt "field:party.party,sale_price_list:"
 msgid "Sale Price List"
 msgstr ""
 
+msgctxt "field:sale.configuration,sale_price_list:"
+msgid "Sale Price List"
+msgstr ""
+
 msgctxt "field:sale.sale,price_list:"
 msgid "Price List"
 msgstr ""
diff --git a/locale/nl_NL.po b/locale/nl_NL.po
deleted file mode 100644
index 1456ca5..0000000
--- a/locale/nl_NL.po
+++ /dev/null
@@ -1,11 +0,0 @@
-# 
-msgid ""
-msgstr "Content-Type: text/plain; charset=utf-8\n"
-
-msgctxt "field:party.party,sale_price_list:"
-msgid "Sale Price List"
-msgstr ""
-
-msgctxt "field:sale.sale,price_list:"
-msgid "Price List"
-msgstr ""
diff --git a/locale/hu_HU.po b/locale/pl.po
similarity index 70%
copy from locale/hu_HU.po
copy to locale/pl.po
index 1456ca5..dc6bf1b 100644
--- a/locale/hu_HU.po
+++ b/locale/pl.po
@@ -6,6 +6,10 @@ msgctxt "field:party.party,sale_price_list:"
 msgid "Sale Price List"
 msgstr ""
 
+msgctxt "field:sale.configuration,sale_price_list:"
+msgid "Sale Price List"
+msgstr ""
+
 msgctxt "field:sale.sale,price_list:"
 msgid "Price List"
 msgstr ""
diff --git a/locale/pt_BR.po b/locale/pt_BR.po
index 6b3f226..e102c41 100644
--- a/locale/pt_BR.po
+++ b/locale/pt_BR.po
@@ -6,6 +6,11 @@ msgctxt "field:party.party,sale_price_list:"
 msgid "Sale Price List"
 msgstr "Lista de Preço de Venda"
 
+#, fuzzy
+msgctxt "field:sale.configuration,sale_price_list:"
+msgid "Sale Price List"
+msgstr "Lista de Preço de Venda"
+
 msgctxt "field:sale.sale,price_list:"
 msgid "Price List"
 msgstr "Lista de Preços"
diff --git a/locale/hu_HU.po b/locale/ru.po
similarity index 70%
copy from locale/hu_HU.po
copy to locale/ru.po
index 1456ca5..dc6bf1b 100644
--- a/locale/hu_HU.po
+++ b/locale/ru.po
@@ -6,6 +6,10 @@ msgctxt "field:party.party,sale_price_list:"
 msgid "Sale Price List"
 msgstr ""
 
+msgctxt "field:sale.configuration,sale_price_list:"
+msgid "Sale Price List"
+msgstr ""
+
 msgctxt "field:sale.sale,price_list:"
 msgid "Price List"
 msgstr ""
diff --git a/locale/ru_RU.po b/locale/ru_RU.po
deleted file mode 100644
index 1456ca5..0000000
--- a/locale/ru_RU.po
+++ /dev/null
@@ -1,11 +0,0 @@
-# 
-msgid ""
-msgstr "Content-Type: text/plain; charset=utf-8\n"
-
-msgctxt "field:party.party,sale_price_list:"
-msgid "Sale Price List"
-msgstr ""
-
-msgctxt "field:sale.sale,price_list:"
-msgid "Price List"
-msgstr ""
diff --git a/locale/sl_SI.po b/locale/sl.po
similarity index 67%
rename from locale/sl_SI.po
rename to locale/sl.po
index bd7086d..1a2b7c5 100644
--- a/locale/sl_SI.po
+++ b/locale/sl.po
@@ -6,6 +6,11 @@ msgctxt "field:party.party,sale_price_list:"
 msgid "Sale Price List"
 msgstr "Prodajni cenik"
 
+#, fuzzy
+msgctxt "field:sale.configuration,sale_price_list:"
+msgid "Sale Price List"
+msgstr "Prodajni cenik"
+
 msgctxt "field:sale.sale,price_list:"
 msgid "Price List"
 msgstr "Cenik"
diff --git a/locale/zh_CN.po b/locale/zh_CN.po
index 1456ca5..dc6bf1b 100644
--- a/locale/zh_CN.po
+++ b/locale/zh_CN.po
@@ -6,6 +6,10 @@ msgctxt "field:party.party,sale_price_list:"
 msgid "Sale Price List"
 msgstr ""
 
+msgctxt "field:sale.configuration,sale_price_list:"
+msgid "Sale Price List"
+msgstr ""
+
 msgctxt "field:sale.sale,price_list:"
 msgid "Price List"
 msgstr ""
diff --git a/setup.py b/setup.py
index 11b221a..faa6c31 100644
--- a/setup.py
+++ b/setup.py
@@ -94,6 +94,7 @@ setup(name=name,
         'Natural Language :: German',
         'Natural Language :: Hungarian',
         'Natural Language :: Italian',
+        'Natural Language :: Polish',
         'Natural Language :: Portuguese (Brazilian)',
         'Natural Language :: Russian',
         'Natural Language :: Slovenian',
diff --git a/tests/scenario_sale_price_list.rst b/tests/scenario_sale_price_list.rst
new file mode 100644
index 0000000..8d64e29
--- /dev/null
+++ b/tests/scenario_sale_price_list.rst
@@ -0,0 +1,171 @@
+========================
+Sale Price List Scenario
+========================
+
+Imports::
+
+    >>> import datetime
+    >>> from decimal import Decimal
+    >>> from proteus import Model, Wizard
+    >>> from trytond.tests.tools import activate_modules
+    >>> from trytond.modules.company.tests.tools import create_company, \
+    ...     get_company
+    >>> from trytond.modules.account.tests.tools import create_fiscalyear, \
+    ...     create_chart, get_accounts
+    >>> from trytond.modules.account_invoice.tests.tools import \
+    ...     set_fiscalyear_invoice_sequences, create_payment_term
+
+Install sale_price_list::
+
+    >>> config = activate_modules('sale_price_list')
+
+Create company::
+
+    >>> _ = create_company()
+    >>> company = get_company()
+
+Create sale user::
+
+    >>> User = Model.get('res.user')
+    >>> Group = Model.get('res.group')
+    >>> sale_user = User()
+    >>> sale_user.name = 'Sale'
+    >>> sale_user.login = 'sale'
+    >>> sale_user.main_company = company
+    >>> sale_group, = Group.find([('name', '=', 'Sales')])
+    >>> sale_user.groups.append(sale_group)
+    >>> sale_user.save()
+
+    >>> sale_admin = User()
+    >>> sale_admin.name = 'Sale Admin'
+    >>> sale_admin.login = 'sale_admin'
+    >>> sale_admin.main_company = company
+    >>> sale_admin_group, = Group.find([('name', '=', 'Sales Administrator')])
+    >>> sale_admin.groups.append(sale_admin_group)
+    >>> product_admin_group, = Group.find(
+    ...     [('name', '=', 'Product Administration')])
+    >>> sale_admin.groups.append(product_admin_group)
+    >>> sale_admin.save()
+
+Create fiscal year::
+
+    >>> fiscalyear = set_fiscalyear_invoice_sequences(
+    ...     create_fiscalyear(company))
+    >>> fiscalyear.click('create_period')
+
+Create chart of accounts::
+
+    >>> _ = create_chart(company)
+    >>> accounts = get_accounts(company)
+    >>> revenue = accounts['revenue']
+    >>> expense = accounts['expense']
+
+Create parties::
+
+    >>> Party = Model.get('party.party')
+    >>> customer = Party(name='Customer')
+    >>> customer.save()
+    >>> customer_without_price_list = Party(name='Customer without price list')
+    >>> customer_without_price_list.save()
+
+Create product::
+
+    >>> ProductUom = Model.get('product.uom')
+    >>> unit, = ProductUom.find([('name', '=', 'Unit')])
+    >>> ProductTemplate = Model.get('product.template')
+    >>> Product = Model.get('product.product')
+    >>> product = Product()
+    >>> template = ProductTemplate()
+    >>> template.name = 'product'
+    >>> template.default_uom = unit
+    >>> template.type = 'goods'
+    >>> template.purchasable = True
+    >>> template.salable = True
+    >>> template.list_price = Decimal('10')
+    >>> template.cost_price = Decimal('5')
+    >>> template.cost_price_method = 'fixed'
+    >>> template.account_expense = expense
+    >>> template.account_revenue = revenue
+    >>> template.save()
+    >>> product.template = template
+    >>> product.save()
+
+    >>> service = Product()
+    >>> template = ProductTemplate()
+    >>> template.name = 'service'
+    >>> template.default_uom = unit
+    >>> template.type = 'service'
+    >>> template.salable = True
+    >>> template.list_price = Decimal('30')
+    >>> template.cost_price = Decimal('10')
+    >>> template.cost_price_method = 'fixed'
+    >>> template.account_expense = expense
+    >>> template.account_revenue = revenue
+    >>> template.save()
+    >>> service.template = template
+    >>> service.save()
+
+Create payment term::
+
+    >>> payment_term = create_payment_term()
+    >>> payment_term.save()
+
+Create a price List and assign it to customer::
+
+    >>> PriceList = Model.get('product.price_list')
+    >>> price_list = PriceList(name='Retail')
+    >>> price_list_line = price_list.lines.new()
+    >>> price_list_line.quantity = 10.0
+    >>> price_list_line.product = product
+    >>> price_list_line.formula = 'unit_price * 0.7'
+    >>> price_list_line = price_list.lines.new()
+    >>> price_list_line.product = product
+    >>> price_list_line.formula = 'unit_price * 0.8'
+    >>> price_list_line = price_list.lines.new()
+    >>> price_list_line.formula = 'unit_price * 0.5'
+    >>> price_list.save()
+    >>> customer.sale_price_list = price_list
+    >>> customer.save()
+
+Use the price list on sale::
+
+    >>> config.user = sale_user.id
+    >>> Sale = Model.get('sale.sale')
+    >>> sale = Sale()
+    >>> sale.party = customer
+    >>> sale.price_list == price_list
+    True
+    >>> sale.payment_term = payment_term
+    >>> sale_line = sale.lines.new()
+    >>> sale_line.product = product
+    >>> sale_line.unit_price
+    Decimal('8.0000')
+    >>> sale_line.quantity = 12.0
+    >>> sale_line.unit_price
+    Decimal('7.0000')
+    >>> sale_line = sale.lines.new()
+    >>> sale_line.product = service
+    >>> sale_line.unit_price
+    Decimal('15.0000')
+    >>> sale_line.quantity = 2.0
+    >>> sale_line.unit_price
+    Decimal('15.0000')
+
+Create a sale price List and assign to configuration::
+
+    >>> config.user = sale_admin.id
+    >>> sale_price_list = PriceList(name='Sale price List')
+    >>> sale_price_list_line = sale_price_list.lines.new()
+    >>> sale_price_list_line.formula = 'unit_price * 0.5'
+    >>> sale_price_list.save()
+    >>> Configuration = Model.get('sale.configuration')
+    >>> config = Configuration()
+    >>> config.sale_price_list = sale_price_list
+    >>> config.save()
+
+Use the sale price list on sale::
+
+    >>> config.user = sale_user.id
+    >>> sale.party = customer_without_price_list
+    >>> sale.price_list == sale_price_list
+    True
diff --git a/tests/test_sale_price_list.py b/tests/test_sale_price_list.py
index 9652ce8..b2136af 100644
--- a/tests/test_sale_price_list.py
+++ b/tests/test_sale_price_list.py
@@ -4,7 +4,7 @@ import unittest
 import doctest
 import trytond.tests.test_tryton
 from trytond.tests.test_tryton import ModuleTestCase
-from trytond.tests.test_tryton import doctest_setup, doctest_teardown
+from trytond.tests.test_tryton import doctest_teardown
 from trytond.tests.test_tryton import doctest_checker
 
 
@@ -18,7 +18,7 @@ def suite():
     suite.addTests(unittest.TestLoader().loadTestsFromTestCase(
         SalePriceListTestCase))
     suite.addTests(doctest.DocFileSuite('scenario_sale_price_list.rst',
-            setUp=doctest_setup, tearDown=doctest_teardown, encoding='utf-8',
+            tearDown=doctest_teardown, encoding='utf-8',
             checker=doctest_checker,
             optionflags=doctest.REPORT_ONLY_FIRST_FAILURE))
     return suite
diff --git a/tryton.cfg b/tryton.cfg
index 4d020d8..5a333e8 100644
--- a/tryton.cfg
+++ b/tryton.cfg
@@ -1,5 +1,5 @@
 [tryton]
-version=4.0.0
+version=4.2.0
 depends:
     ir
     party
@@ -8,3 +8,4 @@ depends:
 xml:
     party.xml
     sale.xml
+    configuration.xml
diff --git a/trytond_sale_price_list.egg-info/PKG-INFO b/trytond_sale_price_list.egg-info/PKG-INFO
index 1aba43e..fa2616b 100644
--- a/trytond_sale_price_list.egg-info/PKG-INFO
+++ b/trytond_sale_price_list.egg-info/PKG-INFO
@@ -1,12 +1,12 @@
 Metadata-Version: 1.1
 Name: trytond-sale-price-list
-Version: 4.0.0
+Version: 4.2.0
 Summary: Tryton module to add price list on sale
 Home-page: http://www.tryton.org/
 Author: Tryton
 Author-email: issue_tracker at tryton.org
 License: GPL-3
-Download-URL: http://downloads.tryton.org/4.0/
+Download-URL: http://downloads.tryton.org/4.2/
 Description: trytond_sale_price_list
         =======================
         
@@ -62,6 +62,7 @@ Classifier: Natural Language :: French
 Classifier: Natural Language :: German
 Classifier: Natural Language :: Hungarian
 Classifier: Natural Language :: Italian
+Classifier: Natural Language :: Polish
 Classifier: Natural Language :: Portuguese (Brazilian)
 Classifier: Natural Language :: Russian
 Classifier: Natural Language :: Slovenian
diff --git a/trytond_sale_price_list.egg-info/SOURCES.txt b/trytond_sale_price_list.egg-info/SOURCES.txt
index 3d3b2fd..2b10111 100644
--- a/trytond_sale_price_list.egg-info/SOURCES.txt
+++ b/trytond_sale_price_list.egg-info/SOURCES.txt
@@ -4,58 +4,61 @@ INSTALL
 LICENSE
 MANIFEST.in
 README
+configuration.xml
 party.xml
 sale.xml
 setup.py
 tryton.cfg
 ./__init__.py
+./configuration.py
+./configuration.xml
 ./party.py
 ./party.xml
 ./product.py
 ./sale.py
 ./sale.xml
 ./tryton.cfg
-./locale/bg_BG.po
-./locale/ca_ES.po
-./locale/cs_CZ.po
-./locale/de_DE.po
-./locale/es_AR.po
-./locale/es_CO.po
-./locale/es_EC.po
-./locale/es_ES.po
-./locale/es_MX.po
-./locale/fr_FR.po
+./locale/bg.po
+./locale/ca.po
+./locale/cs.po
+./locale/de.po
+./locale/es.po
+./locale/es_419.po
+./locale/fr.po
 ./locale/hu_HU.po
 ./locale/it_IT.po
 ./locale/ja_JP.po
-./locale/lt_LT.po
-./locale/nl_NL.po
+./locale/lo.po
+./locale/lt.po
+./locale/nl.po
+./locale/pl.po
 ./locale/pt_BR.po
-./locale/ru_RU.po
-./locale/sl_SI.po
+./locale/ru.po
+./locale/sl.po
+./locale/zh_CN.po
 ./tests/__init__.py
+./tests/scenario_sale_price_list.rst
 ./tests/test_sale_price_list.py
+./view/configuration_form.xml
 ./view/party_form.xml
 ./view/sale_form.xml
-locale/bg_BG.po
-locale/ca_ES.po
-locale/cs_CZ.po
-locale/de_DE.po
-locale/es_AR.po
-locale/es_CO.po
-locale/es_EC.po
-locale/es_ES.po
-locale/es_MX.po
-locale/fr_FR.po
+locale/bg.po
+locale/ca.po
+locale/cs.po
+locale/de.po
+locale/es.po
+locale/es_419.po
+locale/fr.po
 locale/hu_HU.po
 locale/it_IT.po
 locale/ja_JP.po
-locale/lo_LA.po
-locale/lt_LT.po
-locale/nl_NL.po
+locale/lo.po
+locale/lt.po
+locale/nl.po
+locale/pl.po
 locale/pt_BR.po
-locale/ru_RU.po
-locale/sl_SI.po
+locale/ru.po
+locale/sl.po
 locale/zh_CN.po
 trytond_sale_price_list.egg-info/PKG-INFO
 trytond_sale_price_list.egg-info/SOURCES.txt
@@ -64,5 +67,6 @@ trytond_sale_price_list.egg-info/entry_points.txt
 trytond_sale_price_list.egg-info/not-zip-safe
 trytond_sale_price_list.egg-info/requires.txt
 trytond_sale_price_list.egg-info/top_level.txt
+view/configuration_form.xml
 view/party_form.xml
 view/sale_form.xml
\ No newline at end of file
diff --git a/trytond_sale_price_list.egg-info/requires.txt b/trytond_sale_price_list.egg-info/requires.txt
index 6c2bae2..e3058a3 100644
--- a/trytond_sale_price_list.egg-info/requires.txt
+++ b/trytond_sale_price_list.egg-info/requires.txt
@@ -1,4 +1,4 @@
-trytond_party >= 4.0, < 4.1
-trytond_product_price_list >= 4.0, < 4.1
-trytond_sale >= 4.0, < 4.1
-trytond >= 4.0, < 4.1
\ No newline at end of file
+trytond_party >= 4.2, < 4.3
+trytond_product_price_list >= 4.2, < 4.3
+trytond_sale >= 4.2, < 4.3
+trytond >= 4.2, < 4.3
diff --git a/view/configuration_form.xml b/view/configuration_form.xml
new file mode 100644
index 0000000..1f5f205
--- /dev/null
+++ b/view/configuration_form.xml
@@ -0,0 +1,9 @@
+<?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='sale_shipment_method']" position="after">
+        <label name="sale_price_list" />
+        <field name="sale_price_list" />
+    </xpath>
+</data>
-- 
tryton-modules-sale-price-list



More information about the tryton-debian-vcs mailing list