openerp-community-reviewer team mailing list archive
-
openerp-community-reviewer team
-
Mailing list archive
-
Message #04781
[Merge] lp:~camptocamp/carriers-deliveries/7.0-base_delivery_carrier_files-rde into lp:carriers-deliveries
Romain Deheele - Camptocamp has proposed merging lp:~camptocamp/carriers-deliveries/7.0-base_delivery_carrier_files-rde into lp:carriers-deliveries.
Requested reviews:
Stock and Logistic Core Editors (stock-logistic-core-editors)
For more details, see:
https://code.launchpad.net/~camptocamp/carriers-deliveries/7.0-base_delivery_carrier_files-rde/+merge/210760
Hello,
base_delivery_carrier_files V7 port implies:
- reformat to v7 standards
- addings in carrier_file_demo.yml because of demo datas in stock addon existing in v6.1 but commented in v7.0
- updates in generic_generator.py because of v7 partner/address/contact changes
It's a first draft : yml tests works well, no functional tests for the moment.
Regards,
Romain
--
https://code.launchpad.net/~camptocamp/carriers-deliveries/7.0-base_delivery_carrier_files-rde/+merge/210760
Your team Stock and Logistic Core Editors is requested to review the proposed merge of lp:~camptocamp/carriers-deliveries/7.0-base_delivery_carrier_files-rde into lp:carriers-deliveries.
=== modified file 'base_delivery_carrier_files/__init__.py'
--- base_delivery_carrier_files/__init__.py 2012-04-02 06:59:30 +0000
+++ base_delivery_carrier_files/__init__.py 2014-03-13 09:41:40 +0000
@@ -19,8 +19,8 @@
#
##############################################################################
-import generator
-import carrier_file
-import stock
-import csv_writer
-import wizard
+from . import generator
+from . import carrier_file
+from . import stock
+from . import csv_writer
+from . import wizard
=== modified file 'base_delivery_carrier_files/__openerp__.py'
--- base_delivery_carrier_files/__openerp__.py 2013-11-11 14:03:34 +0000
+++ base_delivery_carrier_files/__openerp__.py 2014-03-13 09:41:40 +0000
@@ -45,16 +45,15 @@
'depends': ['base',
'stock',
'delivery'],
- 'init_xml': [],
- 'update_xml': ['carrier_file_view.xml',
- 'stock_view.xml',
- 'wizard/generate_carrier_files_view.xml',
- 'security/ir.model.access.csv'],
- 'demo_xml': ['carrier_file_demo.xml',
+ 'data': ['carrier_file_view.xml',
+ 'stock_view.xml',
+ 'wizard/generate_carrier_files_view.xml',
+ 'security/ir.model.access.csv'],
+ 'demo': ['carrier_file_demo.xml',
'carrier_file_demo.yml'],
'test': ['test/carrier_file.yml',
'test/carrier_file_manual.yml'],
'images': [],
- 'installable': False,
+ 'installable': True,
'auto_install': False,
}
=== modified file 'base_delivery_carrier_files/carrier_file.py'
--- base_delivery_carrier_files/carrier_file.py 2012-04-02 06:59:30 +0000
+++ base_delivery_carrier_files/carrier_file.py 2014-03-13 09:41:40 +0000
@@ -22,12 +22,12 @@
import os
import logging
-from osv import osv, fields
+from openerp.osv import orm, fields
from generator import new_file_generator
from tools.translate import _
-class carrier_file(osv.osv):
+class carrier_file(orm.Model):
_name = 'delivery.carrier.file'
def get_type_selection(self, cr, uid, context=None):
@@ -130,14 +130,10 @@
carrier_file = self.browse(cr, uid, carrier_file_id, context=context)
return self._generate_files(cr, uid, carrier_file, picking_ids, context=context)
-carrier_file()
-
-
-class delivery_carrier(osv.osv):
+
+class delivery_carrier(orm.Model):
_inherit = 'delivery.carrier'
_columns = {
'carrier_file_id': fields.many2one('delivery.carrier.file', 'Carrier File')
}
-
-delivery_carrier()
=== modified file 'base_delivery_carrier_files/carrier_file_demo.yml'
--- base_delivery_carrier_files/carrier_file_demo.yml 2012-02-20 13:45:30 +0000
+++ base_delivery_carrier_files/carrier_file_demo.yml 2014-03-13 09:41:40 +0000
@@ -1,26 +1,55 @@
-
+ !record {model: stock.location, id: location_refrigerator}:
+ name: Refrigerator
+ usage: internal
+-
+ !record {model: stock.location, id: location_delivery_counter}:
+ name: Delivery Counter
+ usage: internal
+-
+ !record {model: stock.location, id: location_opening}:
+ name: opening
+ usage: inventory
+-
+ !record {model: product.product, id: product_icecream}:
+ default_code: 001
+ name: Ice Cream
+ type: product
+ categ_id: product.product_category_1
+ list_price: 100.0
+ standard_price: 70.0
+ uom_id: product.product_uom_kgm
+ uom_po_id: product.product_uom_kgm
+ procure_method: make_to_stock
+ property_stock_inventory: location_opening
+ valuation: real_time
+ cost_method: average
+ property_stock_account_input: account.o_expense
+ property_stock_account_output: account.o_income
+ description: Ice cream can be mass-produced and thus is widely available in developed parts of the world. Ice cream can be purchased in large cartons (vats and squrounds) from supermarkets and grocery stores, in smaller quantities from ice cream shops, convenience stores, and milk bars, and in individual servings from small carts or vans at public events.
+-
!record {model: stock.picking, id: outgoing_shipment_carrier_file}:
type: out
- location_dest_id: stock.location_delivery_counter
+ location_dest_id: location_delivery_counter
carrier_id: delivery.delivery_carrier
-
!record {model: stock.move, id: outgoing_shipment_icecream_carrier_file}:
picking_id: outgoing_shipment_carrier_file
- product_id: stock.product_icecream
+ product_id: product_icecream
product_uom: product.product_uom_kgm
product_qty: 130.0
- location_id: stock.location_refrigerator
- location_dest_id: stock.location_delivery_counter
+ location_id: location_refrigerator
+ location_dest_id: location_delivery_counter
-
!record {model: stock.picking, id: outgoing_shipment_carrier_file_manual}:
type: out
- location_dest_id: stock.location_delivery_counter
+ location_dest_id: location_delivery_counter
carrier_id: delivery.free_delivery_carrier
-
!record {model: stock.move, id: outgoing_shipment_icecream_carrier_file_manual}:
picking_id: outgoing_shipment_carrier_file_manual
- product_id: stock.product_icecream
+ product_id: product_icecream
product_uom: product.product_uom_kgm
product_qty: 130.0
- location_id: stock.location_refrigerator
- location_dest_id: stock.location_delivery_counter
+ location_id: location_refrigerator
+ location_dest_id: location_delivery_counter
=== modified file 'base_delivery_carrier_files/carrier_file_view.xml'
--- base_delivery_carrier_files/carrier_file_view.xml 2012-02-20 13:45:30 +0000
+++ base_delivery_carrier_files/carrier_file_view.xml 2014-03-13 09:41:40 +0000
@@ -4,7 +4,6 @@
<record id="view_delivery_carrier_file_tree" model="ir.ui.view">
<field name="name">delivery.carrier.file.tree</field>
<field name="model">delivery.carrier.file</field>
- <field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Carrier File">
<field name="name"/>
@@ -17,7 +16,6 @@
<record id="view_delivery_carrier_file_form" model="ir.ui.view">
<field name="name">delivery.carrier.file.form</field>
<field name="model">delivery.carrier.file</field>
- <field name="type">form</field>
<field name="arch" type="xml">
<form string="Carrier File">
<group colspan="4" col="4" name="general">
@@ -52,7 +50,6 @@
<field name="name">delivery.carrier.form.file</field>
<field name="model">delivery.carrier</field>
<field name="inherit_id" ref="delivery.view_delivery_carrier_form" />
- <field name="type">form</field>
<field name="arch" type="xml">
<data>
<field name="product_id" position="after">
=== modified file 'base_delivery_carrier_files/generator/generic_generator.py'
--- base_delivery_carrier_files/generator/generic_generator.py 2012-04-02 06:59:30 +0000
+++ base_delivery_carrier_files/generator/generic_generator.py 2014-03-13 09:41:40 +0000
@@ -61,20 +61,20 @@
"""
line = GenericLine()
line.reference = picking.name
- address = picking.address_id
- if address:
- line.name = address.partner_id and address.partner_id.name
- line.contact = address.name
- line.street1 = address.street
- line.street2 = address.street2
- line.zip = address.zip
- line.city = address.city
- line.state = (picking.address_id.state_id and
- picking.address_id.state_id.name)
- line.country = address.country_id and address.country_id.code
- line.phone = address.phone or address.mobile
- line.mail = address.email
- line.fax = address.fax
+ partner = picking.partner_id
+ if partner:
+ line.name = partner.name
+ line.contact = partner.name
+ line.street1 = partner.street
+ line.street2 = partner.street2
+ line.zip = partner.zip
+ line.city = partner.city
+ line.state = (partner.state_id and
+ partner.state_id.name)
+ line.country = partner.country_id and partner.country_id.code
+ line.phone = partner.phone or partner.mobile
+ line.mail = partner.email
+ line.fax = partner.fax
line.delivery_name = picking.carrier_id and picking.carrier_id.name
line.weight = "%.2f" % (picking.weight,)
return [line.get_fields()]
=== modified file 'base_delivery_carrier_files/stock.py'
--- base_delivery_carrier_files/stock.py 2012-04-02 06:59:30 +0000
+++ base_delivery_carrier_files/stock.py 2014-03-13 09:41:40 +0000
@@ -19,10 +19,10 @@
#
##############################################################################
-from osv import osv, fields
-
-
-class stock_picking(osv.osv):
+from openerp.osv import orm, fields
+
+
+class stock_picking(orm.Model):
_inherit = 'stock.picking'
_columns = {
@@ -77,4 +77,3 @@
default.update({'carrier_file_generated': False})
return super(stock_picking, self).copy(cr, uid, id, default, context=context)
-stock_picking()
=== modified file 'base_delivery_carrier_files/stock_view.xml'
--- base_delivery_carrier_files/stock_view.xml 2012-02-20 13:45:30 +0000
+++ base_delivery_carrier_files/stock_view.xml 2014-03-13 09:41:40 +0000
@@ -5,7 +5,6 @@
<field name="name">stock.picking.out.form</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_out_form"/>
- <field name="type">form</field>
<field name="arch" type="xml">
<data>
<page string="Additional info" position="inside">
@@ -19,7 +18,6 @@
<field name="name">stock.picking.out.search</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_out_search"/>
- <field name="type">search</field>
<field name="arch" type="xml">
<data>
<filter name="to_invoice" position="after">
Follow ups