[tryton-debian-vcs] tryton-modules-sale-shipment-cost branch debian updated. debian/4.4.0-4-5-g182d743
Mathias Behrle
tryton-debian-vcs at alioth.debian.org
Fri Nov 10 12:18:49 UTC 2017
The following commit has been merged in the debian branch:
https://alioth.debian.org/plugins/scmgit/cgi-bin/gitweb.cgi/?p=tryton/tryton-modules-sale-shipment-cost.git;a=commitdiff;h=debian/4.4.0-4-5-g182d743
commit 182d74343ec3775fc37ef25ff73b2bba8f8d5961
Author: Mathias Behrle <mathiasb at m9s.biz>
Date: Tue Nov 7 16:24:57 2017 +0100
Releasing debian version 4.6.0-1.
Signed-off-by: Mathias Behrle <mathiasb at m9s.biz>
diff --git a/debian/changelog b/debian/changelog
index 6c1bc3c..61f7083 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+tryton-modules-sale-shipment-cost (4.6.0-1) unstable; urgency=medium
+
+ * Bump the Standards-Version to 4.1.0, no changes needed.
+ * Bump the Standards-Version to 4.1.1, no changes needed.
+ * Merging upstream version 4.6.0.
+ * Use https in the watch file.
+
+ -- Mathias Behrle <mathiasb at m9s.biz> Tue, 07 Nov 2017 10:20:32 +0100
+
tryton-modules-sale-shipment-cost (4.4.0-4) unstable; urgency=medium
* Switch to Python3.
commit 1e9854e3342fbc3fa695db88e1b9c96120226afb
Author: Mathias Behrle <mathiasb at m9s.biz>
Date: Tue Nov 7 10:16:46 2017 +0100
Use https in the watch file.
diff --git a/debian/watch b/debian/watch
index 2a9c676..1489792 100644
--- a/debian/watch
+++ b/debian/watch
@@ -1,2 +1,2 @@
version=3
-opts=pgpsigurlmangle=s/$/.asc/ http://downloads.tryton.org/current/ .*trytond_sale_shipment_cost-(\d.*)\.(?:tgz|tbz2|txz|tar\.(?:gz|bz2|xz))
+opts=pgpsigurlmangle=s/$/.asc/ https://downloads.tryton.org/current/ .*trytond_sale_shipment_cost-(\d.*)\.(?:tgz|tbz2|txz|tar\.(?:gz|bz2|xz))
commit 2ba272fdaf6c7ca695b639d7e853ed3097562060
Author: Mathias Behrle <mathiasb at m9s.biz>
Date: Mon Nov 6 14:41:18 2017 +0100
Merging upstream version 4.6.0.
diff --git a/.drone.yml b/.drone.yml
new file mode 100644
index 0000000..e0bc2f7
--- /dev/null
+++ b/.drone.yml
@@ -0,0 +1,51 @@
+clone:
+ hg:
+ image: plugins/hg
+
+pipeline:
+ tox:
+ image: ${IMAGE}
+ environment:
+ - CFLAGS=-O0
+ - DB_CACHE=/cache
+ - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE
+ - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/
+ commands:
+ - pip install tox
+ - tox -e "${TOXENV}-${DATABASE}"
+ volumes:
+ - cache:/root/.cache
+
+services:
+ postgresql:
+ image: postgres
+ when:
+ matrix:
+ DATABASE: postgresql
+
+matrix:
+ include:
+ - IMAGE: python:2.7
+ TOXENV: py27
+ DATABASE: sqlite
+ - IMAGE: python:2.7
+ TOXENV: py27
+ DATABASE: postgresql
+ - IMAGE: python:3.4
+ TOXENV: py34
+ DATABASE: sqlite
+ - IMAGE: python:3.4
+ TOXENV: py34
+ DATABASE: postgresql
+ - IMAGE: python:3.5
+ TOXENV: py35
+ DATABASE: sqlite
+ - IMAGE: python:3.5
+ TOXENV: py35
+ DATABASE: postgresql
+ - IMAGE: python:3.6
+ TOXENV: py36
+ DATABASE: sqlite
+ - IMAGE: python:3.6
+ TOXENV: py36
+ DATABASE: postgresql
diff --git a/CHANGELOG b/CHANGELOG
index f652b59..527bcf8 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,8 @@
+Version 4.6.0 - 2017-10-30
+* Bug fixes (see mercurial logs for details)
+* Invoice shipment cost when at least one shipment is done
+* Use price_digits for storing cost
+
Version 4.4.0 - 2017-05-01
* Bug fixes (see mercurial logs for details)
diff --git a/PKG-INFO b/PKG-INFO
index 1d6db58..a9b2efd 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,12 +1,12 @@
Metadata-Version: 1.1
Name: trytond_sale_shipment_cost
-Version: 4.4.0
+Version: 4.6.0
Summary: Tryton module for sale shipment cost
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.4/
+Download-URL: http://downloads.tryton.org/4.6/
Description: trytond_sale_shipment_cost
==========================
@@ -70,9 +70,9 @@ Classifier: Natural Language :: Slovenian
Classifier: Natural Language :: Spanish
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 2.7
-Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
+Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Office/Business
diff --git a/locale/bg.po b/locale/bg.po
index 33328fe..4d71d64 100644
--- a/locale/bg.po
+++ b/locale/bg.po
@@ -1,7 +1,11 @@
-#
+#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
+msgctxt "error:sale.sale:"
+msgid "The carrier '%(carrier)s' on sale '%(sale)s' is not valid."
+msgstr ""
+
msgctxt "error:stock.shipment.out:"
msgid "Missing \"Account Revenue\" on product \"%s\"."
msgstr ""
@@ -43,10 +47,6 @@ msgctxt "field:stock.shipment.out,cost_currency:"
msgid "Cost Currency"
msgstr "Валута при разход"
-msgctxt "field:stock.shipment.out,cost_currency_digits:"
-msgid "Cost Currency Digits"
-msgstr "Цифри на валута за разход"
-
msgctxt "field:stock.shipment.out,cost_invoice_line:"
msgid "Cost Invoice Line"
msgstr "Ред от разход от фактура"
diff --git a/locale/ca.po b/locale/ca.po
index a0fb4a5..37f86e4 100644
--- a/locale/ca.po
+++ b/locale/ca.po
@@ -1,7 +1,11 @@
-#
+#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
+msgctxt "error:sale.sale:"
+msgid "The carrier '%(carrier)s' on sale '%(sale)s' is not valid."
+msgstr "El transportista '%(carrier)s' de la venda '%(sale)s' no es vàlid."
+
msgctxt "error:stock.shipment.out:"
msgid "Missing \"Account Revenue\" on product \"%s\"."
msgstr "No es troba el \"Compte d'ingressos\" al producte \"%s\"."
@@ -42,10 +46,6 @@ msgctxt "field:stock.shipment.out,cost_currency:"
msgid "Cost Currency"
msgstr "Moneda de cost"
-msgctxt "field:stock.shipment.out,cost_currency_digits:"
-msgid "Cost Currency Digits"
-msgstr "Decimals de la moneda de cost"
-
msgctxt "field:stock.shipment.out,cost_invoice_line:"
msgid "Cost Invoice Line"
msgstr "Cost de la línia de factura"
diff --git a/locale/cs.po b/locale/cs.po
index 7c60a8c..af113d3 100644
--- a/locale/cs.po
+++ b/locale/cs.po
@@ -1,7 +1,11 @@
-#
+#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
+msgctxt "error:sale.sale:"
+msgid "The carrier '%(carrier)s' on sale '%(sale)s' is not valid."
+msgstr ""
+
msgctxt "error:stock.shipment.out:"
msgid "Missing \"Account Revenue\" on product \"%s\"."
msgstr ""
@@ -42,10 +46,6 @@ msgctxt "field:stock.shipment.out,cost_currency:"
msgid "Cost Currency"
msgstr ""
-msgctxt "field:stock.shipment.out,cost_currency_digits:"
-msgid "Cost Currency Digits"
-msgstr ""
-
msgctxt "field:stock.shipment.out,cost_invoice_line:"
msgid "Cost Invoice Line"
msgstr ""
diff --git a/locale/de.po b/locale/de.po
index 66be41f..e0302d5 100644
--- a/locale/de.po
+++ b/locale/de.po
@@ -1,7 +1,11 @@
-#
+#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
+msgctxt "error:sale.sale:"
+msgid "The carrier '%(carrier)s' on sale '%(sale)s' is not valid."
+msgstr ""
+
msgctxt "error:stock.shipment.out:"
msgid "Missing \"Account Revenue\" on product \"%s\"."
msgstr "Fehlendes Ertragskonto für Artikel \"%s\"."
@@ -42,10 +46,6 @@ msgctxt "field:stock.shipment.out,cost_currency:"
msgid "Cost Currency"
msgstr "Währung Kosten"
-msgctxt "field:stock.shipment.out,cost_currency_digits:"
-msgid "Cost Currency Digits"
-msgstr "Nachkommastellen Währung Kosten"
-
msgctxt "field:stock.shipment.out,cost_invoice_line:"
msgid "Cost Invoice Line"
msgstr "Rechnungsposition Kosten"
diff --git a/locale/es.po b/locale/es.po
index 6bcb98a..72c9a96 100644
--- a/locale/es.po
+++ b/locale/es.po
@@ -1,7 +1,11 @@
-#
+#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
+msgctxt "error:sale.sale:"
+msgid "The carrier '%(carrier)s' on sale '%(sale)s' is not valid."
+msgstr "El transportista '%(carrier)s' de la venta '%(sale)s' no es valido. "
+
msgctxt "error:stock.shipment.out:"
msgid "Missing \"Account Revenue\" on product \"%s\"."
msgstr "Falta la \"Cuenta de ingresos\" en el producto \"%s\"."
@@ -42,10 +46,6 @@ msgctxt "field:stock.shipment.out,cost_currency:"
msgid "Cost Currency"
msgstr "Moneda coste"
-msgctxt "field:stock.shipment.out,cost_currency_digits:"
-msgid "Cost Currency Digits"
-msgstr "Decimales de la moneda de coste"
-
msgctxt "field:stock.shipment.out,cost_invoice_line:"
msgid "Cost Invoice Line"
msgstr "Coste de la línea de factura"
diff --git a/locale/es_419.po b/locale/es_419.po
index af4dbdf..c4e3a9a 100644
--- a/locale/es_419.po
+++ b/locale/es_419.po
@@ -1,7 +1,11 @@
-#
+#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
+msgctxt "error:sale.sale:"
+msgid "The carrier '%(carrier)s' on sale '%(sale)s' is not valid."
+msgstr ""
+
msgctxt "error:stock.shipment.out:"
msgid "Missing \"Account Revenue\" on product \"%s\"."
msgstr ""
@@ -43,10 +47,6 @@ msgctxt "field:stock.shipment.out,cost_currency:"
msgid "Cost Currency"
msgstr "Moneda del costo"
-msgctxt "field:stock.shipment.out,cost_currency_digits:"
-msgid "Cost Currency Digits"
-msgstr "Decimales de moneda del costo"
-
msgctxt "field:stock.shipment.out,cost_invoice_line:"
msgid "Cost Invoice Line"
msgstr "Línea de factura de costo"
diff --git a/locale/fr.po b/locale/fr.po
index ff53d73..8fb4267 100644
--- a/locale/fr.po
+++ b/locale/fr.po
@@ -1,7 +1,12 @@
-#
+#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
+msgctxt "error:sale.sale:"
+msgid "The carrier '%(carrier)s' on sale '%(sale)s' is not valid."
+msgstr ""
+"Le transporteur « %(carrier)s » sur la vente « %(sale)s » n'est pas valide."
+
msgctxt "error:stock.shipment.out:"
msgid "Missing \"Account Revenue\" on product \"%s\"."
msgstr "Le compte des revenus est manquant sur le tiers « %s »."
@@ -42,10 +47,6 @@ msgctxt "field:stock.shipment.out,cost_currency:"
msgid "Cost Currency"
msgstr "Devise du coût"
-msgctxt "field:stock.shipment.out,cost_currency_digits:"
-msgid "Cost Currency Digits"
-msgstr "Décimales de la devise du coût"
-
msgctxt "field:stock.shipment.out,cost_invoice_line:"
msgid "Cost Invoice Line"
msgstr "Ligne de facture du coût"
diff --git a/locale/hu_HU.po b/locale/hu_HU.po
index dac8ec7..623ab0f 100644
--- a/locale/hu_HU.po
+++ b/locale/hu_HU.po
@@ -1,7 +1,11 @@
-#
+#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
+msgctxt "error:sale.sale:"
+msgid "The carrier '%(carrier)s' on sale '%(sale)s' is not valid."
+msgstr ""
+
msgctxt "error:stock.shipment.out:"
msgid "Missing \"Account Revenue\" on product \"%s\"."
msgstr ""
@@ -43,10 +47,6 @@ msgctxt "field:stock.shipment.out,cost_currency:"
msgid "Cost Currency"
msgstr ""
-msgctxt "field:stock.shipment.out,cost_currency_digits:"
-msgid "Cost Currency Digits"
-msgstr ""
-
msgctxt "field:stock.shipment.out,cost_invoice_line:"
msgid "Cost Invoice Line"
msgstr ""
diff --git a/locale/it_IT.po b/locale/it_IT.po
index de76c31..2c9745e 100644
--- a/locale/it_IT.po
+++ b/locale/it_IT.po
@@ -1,7 +1,11 @@
-#
+#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
+msgctxt "error:sale.sale:"
+msgid "The carrier '%(carrier)s' on sale '%(sale)s' is not valid."
+msgstr ""
+
msgctxt "error:stock.shipment.out:"
msgid "Missing \"Account Revenue\" on product \"%s\"."
msgstr "Manca \"conto di ricavo\" su prodotto \"%s\"."
@@ -43,10 +47,6 @@ msgctxt "field:stock.shipment.out,cost_currency:"
msgid "Cost Currency"
msgstr "Valuta costo"
-msgctxt "field:stock.shipment.out,cost_currency_digits:"
-msgid "Cost Currency Digits"
-msgstr "posizioni valuta costo"
-
msgctxt "field:stock.shipment.out,cost_invoice_line:"
msgid "Cost Invoice Line"
msgstr "Riga fattura costo"
diff --git a/locale/ja_JP.po b/locale/ja_JP.po
index 7c60a8c..af113d3 100644
--- a/locale/ja_JP.po
+++ b/locale/ja_JP.po
@@ -1,7 +1,11 @@
-#
+#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
+msgctxt "error:sale.sale:"
+msgid "The carrier '%(carrier)s' on sale '%(sale)s' is not valid."
+msgstr ""
+
msgctxt "error:stock.shipment.out:"
msgid "Missing \"Account Revenue\" on product \"%s\"."
msgstr ""
@@ -42,10 +46,6 @@ msgctxt "field:stock.shipment.out,cost_currency:"
msgid "Cost Currency"
msgstr ""
-msgctxt "field:stock.shipment.out,cost_currency_digits:"
-msgid "Cost Currency Digits"
-msgstr ""
-
msgctxt "field:stock.shipment.out,cost_invoice_line:"
msgid "Cost Invoice Line"
msgstr ""
diff --git a/locale/lo.po b/locale/lo.po
index 7c60a8c..af113d3 100644
--- a/locale/lo.po
+++ b/locale/lo.po
@@ -1,7 +1,11 @@
-#
+#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
+msgctxt "error:sale.sale:"
+msgid "The carrier '%(carrier)s' on sale '%(sale)s' is not valid."
+msgstr ""
+
msgctxt "error:stock.shipment.out:"
msgid "Missing \"Account Revenue\" on product \"%s\"."
msgstr ""
@@ -42,10 +46,6 @@ msgctxt "field:stock.shipment.out,cost_currency:"
msgid "Cost Currency"
msgstr ""
-msgctxt "field:stock.shipment.out,cost_currency_digits:"
-msgid "Cost Currency Digits"
-msgstr ""
-
msgctxt "field:stock.shipment.out,cost_invoice_line:"
msgid "Cost Invoice Line"
msgstr ""
diff --git a/locale/lt.po b/locale/lt.po
index 7c60a8c..af113d3 100644
--- a/locale/lt.po
+++ b/locale/lt.po
@@ -1,7 +1,11 @@
-#
+#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
+msgctxt "error:sale.sale:"
+msgid "The carrier '%(carrier)s' on sale '%(sale)s' is not valid."
+msgstr ""
+
msgctxt "error:stock.shipment.out:"
msgid "Missing \"Account Revenue\" on product \"%s\"."
msgstr ""
@@ -42,10 +46,6 @@ msgctxt "field:stock.shipment.out,cost_currency:"
msgid "Cost Currency"
msgstr ""
-msgctxt "field:stock.shipment.out,cost_currency_digits:"
-msgid "Cost Currency Digits"
-msgstr ""
-
msgctxt "field:stock.shipment.out,cost_invoice_line:"
msgid "Cost Invoice Line"
msgstr ""
diff --git a/locale/nl.po b/locale/nl.po
index 7c60a8c..af113d3 100644
--- a/locale/nl.po
+++ b/locale/nl.po
@@ -1,7 +1,11 @@
-#
+#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
+msgctxt "error:sale.sale:"
+msgid "The carrier '%(carrier)s' on sale '%(sale)s' is not valid."
+msgstr ""
+
msgctxt "error:stock.shipment.out:"
msgid "Missing \"Account Revenue\" on product \"%s\"."
msgstr ""
@@ -42,10 +46,6 @@ msgctxt "field:stock.shipment.out,cost_currency:"
msgid "Cost Currency"
msgstr ""
-msgctxt "field:stock.shipment.out,cost_currency_digits:"
-msgid "Cost Currency Digits"
-msgstr ""
-
msgctxt "field:stock.shipment.out,cost_invoice_line:"
msgid "Cost Invoice Line"
msgstr ""
diff --git a/locale/pl.po b/locale/pl.po
index 7c60a8c..623669d 100644
--- a/locale/pl.po
+++ b/locale/pl.po
@@ -1,7 +1,11 @@
-#
+#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
+msgctxt "error:sale.sale:"
+msgid "The carrier '%(carrier)s' on sale '%(sale)s' is not valid."
+msgstr ""
+
msgctxt "error:stock.shipment.out:"
msgid "Missing \"Account Revenue\" on product \"%s\"."
msgstr ""
@@ -16,7 +20,7 @@ msgstr ""
msgctxt "field:sale.line,shipment_cost:"
msgid "Shipment Cost"
-msgstr ""
+msgstr "Koszt wysyłki"
msgctxt "field:sale.sale,available_carriers:"
msgid "Available Carriers"
@@ -36,15 +40,11 @@ msgstr ""
msgctxt "field:stock.shipment.out,cost:"
msgid "Cost"
-msgstr ""
+msgstr "Koszt"
msgctxt "field:stock.shipment.out,cost_currency:"
msgid "Cost Currency"
-msgstr ""
-
-msgctxt "field:stock.shipment.out,cost_currency_digits:"
-msgid "Cost Currency Digits"
-msgstr ""
+msgstr "Koszt waluty"
msgctxt "field:stock.shipment.out,cost_invoice_line:"
msgid "Cost Invoice Line"
diff --git a/locale/pt_BR.po b/locale/pt_BR.po
index c1a07fd..b3e2d82 100644
--- a/locale/pt_BR.po
+++ b/locale/pt_BR.po
@@ -1,7 +1,11 @@
-#
+#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
+msgctxt "error:sale.sale:"
+msgid "The carrier '%(carrier)s' on sale '%(sale)s' is not valid."
+msgstr "A transportadora '%(carrier)s' na venda '%(sale)s' não é válida."
+
msgctxt "error:stock.shipment.out:"
msgid "Missing \"Account Revenue\" on product \"%s\"."
msgstr "A \"Conta de Receitas\" está faltando para o produto \"%s\"."
@@ -42,10 +46,6 @@ msgctxt "field:stock.shipment.out,cost_currency:"
msgid "Cost Currency"
msgstr "Moeda de custo"
-msgctxt "field:stock.shipment.out,cost_currency_digits:"
-msgid "Cost Currency Digits"
-msgstr "Dígitos decimais da moeda de custo"
-
msgctxt "field:stock.shipment.out,cost_invoice_line:"
msgid "Cost Invoice Line"
msgstr "Linha de custo da fatura"
diff --git a/locale/ru.po b/locale/ru.po
index 4533a3a..6181ed7 100644
--- a/locale/ru.po
+++ b/locale/ru.po
@@ -1,7 +1,11 @@
-#
+#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
+msgctxt "error:sale.sale:"
+msgid "The carrier '%(carrier)s' on sale '%(sale)s' is not valid."
+msgstr ""
+
msgctxt "error:stock.shipment.out:"
msgid "Missing \"Account Revenue\" on product \"%s\"."
msgstr ""
@@ -43,10 +47,6 @@ msgctxt "field:stock.shipment.out,cost_currency:"
msgid "Cost Currency"
msgstr ""
-msgctxt "field:stock.shipment.out,cost_currency_digits:"
-msgid "Cost Currency Digits"
-msgstr ""
-
msgctxt "field:stock.shipment.out,cost_invoice_line:"
msgid "Cost Invoice Line"
msgstr ""
diff --git a/locale/sl.po b/locale/sl.po
index 41f581e..c7614be 100644
--- a/locale/sl.po
+++ b/locale/sl.po
@@ -1,7 +1,11 @@
-#
+#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
+msgctxt "error:sale.sale:"
+msgid "The carrier '%(carrier)s' on sale '%(sale)s' is not valid."
+msgstr ""
+
msgctxt "error:stock.shipment.out:"
msgid "Missing \"Account Revenue\" on product \"%s\"."
msgstr "Pri izdelku \"%s\" manjka prihodkovni konto."
@@ -42,10 +46,6 @@ msgctxt "field:stock.shipment.out,cost_currency:"
msgid "Cost Currency"
msgstr "Valuta stroška"
-msgctxt "field:stock.shipment.out,cost_currency_digits:"
-msgid "Cost Currency Digits"
-msgstr "Decimalke stroška"
-
msgctxt "field:stock.shipment.out,cost_invoice_line:"
msgid "Cost Invoice Line"
msgstr "Postavka stroška"
diff --git a/locale/zh_CN.po b/locale/zh_CN.po
index 7c60a8c..af113d3 100644
--- a/locale/zh_CN.po
+++ b/locale/zh_CN.po
@@ -1,7 +1,11 @@
-#
+#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
+msgctxt "error:sale.sale:"
+msgid "The carrier '%(carrier)s' on sale '%(sale)s' is not valid."
+msgstr ""
+
msgctxt "error:stock.shipment.out:"
msgid "Missing \"Account Revenue\" on product \"%s\"."
msgstr ""
@@ -42,10 +46,6 @@ msgctxt "field:stock.shipment.out,cost_currency:"
msgid "Cost Currency"
msgstr ""
-msgctxt "field:stock.shipment.out,cost_currency_digits:"
-msgid "Cost Currency Digits"
-msgstr ""
-
msgctxt "field:stock.shipment.out,cost_invoice_line:"
msgid "Cost Invoice Line"
msgstr ""
diff --git a/sale.py b/sale.py
index 572f10b..3e43ae5 100644
--- a/sale.py
+++ b/sale.py
@@ -1,11 +1,15 @@
# 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 decimal import Decimal
+
from trytond import backend
from trytond.model import ModelView, Workflow, fields
from trytond.transaction import Transaction
from trytond.pyson import Eval, If
from trytond.pool import Pool, PoolMeta
+from trytond.modules.product import price_digits
+
__all__ = ['Configuration', 'ConfigurationSaleMethod', 'Sale', 'SaleLine']
sale_shipment_cost_method = fields.Selection(
'get_sale_shipment_cost_methods', "Sale Shipment Cost Method")
@@ -76,7 +80,7 @@ class Sale:
carrier = fields.Many2One('carrier', 'Carrier',
domain=[
('carrier_product.salable', '=', True),
- If(Eval('state').in_(['draft', 'quotation']),
+ If(Eval('state') == 'draft',
('id', 'in', Eval('available_carriers', [])),
()),
],
@@ -94,6 +98,15 @@ class Sale:
'readonly': Eval('state') != 'draft',
}, depends=['state'])
+ @classmethod
+ def __setup__(cls):
+ super(Sale, cls).__setup__()
+ cls._error_messages.update({
+ 'invalid_carrier': (
+ "The carrier '%(carrier)s' on sale '%(sale)s' "
+ "is not valid."),
+ })
+
@staticmethod
def default_shipment_cost_method():
Config = Pool().get('sale.configuration')
@@ -122,13 +135,14 @@ class Sale:
# XXX We must have the same depends than on_change_with_available_carriers,
# for now it is maintain manually until we can specify cross-kind depends
# on on_changes
- @fields.depends('warehouse', 'shipment_address')
+ @fields.depends('carrier', 'warehouse', 'shipment_address')
def on_change_party(self):
super(Sale, self).on_change_party()
self.available_carriers = self.on_change_with_available_carriers()
- if self.available_carriers:
+ if self.available_carriers and (not self.carrier
+ or self.carrier not in self.available_carriers):
self.carrier = self.available_carriers[0]
- else:
+ elif not self.available_carriers:
self.carrier = None
@fields.depends('carrier', 'warehouse', 'shipment_address')
@@ -138,7 +152,7 @@ class Sale:
if self.available_carriers and (not self.carrier
or self.carrier not in self.available_carriers):
self.carrier = self.available_carriers[0]
- else:
+ elif not self.available_carriers:
self.carrier = None
@fields.depends('carrier', 'warehouse', 'shipment_address')
@@ -154,7 +168,7 @@ class Sale:
if self.available_carriers and (not self.carrier
or self.carrier not in self.available_carriers):
self.carrier = self.available_carriers[0]
- else:
+ elif not self.available_carriers:
self.carrier = None
@classmethod
@@ -171,6 +185,18 @@ class Sale:
Line.delete(removed)
cls.save(sales)
+ @classmethod
+ @ModelView.button
+ @Workflow.transition('confirmed')
+ def confirm(cls, sales):
+ for sale in sales:
+ if sale.carrier and sale.carrier not in sale.available_carriers:
+ cls.raise_user_error('invalid_carrier', {
+ 'sale': sale.rec_name,
+ 'carrier': sale.carrier.rec_name,
+ })
+ super(Sale, cls).confirm(sales)
+
def _get_carrier_context(self):
return {}
@@ -194,7 +220,7 @@ class Sale:
date = self.sale_date or today
with Transaction().set_context(date=date):
cost = Currency.compute(Currency(currency_id), cost,
- self.currency)
+ self.currency, round=False)
cost_line = self.get_shipment_cost_line(cost)
removed = []
@@ -224,6 +250,8 @@ class Sale:
if last_line.sequence is not None:
sequence = last_line.sequence + 1
+ shipment_cost = cost.quantize(
+ Decimal(1) / 10 ** SaleLine.shipment_cost.digits[1])
cost_line = SaleLine(
sale=self,
sequence=sequence,
@@ -231,10 +259,12 @@ class Sale:
product=product,
quantity=1, # XXX
unit=product.sale_uom,
- shipment_cost=cost,
+ shipment_cost=shipment_cost,
)
cost_line.on_change_product()
- cost_line.unit_price = cost_line.amount = cost
+ cost_line.unit_price = cost.quantize(
+ Decimal(1) / 10 ** SaleLine.unit_price.digits[1])
+ cost_line.amount = cost_line.on_change_with_amount()
return cost_line
def create_shipment(self, shipment_type):
@@ -247,6 +277,8 @@ class Sale:
with Transaction().set_context(
shipment.get_carrier_context()):
cost, currency_id = self.carrier.get_sale_price()
+ cost = cost.quantize(
+ Decimal(1) / 10 ** Shipment.cost.digits[1])
Shipment.write([shipment], {
'carrier': self.carrier.id,
'cost': cost,
@@ -281,8 +313,7 @@ class Sale:
class SaleLine:
__metaclass__ = PoolMeta
__name__ = 'sale.line'
- shipment_cost = fields.Numeric('Shipment Cost',
- digits=(16, Eval('_parent_sale', {}).get('currency_digits', 2)))
+ shipment_cost = fields.Numeric('Shipment Cost', digits=price_digits)
def _get_invoice_line_quantity(self):
quantity = super(SaleLine, self)._get_invoice_line_quantity()
@@ -290,3 +321,14 @@ class SaleLine:
and self.sale.shipment_cost_method == 'shipment'):
return 0
return quantity
+
+
+class Promotion:
+ __metaclass__ = PoolMeta
+ __name__ = 'sale.promotion'
+
+ def get_context_formula(self, sale_line):
+ context = super(Promotion, self).get_context_formula(sale_line)
+ if sale_line.shipment_cost:
+ context['names']['unit_price'] = sale_line.shipment_cost
+ return context
diff --git a/setup.cfg b/setup.cfg
index 861a9f5..8bfd5a1 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,5 +1,4 @@
[egg_info]
tag_build =
tag_date = 0
-tag_svn_revision = 0
diff --git a/setup.py b/setup.py
index 3fd6815..36eb820 100644
--- a/setup.py
+++ b/setup.py
@@ -105,9 +105,9 @@ setup(name=name,
'Natural Language :: Spanish',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2.7',
- 'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
+ 'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Office/Business',
diff --git a/stock.py b/stock.py
index c4ca79c..f2343bf 100644
--- a/stock.py
+++ b/stock.py
@@ -1,10 +1,14 @@
# 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 decimal import Decimal
+
from trytond.model import fields
from trytond.pyson import Eval, Bool
from trytond.transaction import Transaction
from trytond.pool import Pool, PoolMeta
+from trytond.modules.product import price_digits
+
__all__ = ['ShipmentOut']
@@ -23,15 +27,12 @@ class ShipmentOut:
'readonly': ~Eval('state').in_(['draft', 'waiting', 'assigned',
'packed']),
}, depends=['carrier', 'state'])
- cost_currency_digits = fields.Function(fields.Integer(
- 'Cost Currency Digits'),
- 'on_change_with_cost_currency_digits')
cost = fields.Numeric('Cost',
- digits=(16, Eval('cost_currency_digits', 2)), states={
+ digits=price_digits, states={
'invisible': ~Eval('carrier'),
'readonly': ~Eval('state').in_(['draft', 'waiting', 'assigned',
'packed']),
- }, depends=['carrier', 'state', 'cost_currency_digits'])
+ }, depends=['carrier', 'state'])
cost_invoice_line = fields.Many2One('account.invoice.line',
'Cost Invoice Line', readonly=True)
@@ -43,12 +44,6 @@ class ShipmentOut:
'product "%s".'),
})
- @fields.depends('cost_currency')
- def on_change_with_cost_currency_digits(self, name=None):
- if self.cost_currency:
- return self.cost_currency.digits
- return 2
-
def _get_carrier_context(self):
return {}
@@ -69,10 +64,9 @@ class ShipmentOut:
return
with Transaction().set_context(self._get_carrier_context()):
cost, currency_id = self.carrier.get_sale_price()
- self.cost = cost
+ self.cost = cost.quantize(
+ Decimal(1) / 10 ** self.__class__.cost.digits[1])
self.cost_currency = currency_id
- self.cost_currency_digits = (self.cost_currency.digits
- if self.cost_currency else 2)
def _get_cost_tax_rule_pattern(self):
'Get tax rule pattern for invoice line'
@@ -104,8 +98,9 @@ class ShipmentOut:
if invoice.currency != self.cost_currency:
with Transaction().set_context(date=invoice.currency_date):
cost = Currency.compute(self.cost_currency, cost,
- invoice.currency)
- invoice_line.unit_price = cost
+ invoice.currency, round=False)
+ invoice_line.unit_price = cost.quantize(
+ Decimal(1) / 10 ** InvoiceLine.unit_price.digits[1])
taxes = []
pattern = self._get_cost_tax_rule_pattern()
diff --git a/tests/scenario_sale_shipment_cost.rst b/tests/scenario_sale_shipment_cost.rst
index efc640b..b85ef53 100644
--- a/tests/scenario_sale_shipment_cost.rst
+++ b/tests/scenario_sale_shipment_cost.rst
@@ -53,9 +53,8 @@ Create product::
>>> ProductUom = Model.get('product.uom')
>>> ProductTemplate = Model.get('product.template')
- >>> Product = Model.get('product.product')
>>> unit, = ProductUom.find([('name', '=', 'Unit')])
- >>> product = Product()
+
>>> template = ProductTemplate()
>>> template.name = 'Product'
>>> template.default_uom = unit
@@ -63,12 +62,10 @@ Create product::
>>> template.salable = True
>>> template.lead_time = datetime.timedelta(0)
>>> template.list_price = Decimal('20')
- >>> template.cost_price = Decimal('8')
>>> template.account_revenue = revenue
>>> template.save()
- >>> product.template = template
- >>> product.save()
- >>> carrier_product = Product()
+ >>> product, = template.products
+
>>> carrier_template = ProductTemplate()
>>> carrier_template.name = 'Carrier Product'
>>> carrier_template.default_uom = unit
@@ -76,11 +73,9 @@ Create product::
>>> carrier_template.salable = True
>>> carrier_template.lead_time = datetime.timedelta(0)
>>> carrier_template.list_price = Decimal('3')
- >>> carrier_template.cost_price = Decimal(0)
>>> carrier_template.account_revenue = revenue
>>> carrier_template.save()
- >>> carrier_product.template = carrier_template
- >>> carrier_product.save()
+ >>> carrier_product, = carrier_template.products
Create carrier::
@@ -137,13 +132,13 @@ Send products::
>>> shipment.carrier == carrier
True
>>> shipment.cost
- Decimal('3')
+ Decimal('3.0000')
>>> shipment.cost_currency == company.currency
True
>>> move, = shipment.inventory_moves
>>> move.quantity = 4
>>> shipment.cost
- Decimal('3')
+ Decimal('3.0000')
>>> shipment.cost_currency == company.currency
True
>>> shipment.state
diff --git a/tox.ini b/tox.ini
new file mode 100644
index 0000000..527d859
--- /dev/null
+++ b/tox.ini
@@ -0,0 +1,18 @@
+[tox]
+envlist = {py27,py34,py35,py36}-{sqlite,postgresql,mysql},pypy-{sqlite,postgresql}
+
+[testenv]
+commands = {envpython} setup.py test
+deps =
+ {py27,py34,py35,py36}-postgresql: psycopg2 >= 2.5
+ pypy-postgresql: psycopg2cffi >= 2.5
+ mysql: MySQL-python
+ sqlite: sqlitebck
+setenv =
+ sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://}
+ postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://}
+ mysql: TRYTOND_DATABASE_URI={env:MYSQL_URI:mysql://}
+ sqlite: DB_NAME={env:SQLITE_NAME::memory:}
+ postgresql: DB_NAME={env:POSTGRESQL_NAME:test}
+ mysql: DB_NAME={env:MYSQL_NAME:test}
+install_command = pip install --pre --find-links https://trydevpi.tryton.org/ {opts} {packages}
diff --git a/tryton.cfg b/tryton.cfg
index 7d15f25..2c32bcc 100644
--- a/tryton.cfg
+++ b/tryton.cfg
@@ -1,5 +1,5 @@
[tryton]
-version=4.4.0
+version=4.6.0
depends:
account_invoice
carrier
@@ -8,6 +8,8 @@ depends:
res
sale
stock
+extras_depends:
+ sale_promotion
xml:
sale.xml
stock.xml
diff --git a/trytond_sale_shipment_cost.egg-info/PKG-INFO b/trytond_sale_shipment_cost.egg-info/PKG-INFO
index 297258c..dc73615 100644
--- a/trytond_sale_shipment_cost.egg-info/PKG-INFO
+++ b/trytond_sale_shipment_cost.egg-info/PKG-INFO
@@ -1,12 +1,12 @@
Metadata-Version: 1.1
Name: trytond-sale-shipment-cost
-Version: 4.4.0
+Version: 4.6.0
Summary: Tryton module for sale shipment cost
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.4/
+Download-URL: http://downloads.tryton.org/4.6/
Description: trytond_sale_shipment_cost
==========================
@@ -70,9 +70,9 @@ Classifier: Natural Language :: Slovenian
Classifier: Natural Language :: Spanish
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 2.7
-Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
+Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Office/Business
diff --git a/trytond_sale_shipment_cost.egg-info/SOURCES.txt b/trytond_sale_shipment_cost.egg-info/SOURCES.txt
index e1d6a4b..e5bdbad 100644
--- a/trytond_sale_shipment_cost.egg-info/SOURCES.txt
+++ b/trytond_sale_shipment_cost.egg-info/SOURCES.txt
@@ -1,12 +1,18 @@
+.drone.yml
+.hgtags
CHANGELOG
COPYRIGHT
INSTALL
LICENSE
MANIFEST.in
README
+__init__.py
+sale.py
sale.xml
setup.py
+stock.py
stock.xml
+tox.ini
tryton.cfg
./__init__.py
./sale.py
@@ -58,7 +64,9 @@ locale/pt_BR.po
locale/ru.po
locale/sl.po
locale/zh_CN.po
+tests/__init__.py
tests/scenario_sale_shipment_cost.rst
+tests/test_sale_shipment_cost.py
trytond_sale_shipment_cost.egg-info/PKG-INFO
trytond_sale_shipment_cost.egg-info/SOURCES.txt
trytond_sale_shipment_cost.egg-info/dependency_links.txt
diff --git a/trytond_sale_shipment_cost.egg-info/requires.txt b/trytond_sale_shipment_cost.egg-info/requires.txt
index 2c49639..2ce0bf0 100644
--- a/trytond_sale_shipment_cost.egg-info/requires.txt
+++ b/trytond_sale_shipment_cost.egg-info/requires.txt
@@ -1,6 +1,6 @@
-trytond_account_invoice >= 4.4, < 4.5
-trytond_carrier >= 4.4, < 4.5
-trytond_currency >= 4.4, < 4.5
-trytond_sale >= 4.4, < 4.5
-trytond_stock >= 4.4, < 4.5
-trytond >= 4.4, < 4.5
+trytond_account_invoice >= 4.6, < 4.7
+trytond_carrier >= 4.6, < 4.7
+trytond_currency >= 4.6, < 4.7
+trytond_sale >= 4.6, < 4.7
+trytond_stock >= 4.6, < 4.7
+trytond >= 4.6, < 4.7
--
tryton-modules-sale-shipment-cost
More information about the tryton-debian-vcs
mailing list