[tryton-debian-vcs] tryton-modules-carrier-weight branch upstream created. 2026515e02ffead8aa9cff1cadbda0e4c84250e8
Mathias Behrle
tryton-debian-vcs at alioth.debian.org
Wed Nov 27 17:00:35 UTC 2013
The following commit has been merged in the upstream branch:
https://alioth.debian.org/plugins/scmgit/cgi-bin/gitweb.cgi/?p=tryton/tryton-modules-carrier-weight.git;a=commitdiff;h=2026515e02ffead8aa9cff1cadbda0e4c84250e8
commit 2026515e02ffead8aa9cff1cadbda0e4c84250e8
Author: Mathias Behrle <mathiasb at m9s.biz>
Date: Sun Nov 24 17:26:54 2013 +0100
Adding upstream version 3.0.0.
diff --git a/CHANGELOG b/CHANGELOG
index 8d85d43..69dc0e9 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+Version 3.0.0 - 2013-10-21
+* Bug fixes (see mercurial logs for details)
+
Version 2.8.0 - 2013-04-22
* Bug fixes (see mercurial logs for details)
diff --git a/PKG-INFO b/PKG-INFO
index 9b9465a..ee71556 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,12 +1,12 @@
Metadata-Version: 1.1
Name: trytond_carrier_weight
-Version: 2.8.0
+Version: 3.0.0
Summary: Tryton module to add cost method "on weight" on carrier
Home-page: http://www.tryton.org/
Author: Tryton
Author-email: UNKNOWN
License: GPL-3
-Download-URL: http://downloads.tryton.org/2.8/
+Download-URL: http://downloads.tryton.org/3.0/
Description: trytond_carrier_weight
======================
@@ -58,6 +58,7 @@ Classifier: Natural Language :: English
Classifier: Natural Language :: French
Classifier: Natural Language :: German
Classifier: Natural Language :: Russian
+Classifier: Natural Language :: Slovenian
Classifier: Natural Language :: Spanish
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 2.6
diff --git a/locale/es_AR.po b/locale/es_AR.po
index f9be67f..4470e94 100644
--- a/locale/es_AR.po
+++ b/locale/es_AR.po
@@ -4,7 +4,7 @@ msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:carrier,weight_currency:"
msgid "Currency"
-msgstr "Divisa"
+msgstr "Moneda"
msgctxt "field:carrier,weight_currency_digits:"
msgid "Weight Currency Digits"
diff --git a/locale/es_AR.po b/locale/sl_SI.po
similarity index 73%
copy from locale/es_AR.po
copy to locale/sl_SI.po
index f9be67f..ba8c65e 100644
--- a/locale/es_AR.po
+++ b/locale/sl_SI.po
@@ -4,35 +4,35 @@ msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:carrier,weight_currency:"
msgid "Currency"
-msgstr "Divisa"
+msgstr "Valuta"
msgctxt "field:carrier,weight_currency_digits:"
msgid "Weight Currency Digits"
-msgstr "Dígitos moneda del peso"
+msgstr "Decimalke"
msgctxt "field:carrier,weight_price_list:"
msgid "Price List"
-msgstr "Lista de precios"
+msgstr "Cenik"
msgctxt "field:carrier,weight_uom:"
msgid "Weight Uom"
-msgstr "UdM del Peso"
+msgstr "ME za težo"
msgctxt "field:carrier,weight_uom_digits:"
msgid "Weight Uom Digits"
-msgstr "Dígitos UdM del Peso"
+msgstr "Decimalke za težo"
msgctxt "field:carrier.weight_price_list,carrier:"
msgid "Carrier"
-msgstr "Transportista"
+msgstr "Špediter"
msgctxt "field:carrier.weight_price_list,create_date:"
msgid "Create Date"
-msgstr "Fecha creación"
+msgstr "Ustvarjeno"
msgctxt "field:carrier.weight_price_list,create_uid:"
msgid "Create User"
-msgstr "Usuario creación"
+msgstr "Ustvaril"
msgctxt "field:carrier.weight_price_list,id:"
msgid "ID"
@@ -40,36 +40,36 @@ msgstr "ID"
msgctxt "field:carrier.weight_price_list,price:"
msgid "Price"
-msgstr "Precio"
+msgstr "Cena"
msgctxt "field:carrier.weight_price_list,rec_name:"
msgid "Name"
-msgstr "Nombre"
+msgstr "Ime"
msgctxt "field:carrier.weight_price_list,weight:"
msgid "Weight"
-msgstr "Peso"
+msgstr "Teža"
msgctxt "field:carrier.weight_price_list,write_date:"
msgid "Write Date"
-msgstr "Fecha modificación"
+msgstr "Zapisano"
msgctxt "field:carrier.weight_price_list,write_uid:"
msgid "Write User"
-msgstr "Usuario modificación"
+msgstr "Zapisal"
msgctxt "model:carrier.weight_price_list,name:"
msgid "Carrier Weight Price List"
-msgstr "Lista de precios del peso transportista"
+msgstr "Ceniki po teži"
msgctxt "selection:carrier,carrier_cost_method:"
msgid "Weight"
-msgstr "Peso"
+msgstr "Teža"
msgctxt "view:carrier.weight_price_list:"
msgid "Carrier Weight Price List"
-msgstr "Lista de precios del peso transportista"
+msgstr "Cenik po teži"
msgctxt "view:carrier.weight_price_list:"
msgid "Carrier Weight Price Lists"
-msgstr "Listas de precios del peso transportista"
+msgstr "Ceniki po teži"
diff --git a/setup.py b/setup.py
index afd6671..cf682f6 100644
--- a/setup.py
+++ b/setup.py
@@ -62,6 +62,7 @@ setup(name='trytond_carrier_weight',
'Natural Language :: French',
'Natural Language :: German',
'Natural Language :: Russian',
+ 'Natural Language :: Slovenian',
'Natural Language :: Spanish',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2.6',
diff --git a/stock.py b/stock.py
index f7cc078..0511f59 100644
--- a/stock.py
+++ b/stock.py
@@ -37,7 +37,10 @@ class ShipmentIn:
for key, parcel in groupby(lines, key=keyfunc):
weight = 0
for line in parcel:
- if line.product and line.quantity and line.uom:
+ if (line.product
+ and line.quantity
+ and line.uom
+ and line.product.weight):
quantity = Uom.compute_qty(line.uom, line.quantity,
line.product.default_uom, round=False)
weight += Uom.compute_qty(line.product.weight_uom,
@@ -75,7 +78,10 @@ class ShipmentOut:
for key, parcel in groupby(lines, key=keyfunc):
weight = 0
for line in parcel:
- if line.product and line.quantity and line.uom:
+ if (line.product
+ and line.quantity
+ and line.uom
+ and line.product.weight):
quantity = Uom.compute_qty(line.uom, line.quantity,
line.product.default_uom, round=False)
weight += Uom.compute_qty(line.product.weight_uom,
diff --git a/tests/__init__.py b/tests/__init__.py
index c01b6bf..9d9ea3e 100644
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -2,3 +2,5 @@
#this repository contains the full copyright notices and license terms.
from test_carrier_weight import suite
+
+__all__ = ['suite']
diff --git a/tests/scenario_carrier_weight.rst b/tests/scenario_carrier_weight.rst
index d135e20..61f9a76 100644
--- a/tests/scenario_carrier_weight.rst
+++ b/tests/scenario_carrier_weight.rst
@@ -89,7 +89,7 @@ Create chart of accounts::
>>> AccountTemplate = Model.get('account.account.template')
>>> Account = Model.get('account.account')
>>> AccountJournal = Model.get('account.journal')
- >>> account_template, = AccountTemplate.find([('parent', '=', False)])
+ >>> account_template, = AccountTemplate.find([('parent', '=', None)])
>>> create_chart = Wizard('account.create_chart')
>>> create_chart.execute('account')
>>> create_chart.form.account_template = account_template
diff --git a/tryton.cfg b/tryton.cfg
index bb7f271..fcc9507 100644
--- a/tryton.cfg
+++ b/tryton.cfg
@@ -1,5 +1,5 @@
[tryton]
-version=2.8.0
+version=3.0.0
depends:
carrier
company
diff --git a/trytond_carrier_weight.egg-info/PKG-INFO b/trytond_carrier_weight.egg-info/PKG-INFO
index d5cca13..57fbd58 100644
--- a/trytond_carrier_weight.egg-info/PKG-INFO
+++ b/trytond_carrier_weight.egg-info/PKG-INFO
@@ -1,12 +1,12 @@
Metadata-Version: 1.1
Name: trytond-carrier-weight
-Version: 2.8.0
+Version: 3.0.0
Summary: Tryton module to add cost method "on weight" on carrier
Home-page: http://www.tryton.org/
Author: Tryton
Author-email: UNKNOWN
License: GPL-3
-Download-URL: http://downloads.tryton.org/2.8/
+Download-URL: http://downloads.tryton.org/3.0/
Description: trytond_carrier_weight
======================
@@ -58,6 +58,7 @@ Classifier: Natural Language :: English
Classifier: Natural Language :: French
Classifier: Natural Language :: German
Classifier: Natural Language :: Russian
+Classifier: Natural Language :: Slovenian
Classifier: Natural Language :: Spanish
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 2.6
diff --git a/trytond_carrier_weight.egg-info/SOURCES.txt b/trytond_carrier_weight.egg-info/SOURCES.txt
index ceecda8..b023ba6 100644
--- a/trytond_carrier_weight.egg-info/SOURCES.txt
+++ b/trytond_carrier_weight.egg-info/SOURCES.txt
@@ -24,6 +24,7 @@ locale/es_ES.po
locale/fr_FR.po
locale/nl_NL.po
locale/ru_RU.po
+locale/sl_SI.po
tests/scenario_carrier_weight.rst
trytond_carrier_weight.egg-info/PKG-INFO
trytond_carrier_weight.egg-info/SOURCES.txt
diff --git a/trytond_carrier_weight.egg-info/requires.txt b/trytond_carrier_weight.egg-info/requires.txt
index 2660c84..96ada65 100644
--- a/trytond_carrier_weight.egg-info/requires.txt
+++ b/trytond_carrier_weight.egg-info/requires.txt
@@ -1,6 +1,6 @@
-trytond_carrier >= 2.8, < 2.9
-trytond_company >= 2.8, < 2.9
-trytond_currency >= 2.8, < 2.9
-trytond_product >= 2.8, < 2.9
-trytond_product_measurements >= 2.8, < 2.9
-trytond >= 2.8, < 2.9
\ No newline at end of file
+trytond_carrier >= 3.0, < 3.1
+trytond_company >= 3.0, < 3.1
+trytond_currency >= 3.0, < 3.1
+trytond_product >= 3.0, < 3.1
+trytond_product_measurements >= 3.0, < 3.1
+trytond >= 3.0, < 3.1
\ No newline at end of file
commit 6dcf99c60b3764565aaa8686cd6bcf347fad735e
Author: Mathias Behrle <mathiasb at m9s.biz>
Date: Thu May 2 00:35:48 2013 +0200
Adding upstream version 2.8.0.
diff --git a/CHANGELOG b/CHANGELOG
index d2beb67..8d85d43 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+Version 2.8.0 - 2013-04-22
+* Bug fixes (see mercurial logs for details)
+
Version 2.6.0 - 2012-10-22
* Bug fixes (see mercurial logs for details)
diff --git a/COPYRIGHT b/COPYRIGHT
index 7fcb680..cb2d2c5 100644
--- a/COPYRIGHT
+++ b/COPYRIGHT
@@ -1,7 +1,7 @@
-Copyright (C) 2011-2012 Cédric Krier.
-Copyright (C) 2011-2012 Bertrand Chenal.
+Copyright (C) 2011-2013 Cédric Krier.
+Copyright (C) 2011-2013 Bertrand Chenal.
Copyright (C) 2011 Nicolas Évrard.
-Copyright (C) 2011-2012 B2CK SPRL.
+Copyright (C) 2011-2013 B2CK SPRL.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/MANIFEST.in b/MANIFEST.in
index 07449ff..05c3f79 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -5,6 +5,7 @@ include CHANGELOG
include LICENSE
include tryton.cfg
include *.xml
+include view/*.xml
include *.odt
include locale/*.po
include doc/*
diff --git a/PKG-INFO b/PKG-INFO
index daa1150..9b9465a 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,12 +1,12 @@
-Metadata-Version: 1.0
+Metadata-Version: 1.1
Name: trytond_carrier_weight
-Version: 2.6.0
+Version: 2.8.0
Summary: Tryton module to add cost method "on weight" on carrier
Home-page: http://www.tryton.org/
Author: Tryton
Author-email: UNKNOWN
License: GPL-3
-Download-URL: http://downloads.tryton.org/2.6/
+Download-URL: http://downloads.tryton.org/2.8/
Description: trytond_carrier_weight
======================
diff --git a/carrier.xml b/carrier.xml
index b1e6c37..2db69e1 100644
--- a/carrier.xml
+++ b/carrier.xml
@@ -5,76 +5,20 @@ this repository contains the full copyright notices and license terms. -->
<data>
<record model="ir.ui.view" id="carrier_view_form">
<field name="model">carrier</field>
- <field name="inherit" ref="carrier.carrier_view_form"/>
- <field name="arch" type="xml">
- <![CDATA[
- <data>
- <xpath
- expr="/form/notebook/page[@id='carrier']/field[@name='carrier_cost_method']"
- position="after">
- <newline/>
- <label name="weight_uom"/>
- <field name="weight_uom"/>
- <label name="weight_currency"/>
- <field name="weight_currency"/>
- <field name="weight_price_list" colspan="4"/>
- </xpath>
- </data>
- ]]>
- </field>
- </record>
-
- <record model="ir.ui.view" id="carrier_view_form2">
- <field name="model">carrier</field>
<field name="type">form</field>
- <field name="inherit" ref="carrier.carrier_view_form2"/>
- <field name="arch" type="xml">
- <![CDATA[
- <data>
- <xpath
- expr="/form/field[@name='carrier_cost_method']"
- position="after">
- <newline/>
- <label name="weight_uom"/>
- <field name="weight_uom"/>
- <label name="weight_currency"/>
- <field name="weight_currency"/>
- <field name="weight_price_list" colspan="4"/>
- </xpath>
- </data>
- ]]>
- </field>
+ <field name="inherit" ref="carrier.carrier_view_form"/>
+ <field name="name">carrier_form</field>
</record>
<record model="ir.ui.view" id="weight_price_list_view_form">
<field name="model">carrier.weight_price_list</field>
<field name="type">form</field>
- <field name="arch" type="xml">
- <![CDATA[
- <form string="Carrier Weight Price List">
- <label name="carrier"/>
- <field name="carrier"/>
- <newline/>
- <label name="weight"/>
- <field name="weight"/>
- <label name="price"/>
- <field name="price"/>
- </form>
- ]]>
- </field>
+ <field name="name">weight_price_list_form</field>
</record>
<record model="ir.ui.view" id="weight_price_list_view_tree">
<field name="model">carrier.weight_price_list</field>
<field name="type">tree</field>
- <field name="arch" type="xml">
- <![CDATA[
- <tree string="Carrier Weight Price Lists">
- <field name="carrier"/>
- <field name="weight"/>
- <field name="price"/>
- </tree>
- ]]>
- </field>
+ <field name="name">weight_price_list_tree</field>
</record>
</data>
</tryton>
diff --git a/locale/de_DE.po b/locale/de_DE.po
index a7730b2..7984fd0 100644
--- a/locale/de_DE.po
+++ b/locale/de_DE.po
@@ -73,7 +73,3 @@ msgstr "Frachtgewicht Preisliste"
msgctxt "view:carrier.weight_price_list:"
msgid "Carrier Weight Price Lists"
msgstr "Frachtgewicht Preislisten"
-
-msgctxt "view:carrier.weight_price_list:"
-msgid "Höhe Stellen"
-msgstr "Frachtgewicht Preislisten"
diff --git a/locale/es_AR.po b/locale/es_AR.po
index 0dbc120..f9be67f 100644
--- a/locale/es_AR.po
+++ b/locale/es_AR.po
@@ -4,11 +4,11 @@ msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:carrier,weight_currency:"
msgid "Currency"
-msgstr "Gestión de divisas"
+msgstr "Divisa"
msgctxt "field:carrier,weight_currency_digits:"
msgid "Weight Currency Digits"
-msgstr "Dígitos Moneda del Peso"
+msgstr "Dígitos moneda del peso"
msgctxt "field:carrier,weight_price_list:"
msgid "Price List"
@@ -60,7 +60,7 @@ msgstr "Usuario modificación"
msgctxt "model:carrier.weight_price_list,name:"
msgid "Carrier Weight Price List"
-msgstr "Lista de precios del Peso Transportista"
+msgstr "Lista de precios del peso transportista"
msgctxt "selection:carrier,carrier_cost_method:"
msgid "Weight"
@@ -68,8 +68,8 @@ msgstr "Peso"
msgctxt "view:carrier.weight_price_list:"
msgid "Carrier Weight Price List"
-msgstr "Lista de precios del Peso Transportista"
+msgstr "Lista de precios del peso transportista"
msgctxt "view:carrier.weight_price_list:"
msgid "Carrier Weight Price Lists"
-msgstr "Listas de precios del Peso Transportista"
+msgstr "Listas de precios del peso transportista"
diff --git a/locale/fr_FR.po b/locale/fr_FR.po
index 7805c4f..d657841 100644
--- a/locale/fr_FR.po
+++ b/locale/fr_FR.po
@@ -58,10 +58,9 @@ msgctxt "field:carrier.weight_price_list,write_uid:"
msgid "Write User"
msgstr "Mis à jour par"
-#, fuzzy
msgctxt "model:carrier.weight_price_list,name:"
msgid "Carrier Weight Price List"
-msgstr "carrier.weight_price_list"
+msgstr "Liste de prix par poids"
msgctxt "selection:carrier,carrier_cost_method:"
msgid "Weight"
diff --git a/locale/ru_RU.po b/locale/ru_RU.po
index 7122875..1387cc6 100644
--- a/locale/ru_RU.po
+++ b/locale/ru_RU.po
@@ -27,17 +27,20 @@ msgctxt "field:carrier.weight_price_list,carrier:"
msgid "Carrier"
msgstr ""
+#, fuzzy
msgctxt "field:carrier.weight_price_list,create_date:"
msgid "Create Date"
-msgstr ""
+msgstr "Дата создания"
+#, fuzzy
msgctxt "field:carrier.weight_price_list,create_uid:"
msgid "Create User"
-msgstr ""
+msgstr "Создано пользователем"
+#, fuzzy
msgctxt "field:carrier.weight_price_list,id:"
msgid "ID"
-msgstr ""
+msgstr "ID"
msgctxt "field:carrier.weight_price_list,price:"
msgid "Price"
@@ -53,13 +56,15 @@ msgctxt "field:carrier.weight_price_list,weight:"
msgid "Weight"
msgstr "Ширина"
+#, fuzzy
msgctxt "field:carrier.weight_price_list,write_date:"
msgid "Write Date"
-msgstr ""
+msgstr "Дата изменения"
+#, fuzzy
msgctxt "field:carrier.weight_price_list,write_uid:"
msgid "Write User"
-msgstr ""
+msgstr "Изменено пользователем"
msgctxt "model:carrier.weight_price_list,name:"
msgid "Carrier Weight Price List"
diff --git a/setup.py b/setup.py
index b9ef657..afd6671 100644
--- a/setup.py
+++ b/setup.py
@@ -25,10 +25,10 @@ requires = []
for dep in info.get('depends', []):
if not re.match(r'(ir|res|webdav)(\W|$)', dep):
requires.append('trytond_%s >= %s.%s, < %s.%s' %
- (dep, major_version, minor_version, major_version,
- minor_version + 1))
+ (dep, major_version, minor_version, major_version,
+ minor_version + 1))
requires.append('trytond >= %s.%s, < %s.%s' %
- (major_version, minor_version, major_version, minor_version + 1))
+ (major_version, minor_version, major_version, minor_version + 1))
setup(name='trytond_carrier_weight',
version=info.get('version', '0.0.1'),
@@ -36,16 +36,16 @@ setup(name='trytond_carrier_weight',
long_description=read('README'),
author='Tryton',
url='http://www.tryton.org/',
- download_url="http://downloads.tryton.org/" + \
- info.get('version', '0.0.1').rsplit('.', 1)[0] + '/',
+ download_url=("http://downloads.tryton.org/" +
+ info.get('version', '0.0.1').rsplit('.', 1)[0] + '/'),
package_dir={'trytond.modules.carrier_weight': '.'},
packages=[
'trytond.modules.carrier_weight',
'trytond.modules.carrier_weight.tests',
],
package_data={
- 'trytond.modules.carrier_weight': info.get('xml', []) \
- + ['tryton.cfg', 'locale/*.po', 'tests/*.rst'],
+ 'trytond.modules.carrier_weight': (info.get('xml', [])
+ + ['tryton.cfg', 'view/*.xml', 'locale/*.po', 'tests/*.rst']),
},
classifiers=[
'Development Status :: 5 - Production/Stable',
diff --git a/tests/scenario_carrier_weight.rst b/tests/scenario_carrier_weight.rst
index 3ff2c17..d135e20 100644
--- a/tests/scenario_carrier_weight.rst
+++ b/tests/scenario_carrier_weight.rst
@@ -33,10 +33,13 @@ Create company::
>>> Currency = Model.get('currency.currency')
>>> CurrencyRate = Model.get('currency.currency.rate')
>>> Company = Model.get('company.company')
+ >>> Party = Model.get('party.party')
>>> company_config = Wizard('company.company.config')
>>> company_config.execute('company')
>>> company = company_config.form
- >>> company.name = 'B2CK'
+ >>> party = Party(name='B2CK')
+ >>> party.save()
+ >>> company.party = party
>>> currencies = Currency.find([('code', '=', 'EUR')])
>>> if not currencies:
... currency = Currency(name='Euro', symbol=u'€', code='EUR',
@@ -129,30 +132,37 @@ Create category::
Create product::
>>> ProductUom = Model.get('product.uom')
+ >>> ProductTemplate = Model.get('product.template')
>>> Product = Model.get('product.product')
>>> unit, = ProductUom.find([('name', '=', 'Unit')])
>>> gram, = ProductUom.find([('name', '=', 'Gram')])
>>> product = Product()
- >>> product.name = 'Product'
- >>> product.category = category
- >>> product.default_uom = unit
- >>> product.type = 'goods'
- >>> product.salable = True
- >>> product.list_price = Decimal('20')
- >>> product.cost_price = Decimal('8')
- >>> product.account_revenue = revenue
- >>> product.weight = 250
- >>> product.weight_uom = gram
+ >>> template = ProductTemplate()
+ >>> template.name = 'Product'
+ >>> template.category = category
+ >>> template.default_uom = unit
+ >>> template.type = 'goods'
+ >>> template.salable = True
+ >>> template.list_price = Decimal('20')
+ >>> template.cost_price = Decimal('8')
+ >>> template.account_revenue = revenue
+ >>> template.weight = 250
+ >>> template.weight_uom = gram
+ >>> template.save()
+ >>> product.template = template
>>> product.save()
>>> carrier_product = Product()
- >>> carrier_product.name = 'Carrier Product'
- >>> carrier_product.category = category
- >>> carrier_product.default_uom = unit
- >>> carrier_product.type = 'service'
- >>> carrier_product.salable = True
- >>> carrier_product.list_price = Decimal('3')
- >>> carrier_product.cost_price = Decimal('3')
- >>> carrier_product.account_revenue = revenue
+ >>> carrier_template = ProductTemplate()
+ >>> carrier_template.name = 'Carrier Product'
+ >>> carrier_template.category = category
+ >>> carrier_template.default_uom = unit
+ >>> carrier_template.type = 'service'
+ >>> carrier_template.salable = True
+ >>> carrier_template.list_price = Decimal('3')
+ >>> carrier_template.cost_price = Decimal('3')
+ >>> carrier_template.account_revenue = revenue
+ >>> carrier_template.save()
+ >>> carrier_product.template = carrier_template
>>> carrier_product.save()
Create carrier::
@@ -161,7 +171,9 @@ Create carrier::
>>> WeightPriceList = Model.get('carrier.weight_price_list')
>>> kilogram, = ProductUom.find([('name', '=', 'Kilogram')])
>>> carrier = Carrier()
- >>> carrier.name = 'Carrier'
+ >>> party = Party(name='Carrier')
+ >>> party.save()
+ >>> carrier.party = party
>>> carrier.carrier_product = carrier_product
>>> carrier.carrier_cost_method = 'weight'
>>> carrier.weight_currency = currency
diff --git a/tests/test_carrier_weight.py b/tests/test_carrier_weight.py
index 5e19887..cc35240 100644
--- a/tests/test_carrier_weight.py
+++ b/tests/test_carrier_weight.py
@@ -27,6 +27,7 @@ class CarrierWeightTestCase(unittest.TestCase):
trytond.tests.test_tryton.install_module('carrier_weight')
self.party = POOL.get('party.party')
self.uom = POOL.get('product.uom')
+ self.template = POOL.get('product.template')
self.product = POOL.get('product.product')
self.category = POOL.get('product.category')
self.currency = POOL.get('currency.currency')
@@ -50,42 +51,45 @@ class CarrierWeightTestCase(unittest.TestCase):
Test compute_weight_price.
'''
with Transaction().start(DB_NAME, USER, context=CONTEXT):
- party = self.party.create({
- 'name': 'Carrier',
- })
+ party, = self.party.create([{
+ 'name': 'Carrier',
+ }])
uom, = self.uom.search([
('name', '=', 'Unit'),
])
- category = self.category.create({
- 'name': 'Category',
- })
- product = self.product.create({
- 'name': 'Carrier',
- 'default_uom': uom.id,
- 'category': category.id,
- 'type': 'service',
- 'list_price': Decimal(0),
- 'cost_price': Decimal(0),
- })
+ category, = self.category.create([{
+ 'name': 'Category',
+ }])
+ template, = self.template.create([{
+ 'name': 'Carrier',
+ 'default_uom': uom.id,
+ 'category': category.id,
+ 'type': 'service',
+ 'list_price': Decimal(0),
+ 'cost_price': Decimal(0),
+ }])
+ product, = self.product.create([{
+ 'template': template.id,
+ }])
weight_uom, = self.uom.search([
('name', '=', 'Kilogram'),
])
currency, = self.currency.search([
('code', '=', 'cu1'),
])
- carrier = self.carrier.create({
- 'party': party.id,
- 'carrier_product': product.id,
- 'carrier_cost_method': 'weight',
- 'weight_uom': weight_uom.id,
- 'weight_currency': currency.id,
- })
+ carrier, = self.carrier.create([{
+ 'party': party.id,
+ 'carrier_product': product.id,
+ 'carrier_cost_method': 'weight',
+ 'weight_uom': weight_uom.id,
+ 'weight_currency': currency.id,
+ }])
for i, weight in enumerate(xrange(0, 100, 20)):
- self.weight_price_list.create({
- 'carrier': carrier.id,
- 'weight': weight,
- 'price': Decimal(i),
- })
+ self.weight_price_list.create([{
+ 'carrier': carrier.id,
+ 'weight': weight,
+ 'price': Decimal(i),
+ }])
self.assertEqual(
carrier.compute_weight_price(0), Decimal(0))
for weight, price in [
diff --git a/tryton.cfg b/tryton.cfg
index c3407df..bb7f271 100644
--- a/tryton.cfg
+++ b/tryton.cfg
@@ -1,5 +1,5 @@
[tryton]
-version=2.6.0
+version=2.8.0
depends:
carrier
company
diff --git a/trytond_carrier_weight.egg-info/PKG-INFO b/trytond_carrier_weight.egg-info/PKG-INFO
index 71ca47b..d5cca13 100644
--- a/trytond_carrier_weight.egg-info/PKG-INFO
+++ b/trytond_carrier_weight.egg-info/PKG-INFO
@@ -1,12 +1,12 @@
-Metadata-Version: 1.0
+Metadata-Version: 1.1
Name: trytond-carrier-weight
-Version: 2.6.0
+Version: 2.8.0
Summary: Tryton module to add cost method "on weight" on carrier
Home-page: http://www.tryton.org/
Author: Tryton
Author-email: UNKNOWN
License: GPL-3
-Download-URL: http://downloads.tryton.org/2.6/
+Download-URL: http://downloads.tryton.org/2.8/
Description: trytond_carrier_weight
======================
diff --git a/trytond_carrier_weight.egg-info/SOURCES.txt b/trytond_carrier_weight.egg-info/SOURCES.txt
index 4877f01..ceecda8 100644
--- a/trytond_carrier_weight.egg-info/SOURCES.txt
+++ b/trytond_carrier_weight.egg-info/SOURCES.txt
@@ -31,4 +31,7 @@ trytond_carrier_weight.egg-info/dependency_links.txt
trytond_carrier_weight.egg-info/entry_points.txt
trytond_carrier_weight.egg-info/not-zip-safe
trytond_carrier_weight.egg-info/requires.txt
-trytond_carrier_weight.egg-info/top_level.txt
\ No newline at end of file
+trytond_carrier_weight.egg-info/top_level.txt
+view/carrier_form.xml
+view/weight_price_list_form.xml
+view/weight_price_list_tree.xml
\ No newline at end of file
diff --git a/trytond_carrier_weight.egg-info/requires.txt b/trytond_carrier_weight.egg-info/requires.txt
index 2aa6f21..2660c84 100644
--- a/trytond_carrier_weight.egg-info/requires.txt
+++ b/trytond_carrier_weight.egg-info/requires.txt
@@ -1,6 +1,6 @@
-trytond_carrier >= 2.6, < 2.7
-trytond_company >= 2.6, < 2.7
-trytond_currency >= 2.6, < 2.7
-trytond_product >= 2.6, < 2.7
-trytond_product_measurements >= 2.6, < 2.7
-trytond >= 2.6, < 2.7
\ No newline at end of file
+trytond_carrier >= 2.8, < 2.9
+trytond_company >= 2.8, < 2.9
+trytond_currency >= 2.8, < 2.9
+trytond_product >= 2.8, < 2.9
+trytond_product_measurements >= 2.8, < 2.9
+trytond >= 2.8, < 2.9
\ No newline at end of file
diff --git a/view/carrier_form.xml b/view/carrier_form.xml
new file mode 100644
index 0000000..cc4066d
--- /dev/null
+++ b/view/carrier_form.xml
@@ -0,0 +1,13 @@
+<?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='carrier_cost_method']" position="after">
+ <newline/>
+ <label name="weight_uom"/>
+ <field name="weight_uom"/>
+ <label name="weight_currency"/>
+ <field name="weight_currency"/>
+ <field name="weight_price_list" colspan="4"/>
+ </xpath>
+</data>
diff --git a/view/weight_price_list_form.xml b/view/weight_price_list_form.xml
new file mode 100644
index 0000000..9d0de92
--- /dev/null
+++ b/view/weight_price_list_form.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. -->
+<form string="Carrier Weight Price List">
+ <label name="carrier"/>
+ <field name="carrier"/>
+ <newline/>
+ <label name="weight"/>
+ <field name="weight"/>
+ <label name="price"/>
+ <field name="price"/>
+</form>
diff --git a/view/weight_price_list_tree.xml b/view/weight_price_list_tree.xml
new file mode 100644
index 0000000..fe87563
--- /dev/null
+++ b/view/weight_price_list_tree.xml
@@ -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. -->
+<tree string="Carrier Weight Price Lists">
+ <field name="carrier"/>
+ <field name="weight"/>
+ <field name="price"/>
+</tree>
--
tryton-modules-carrier-weight
More information about the tryton-debian-vcs
mailing list