From 3d2934568d748cb72a04f78f6fccacc62def29a0 Mon Sep 17 00:00:00 2001 From: Kalantojus Karolis Date: Wed, 11 Nov 2015 07:19:30 +0200 Subject: [PATCH 01/40] Port base_delivery_carrier_files_migration --- base_delivery_carrier_files/__manifest__.py | 5 +- base_delivery_carrier_files/carrier_file.py | 124 ++++++++---------- .../carrier_file_demo.yml | 23 +++- .../carrier_file_view.xml | 4 +- base_delivery_carrier_files/stock.py | 81 ++++++------ base_delivery_carrier_files/stock_view.xml | 20 ++- .../test/carrier_file.yml | 33 ++--- .../test/carrier_file_manual.yml | 36 ++--- .../wizard/generate_carrier_files.py | 67 ++++------ .../wizard/generate_carrier_files_view.xml | 10 +- 10 files changed, 196 insertions(+), 207 deletions(-) diff --git a/base_delivery_carrier_files/__manifest__.py b/base_delivery_carrier_files/__manifest__.py index 93ad92d931..b33b3b446b 100644 --- a/base_delivery_carrier_files/__manifest__.py +++ b/base_delivery_carrier_files/__manifest__.py @@ -57,11 +57,10 @@ 'stock_view.xml', 'wizard/generate_carrier_files_view.xml', 'security/ir.model.access.csv'], - 'demo': ['carrier_file_demo.xml', - 'carrier_file_demo.yml'], + '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, } diff --git a/base_delivery_carrier_files/carrier_file.py b/base_delivery_carrier_files/carrier_file.py index 2a2e492bae..2876dd2f5f 100644 --- a/base_delivery_carrier_files/carrier_file.py +++ b/base_delivery_carrier_files/carrier_file.py @@ -22,49 +22,30 @@ import os import logging -from openerp.osv import orm, fields +from openerp import models, fields, api, exceptions +from openerp.tools.translate import _ from .generator import new_file_generator -from tools.translate import _ -class CarrierFile(orm.Model): +class CarrierFile(models.Model): _name = 'delivery.carrier.file' - def get_type_selection(self, cr, uid, context=None): + @api.model + def get_type_selection(self): """ Has to be inherited to add carriers """ return [('generic', 'Generic')] - def get_write_mode_selection(self, cr, uid, context=None): + @api.model + def get_write_mode_selection(self): """ Selection can be inherited to add more write modes """ return [('disk', 'Disk')] - _columns = { - 'name': fields.char('Name', size=64, required=True), - 'type': fields.selection(get_type_selection, 'Type', required=True), - 'group_pickings': fields.boolean('Group all pickings in one file', - help='All the pickings will be ' - 'grouped in the same file. ' - 'Has no effect when the files ' - 'are automatically exported at ' - 'the delivery order process.'), - 'write_mode': fields.selection(get_write_mode_selection, - 'Write on', - required=True), - 'export_path': fields.char('Export Path', size=256), - 'auto_export': fields.boolean('Export at delivery order process', - help='The file will be automatically ' - 'generated when a delivery order ' - 'is processed. If activated, each ' - 'delivery order will be exported ' - 'in a separate file.'), - } - - def _write_file(self, cr, uid, carrier_file, filename, file_content, - context=None): + @api.multi + def _write_file(self, filename, file_content): """ Method responsible of writing the file, on the filesystem or by inheriting the module, in the document module as instance @@ -75,18 +56,18 @@ def _write_file(self, cr, uid, carrier_file, filename, file_content, :param tuple file_content: content of the file to write :return: True if write is successful """ - if not carrier_file.export_path: - raise orm.except_orm(_('Error'), - _('Export path is not defined ' - 'for carrier file %s') % - (carrier_file.name,)) - full_path = os.path.join(carrier_file.export_path, filename) - with open(full_path, 'w') as file_handle: - file_handle.write(file_content) + for carrier_file in self: + if not carrier_file.export_path: + raise exceptions.Warning( + _('Export path is not defined ' + 'for carrier file %s') % (carrier_file.name,)) + full_path = os.path.join(carrier_file.export_path, filename) + with open(full_path, 'w') as file_handle: + file_handle.write(file_content) return True - def _generate_files(self, cr, uid, carrier_file, picking_ids, - context=None): + @api.one + def _generate_files(self, picking_ids): """ Generate one or more files according to carrier_file configuration for all picking_ids @@ -97,17 +78,15 @@ def _generate_files(self, cr, uid, carrier_file, picking_ids, we have to generate a file :return: True if successful """ - if context is None: - context = {} - picking_obj = self.pool.get('stock.picking') log = logging.getLogger('delivery.carrier.file') - file_generator = new_file_generator(carrier_file.type) - pickings = [picking for picking in - picking_obj.browse(cr, uid, picking_ids, context=context)] + file_generator = new_file_generator(self.type) + + picking_obj = self.env["stock.picking"] + pickings = picking_obj.browse(picking_ids) + # must return a list of generated pickings ids to update - files = file_generator.generate_files(pickings, carrier_file) - if carrier_file.auto_export: - context['picking_id'] = pickings and pickings[0].id + files = file_generator.generate_files(pickings, self) + for f in files: filename, file_content, picking_ids = f # we pass the errors because the files can still be @@ -117,19 +96,17 @@ def _generate_files(self, cr, uid, carrier_file, picking_ids, # but I encountered lock because the picking # was already modified in the current transaction try: - if self._write_file(cr, uid, carrier_file, filename, - file_content, context=context): - picking_obj.write(cr, uid, picking_ids, - {'carrier_file_generated': True}, - context=context) + if self._write_file(filename, file_content): + picking_obj.browse(picking_ids).write({ + 'carrier_file_generated': True}) except Exception as e: log.exception("Could not create the picking file " "for pickings %s: %s", picking_ids, e) return True - def generate_files(self, cr, uid, carrier_file_id, picking_ids, - context=None): + @api.one + def generate_files(self, picking_ids): """ Generate one or more files according to carrier_file configuration for all picking_ids @@ -141,21 +118,28 @@ def generate_files(self, cr, uid, carrier_file_id, picking_ids, which we have to generate a file :return: True if successful """ - if not isinstance(carrier_file_id, (int, long)): - if len(carrier_file_id) > 1: - raise Exception('Code Error: you have to export ' - 'only one carrier at a time.') - else: - carrier_file_id = carrier_file_id[0] - carrier_file = self.browse(cr, uid, carrier_file_id, context=context) - return self._generate_files(cr, uid, carrier_file, picking_ids, - context=context) - - -class delivery_carrier(orm.Model): + return self._generate_files(picking_ids) + + name = fields.Char('Name', size=64, required=True) + type = fields.Selection(get_type_selection, 'Type', required=True) + group_pickings = fields.Boolean('Group all pickings in one file', + help='All the pickings will be ' + 'grouped in the same file. ' + 'Has no effect when the files ' + 'are automatically exported at ' + 'the delivery order process.') + write_mode = fields.Selection(get_write_mode_selection, 'Write on', + required=True) + export_path = fields.Char('Export Path', size=256) + auto_export = fields.Boolean('Export at delivery order process', + help='The file will be automatically ' + 'generated when a delivery order ' + 'is processed. If activated, each ' + 'delivery order will be exported ' + 'in a separate file.') + + +class delivery_carrier(models.Model): _inherit = 'delivery.carrier' - _columns = { - 'carrier_file_id': fields.many2one('delivery.carrier.file', - 'Carrier File') - } + carrier_file_id = fields.Many2one('delivery.carrier.file', 'Carrier File') diff --git a/base_delivery_carrier_files/carrier_file_demo.yml b/base_delivery_carrier_files/carrier_file_demo.yml index 99f502fadd..5963131bed 100644 --- a/base_delivery_carrier_files/carrier_file_demo.yml +++ b/base_delivery_carrier_files/carrier_file_demo.yml @@ -20,7 +20,6 @@ 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 @@ -28,8 +27,13 @@ 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.out, id: outgoing_shipment_carrier_file}: - type: out + !record {model: stock.picking.type, id: outgoing_shipment_type_carrier_file}: + name: Outgoing Ice Cream + code: outgoing + sequence_id: stock.sequence_mrp_op +- + !record {model: stock.picking, id: outgoing_shipment_carrier_file}: + picking_type_id: outgoing_shipment_type_carrier_file location_dest_id: location_delivery_counter carrier_id: delivery.delivery_carrier - @@ -37,12 +41,17 @@ picking_id: outgoing_shipment_carrier_file product_id: product_icecream product_uom: product.product_uom_kgm - product_qty: 130.0 + product_uom_qty: 130.0 location_id: location_refrigerator location_dest_id: location_delivery_counter - - !record {model: stock.picking.out, id: outgoing_shipment_carrier_file_manual}: - type: out + !record {model: stock.picking.type, id: outgoing_shipment_type_carrier_file_manual}: + name: Outgoing Ice Cream + code: outgoing + sequence_id: stock.sequence_mrp_op +- + !record {model: stock.picking, id: outgoing_shipment_carrier_file_manual}: + picking_type_id: outgoing_shipment_type_carrier_file_manual location_dest_id: location_delivery_counter carrier_id: delivery.free_delivery_carrier - @@ -50,6 +59,6 @@ picking_id: outgoing_shipment_carrier_file_manual product_id: product_icecream product_uom: product.product_uom_kgm - product_qty: 130.0 + product_uom_qty: 130.0 location_id: location_refrigerator location_dest_id: location_delivery_counter diff --git a/base_delivery_carrier_files/carrier_file_view.xml b/base_delivery_carrier_files/carrier_file_view.xml index afcd1c9f36..1833b67dc7 100644 --- a/base_delivery_carrier_files/carrier_file_view.xml +++ b/base_delivery_carrier_files/carrier_file_view.xml @@ -1,6 +1,7 @@ + delivery.carrier.file.tree delivery.carrier.file @@ -13,6 +14,7 @@ + delivery.carrier.file.form delivery.carrier.file @@ -45,7 +47,6 @@ - delivery.carrier.form.file delivery.carrier @@ -58,5 +59,6 @@ + diff --git a/base_delivery_carrier_files/stock.py b/base_delivery_carrier_files/stock.py index ad21e2d6e9..2ffc5032ee 100644 --- a/base_delivery_carrier_files/stock.py +++ b/base_delivery_carrier_files/stock.py @@ -19,22 +19,15 @@ # ############################################################################## -from openerp.osv import orm, fields +from openerp import models, fields, api -class stock_picking(orm.Model): - _inherit = 'stock.picking' +class stock_picking(models.Model): + _inherit = "stock.picking" - _columns = { - 'carrier_file_generated': fields.boolean('Carrier File Generated', - readonly=True, - help="The file for the " - "delivery carrier " - "has been generated."), - } - - def generate_carrier_files(self, cr, uid, ids, auto=True, - recreate=False, context=None): + @api.multi + def generate_carrier_files(self, auto=True, + recreate=False): """ Generates all the files for a list of pickings according to their configuration carrier file. @@ -50,50 +43,52 @@ def generate_carrier_files(self, cr, uid, ids, auto=True, are exported :return: True if successful """ - carrier_file_obj = self.pool.get('delivery.carrier.file') carrier_file_ids = {} - for picking in self.browse(cr, uid, ids, context): - if picking.type != 'out': + for picking in self: + if picking.picking_type_id.code != 'outgoing': continue if not recreate and picking.carrier_file_generated: continue carrier = picking.carrier_id - if not carrier or not carrier.carrier_file_id: + if not carrier: + continue + if not carrier.carrier_file_id: continue if auto and not carrier.carrier_file_id.auto_export: continue p_carrier_file_id = picking.carrier_id.carrier_file_id.id - carrier_file_ids.setdefault(p_carrier_file_id, []).\ - append(picking.id) + carrier_file_ids.setdefault(p_carrier_file_id, []).append( + picking.id) - for carrier_file_id, carrier_picking_ids\ - in carrier_file_ids.iteritems(): - carrier_file_obj.generate_files(cr, uid, carrier_file_id, - carrier_picking_ids, - context=context) + carrier_files = self.env["delivery.carrier.file"].browse( + carrier_file_ids.keys()) + for carrier_file in carrier_files: + carrier_file.generate_files(carrier_file_ids[carrier_file.id]) return True - def action_done(self, cr, uid, ids, context=None): - result = super(stock_picking, self).action_done(cr, uid, ids, - context=context) - self.generate_carrier_files(cr, uid, ids, auto=True, context=context) + @api.multi + def action_done(self): + result = super(stock_picking, self).action_done() + self.generate_carrier_files(auto=True) return result + carrier_file_generated = fields.Boolean( + 'Carrier File Generated', readonly=True, copy=False, + help="The file for the delivery carrier has been generated.") -class stock_picking_out(orm.Model): - _inherit = 'stock.picking.out' - _columns = { - 'carrier_file_generated': fields.boolean('Carrier File Generated', - readonly=True, - help="The file for " - "the delivery carrier " - "has been generated."), - } +class stock_move(models.Model): + _inherit = 'stock.move' - def copy(self, cr, uid, rec_id, default=None, context=None): - if default is None: - default = {} - default.update({'carrier_file_generated': False}) - return super(stock_picking_out, self).copy(cr, uid, rec_id, default, - context=context) + @api.multi + def write(self, values): + write_result = super(stock_move, self).write(values) + if values.get('state') and values['state'] == 'done': + picking_ids = map(lambda p: p.id, self.mapped('picking_id')) + done_pickings = self.env['stock.picking'].search([ + ('id', 'in', picking_ids), + ('state', '=', 'done') + ]) + if done_pickings: + done_pickings.generate_carrier_files() + return write_result diff --git a/base_delivery_carrier_files/stock_view.xml b/base_delivery_carrier_files/stock_view.xml index 4dacbc9305..320b93df1f 100644 --- a/base_delivery_carrier_files/stock_view.xml +++ b/base_delivery_carrier_files/stock_view.xml @@ -2,9 +2,9 @@ - stock.picking.out.form - stock.picking.out - + stock.picking.form + stock.picking + @@ -17,14 +17,20 @@ - stock.picking.out.search - stock.picking.out - + stock.picking.search + stock.picking + - + diff --git a/base_delivery_carrier_files/test/carrier_file.yml b/base_delivery_carrier_files/test/carrier_file.yml index 025555f5d5..75ae63fa35 100644 --- a/base_delivery_carrier_files/test/carrier_file.yml +++ b/base_delivery_carrier_files/test/carrier_file.yml @@ -3,10 +3,9 @@ - I set the system tempfile on the carrier file configuration to be sure the path will be writable - - !python {model: delivery.carrier.file}: | + !python {model: delivery.carrier.file, id: delivery_carrier_file}: | import tempfile - delivery_carrier_file = self.browse(cr, uid, ref("delivery_carrier_file")) - self.write(cr, uid, delivery_carrier_file.id, {'export_path': tempfile.gettempdir(), 'write_mode': 'disk'}) + self.write({'export_path': tempfile.gettempdir(), 'write_mode': 'disk'}) - I set the carrier file configuration on the carrier Free delivery charges - @@ -15,32 +14,34 @@ - I confirm outgoing shipment of 130 kgm Ice-cream. - - !workflow {model: stock.picking, action: button_confirm, ref: outgoing_shipment_carrier_file} + !python {model: stock.picking, id: outgoing_shipment_carrier_file}: | + self.action_confirm() - I check outgoing shipment after stock availablity in refrigerator. - - !python {model: stock.picking}: | - self.force_assign(cr, uid, [ref("outgoing_shipment_carrier_file")]) - picking = self.browse(cr, uid, ref("outgoing_shipment_carrier_file")) + !python {model: stock.picking, id: outgoing_shipment_carrier_file}: | + self.force_assign() - I deliver outgoing shipment. - - !python {model: stock.partial.picking}: | - context.update({'active_model': 'stock.picking.out', 'active_id': ref('outgoing_shipment_carrier_file'), 'active_ids': [ref('outgoing_shipment_carrier_file')]}) + !python {model: stock.transfer_details}: | + context.update({'active_model': 'stock.picking', 'active_id': ref('outgoing_shipment_carrier_file'), 'active_ids': [ref('outgoing_shipment_carrier_file')]}) - - !record {model: stock.partial.picking, id: partial_outgoing}: + !record {model: stock.transfer_details, id: partial_outgoing}: picking_id: outgoing_shipment_carrier_file - - !python {model: stock.partial.picking }: | - self.do_partial(cr, uid, [ref('partial_outgoing')], context=context) + I transfer the shipment. +- + !python {model: stock.transfer_details}: | + self.do_detailed_transfer(cr, uid, [ref('partial_outgoing')], context=context) - I check shipment details after shipment, the carrier file must have been generated - - !assert {model: stock.picking.out, id: outgoing_shipment_carrier_file, string: Carrier file should be generated}: + !assert {model: stock.picking, id: outgoing_shipment_carrier_file, string: Carrier file should be generated}: - carrier_file_generated == True - I check outgoing shipment copy, the carrier_file_generated field must be unchecked - - !python {model: stock.picking.out}: | - new_id = self.copy(cr, uid, ref('outgoing_shipment_carrier_file')) - assert self.read(cr, uid, new_id, ['carrier_file_generated'])['carrier_file_generated'] == False, "After duplication, the file generated checkbox is unchecked" + !python {model: stock.picking, id: outgoing_shipment_carrier_file}: | + new_id = self.copy() + assert new_id.carrier_file_generated == False, "After duplication, the file generated checkbox is unchecked" diff --git a/base_delivery_carrier_files/test/carrier_file_manual.yml b/base_delivery_carrier_files/test/carrier_file_manual.yml index de4e58b52b..2e212fcc1e 100644 --- a/base_delivery_carrier_files/test/carrier_file_manual.yml +++ b/base_delivery_carrier_files/test/carrier_file_manual.yml @@ -3,10 +3,9 @@ - I set the system tempfile on the carrier file configuration to be sure the path will be writable - - !python {model: delivery.carrier.file}: | + !python {model: delivery.carrier.file, id: delivery_carrier_file_manual}: | import tempfile - delivery_carrier_file = self.browse(cr, uid, ref("delivery_carrier_file_manual")) - self.write(cr, uid, delivery_carrier_file.id, {'export_path': tempfile.gettempdir(), 'write_mode': 'disk'}) + self.write({'export_path': tempfile.gettempdir(), 'write_mode': 'disk'}) - I set the carrier file configuration on the carrier Free delivery charges - @@ -15,37 +14,44 @@ - I confirm outgoing shipment of 130 kgm Ice-cream. - - !workflow {model: stock.picking, action: button_confirm, ref: outgoing_shipment_carrier_file_manual} + !python {model: stock.picking, id: outgoing_shipment_carrier_file_manual}: | + self.action_confirm() - I check outgoing shipment after stock availablity in refrigerator. - - !python {model: stock.picking}: | - self.force_assign(cr, uid, [ref("outgoing_shipment_carrier_file_manual")]) - picking = self.browse(cr, uid, ref("outgoing_shipment_carrier_file_manual")) + !python {model: stock.picking, id: outgoing_shipment_carrier_file_manual}: | + self.force_assign() + # picking = self.browse(cr, uid, ref("outgoing_shipment_carrier_file_manual")) - I deliver outgoing shipment. - - !python {model: stock.partial.picking}: | - context.update({'active_model': 'stock.picking.out', 'active_id': ref('outgoing_shipment_carrier_file_manual'), 'active_ids': [ref('outgoing_shipment_carrier_file_manual')]}) + !python {model: stock.transfer_details}: | + context.update({'active_model': 'stock.picking', 'active_id': ref('outgoing_shipment_carrier_file_manual'), 'active_ids': [ref('outgoing_shipment_carrier_file_manual')]}) - - !record {model: stock.partial.picking, id: partial_outgoing}: + !record {model: stock.transfer_details, id: partial_outgoing}: picking_id: outgoing_shipment_carrier_file_manual - - !python {model: stock.partial.picking }: | - self.do_partial(cr, uid, [ref('partial_outgoing')], context=context) + I transfer the shipment. +- + !python {model: stock.transfer_details}: | + self.do_detailed_transfer(cr, uid, [ref('partial_outgoing')], context=context) - I check shipment details after shipping, the carrier file must not have been generated - - !assert {model: stock.picking.out, id: outgoing_shipment_carrier_file_manual, string: Carrier file should be generated}: + !assert {model: stock.picking, id: outgoing_shipment_carrier_file_manual, string: Carrier file should be generated}: - carrier_file_generated is False - I generate the carrier files of my shipment from the wizard +- + !context + active_ids: [ref('outgoing_shipment_carrier_file_manual')] + active_model: 'stock.picking' - !python {model: delivery.carrier.file.generate}: | - wizard_id = self.create(cr, uid, {}, {'active_ids': [ref('outgoing_shipment_carrier_file_manual')], 'active_model': 'stock.picking.out'}) + wizard_id = self.create(cr, uid, {}, {'active_ids': [ref('outgoing_shipment_carrier_file_manual')], 'active_model': 'stock.picking'}) self.action_generate(cr, uid, [wizard_id], {'active_ids': [ref('outgoing_shipment_carrier_file_manual')]}) - I check shipment details after manual generation, the carrier file must have been generated - - !assert {model: stock.picking.out, id: outgoing_shipment_carrier_file_manual, string: Carrier file should be generated}: + !assert {model: stock.picking, id: outgoing_shipment_carrier_file_manual, string: Carrier file should be generated}: - carrier_file_generated == True diff --git a/base_delivery_carrier_files/wizard/generate_carrier_files.py b/base_delivery_carrier_files/wizard/generate_carrier_files.py index 166cf2a8e5..4c30db3a65 100644 --- a/base_delivery_carrier_files/wizard/generate_carrier_files.py +++ b/base_delivery_carrier_files/wizard/generate_carrier_files.py @@ -19,53 +19,40 @@ # ############################################################################## -from openerp.osv import orm, fields -from tools.translate import _ +from openerp import models, fields, exceptions, api +from openerp.tools.translate import _ -class DeliveryCarrierFileGenerate(orm.TransientModel): +class DeliveryCarrierFileGenerate(models.TransientModel): _name = 'delivery.carrier.file.generate' - def _get_picking_ids(self, cr, uid, context=None): - if context is None: - context = {} - res = False - if (context.get('active_model', False) == 'stock.picking.out' and - context.get('active_ids', False)): - res = context['active_ids'] - return res + @api.model + def _get_pickings(self): + context = self.env.context + if (context.get('active_model') == 'stock.picking' and + context.get('active_ids')): + return self.env["stock.picking"].browse( + context["active_ids"]) - _columns = { - 'picking_ids': fields.many2many('stock.picking.out', - string='Delivery Orders'), - 'recreate': fields.boolean( - 'Recreate files', - help="If this option is used, new files will be generated " - "for selected picking even if they already had one.\n" - "By default, delivery orders with existing file will be " - "skipped."), - } - - _defaults = { - 'picking_ids': _get_picking_ids, - } - - def action_generate(self, cr, uid, ids, context=None): + @api.multi + def action_generate(self): """ Call the creation of the delivery carrier files """ - context = context or {} - form = self.browse(cr, uid, ids, context=context)[0] - if not form.picking_ids: - raise orm.except_orm(_('Error'), _('No delivery orders selected')) - - picking_obj = self.pool['stock.picking'] - picking_ids = [picking.id for picking in form.picking_ids] - picking_obj.generate_carrier_files(cr, uid, - picking_ids, - auto=False, - recreate=form.recreate, - context=context) - + if not self.pickings: + raise exceptions.Warning(_('No delivery orders selected')) + self.pickings.generate_carrier_files( + auto=False, recreate=self.recreate) return {'type': 'ir.actions.act_window_close'} + + pickings = fields.Many2many('stock.picking', + string='Delivery Orders', + default=_get_pickings, + oldname='picking_ids') + recreate = fields.Boolean( + 'Recreate files', + help=("If this option is used, new files will be generated " + "for selected picking even if they already had one.\n" + "By default, delivery orders with existing file will be " + "skipped.")) diff --git a/base_delivery_carrier_files/wizard/generate_carrier_files_view.xml b/base_delivery_carrier_files/wizard/generate_carrier_files_view.xml index 4b9aeb1423..0ca8eb98b8 100644 --- a/base_delivery_carrier_files/wizard/generate_carrier_files_view.xml +++ b/base_delivery_carrier_files/wizard/generate_carrier_files_view.xml @@ -3,12 +3,13 @@ - delivery.carrier.file.generate + delivery.carrier.file.generate.form delivery.carrier.file.generate -
+
- - Carrier File - ir.actions.act_window - delivery.carrier.file - form - tree,form - + + Carrier File + ir.actions.act_window + delivery.carrier.file + form + tree,form + - + - - delivery.carrier.form.file - delivery.carrier - - - - - - - - - + + delivery.carrier.form.file + delivery.carrier + + + + + + + + + -
-
+ diff --git a/base_delivery_carrier_files/views/stock_view.xml b/base_delivery_carrier_files/views/stock_view.xml index 320b93df1f..742ea5ff4f 100644 --- a/base_delivery_carrier_files/views/stock_view.xml +++ b/base_delivery_carrier_files/views/stock_view.xml @@ -1,39 +1,37 @@ - - - - stock.picking.form - stock.picking - - - - - - - - - - - + + + stock.picking.form + stock.picking + + + + + + + + + + + - - stock.picking.search - stock.picking - - - - - - - - - - - - + + stock.picking.search + stock.picking + + + + + + + + + + + diff --git a/base_delivery_carrier_files/wizards/generate_carrier_files.py b/base_delivery_carrier_files/wizards/generate_carrier_files.py index 80523a67c3..31efc64fe1 100644 --- a/base_delivery_carrier_files/wizards/generate_carrier_files.py +++ b/base_delivery_carrier_files/wizards/generate_carrier_files.py @@ -3,8 +3,8 @@ # Author: Guewen Baconnier # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from openerp import models, fields, exceptions, api -from openerp.tools.translate import _ +from odoo import models, fields, exceptions, api +from odoo.tools.translate import _ class DeliveryCarrierFileGenerate(models.TransientModel): diff --git a/base_delivery_carrier_files/wizards/generate_carrier_files_view.xml b/base_delivery_carrier_files/wizards/generate_carrier_files_view.xml index 0ca8eb98b8..f3e72639b1 100644 --- a/base_delivery_carrier_files/wizards/generate_carrier_files_view.xml +++ b/base_delivery_carrier_files/wizards/generate_carrier_files_view.xml @@ -1,52 +1,49 @@ - - - - - delivery.carrier.file.generate.form - delivery.carrier.file.generate - -
-
-
+