Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[11.0][MIG] base_delivery_carrier_label #154

Merged
merged 47 commits into from
May 29, 2018
Merged

[11.0][MIG] base_delivery_carrier_label #154

merged 47 commits into from
May 29, 2018

Conversation

asaunier
Copy link
Contributor

Based upon PR #150 by @hugosantosred with a few improvements:

  • removed the # -*- coding: utf-8 -*- header in python files
  • squashed some Launchpad automatic translations update. commits and removed a Make modules uninstallable one (805b831)

I have not really been able to squash all i18n commits because the translations changes came from several origin/authors, sometimes with other changes. I have the feeling it's better to leave as is.

yvaucher and others added 15 commits January 17, 2018 13:13
… nesting, few typos

[ADD] access rights for the shipping.label model
[IMP] remove unused pdf_list variable and rename pdf variable to label as a label can have other printing format

[IMP] remove readonly on carrier_tracking_ref

[IMP] remove carrier_tracking_ref redefinition as already defined in delivery/stock.py

[ADD] stock users rights

[ADD] file type on shipping label

[ADD] pot file

[ADD] fr.po
…per pack (stock.tracking)

[IMP] set tracking_id as an optional key of dict returned by label generation and improve doc string

[IMP] rename generate_pack_labels in generate_shipping_labels as it can also generate a single label for a picking without pack notion

[IMP] set labels on stock.picking instead of stock.picking.out in order to let the creation of return labels to provide to the customer

[FIX] xml view and copy what is needed on stock.picking.out and stock.picking.in as it won't be inherited from stock.picking.out
[FIX] delivery.carrier has no access rights for stock users, hence remove it for delivery.carrier.option
…by raising a orm.except_orm

[FIX] trigger carrier_id on change when creating a stock.picking to set default options from sale.order

[IMP] change error message of unimplemented default to a more user friendly message
…te the label only for a selection of packs in a picking

the button call action_generate_carrier_label() without the 'context' keyword argument so the context ends in the tracking_ids argument. So the method now conforms to the cr, uid, ids, context signature and just forwards to a new generate_labels() method that should be used from within the code

do not overwrite the option_ids on create of stock.picking if already set in values, generalize the method to all types of picking (added in/out)

Set the default options of the delivery method when it is changed and the options are not set (typically a write from the code or a mass update)
[FIX] action name

[IMP] add descrption field to carrier option
[IMP] file_type field inheritance in shipping.label

[IMP] add field selection sort
@pedrobaeza pedrobaeza added this to the 11.0 milestone Apr 11, 2018
@pedrobaeza pedrobaeza mentioned this pull request Apr 11, 2018
19 tasks
@yvaucher
Copy link
Member

Great!

Just 2 more thing which could be done to improve the history of that module:

You can squash the [PEP8] commit (I don't mind if you remove my commit)
f32a2ca
into
[REF] remove stock.picking.in and .out
cae9191

you can also drop those 2 commits:
set installable to false
4b909bb

[MIG] Make modules uninstallable
28baac4

bealdav and others added 10 commits April 11, 2018 17:16
[FIX] docstring

[FIX] _customize_sender_address return method

[IMP] add comment in _customize_sender_adress()

[FIX] method name to get sender address

[FIX] method comment
move modules in __unported__
[REF] port to v8 with old api

[MIG] to v8 base_deliv_label, deliv_carrier_deposit

[IMP] add parcel_tracking field

[IMP] add _get_packages_from_picking()

add carrier_id in tree view
Better layout of default report for deposit slip
For stock.quant.package, order by id desc to have the latest first
Code cleanup

Button "Create Shipping Label" should be used when the picking in Done, because in v8 the packaging is handled in the "Transfer" wizard (in v7, the packaging could be made when the picking is waiting/ready)
Display number of packages on deposit slip
Add weight in tree view of packages
Remove an unused file 'reports.xml'

Remove the selection wrappers

Use the name of the method as string instead
Move module description in README.rst
guewen and others added 21 commits April 11, 2018 17:16
Take the destination package. If empty, the package is moved so take the source
one.

The options must be filtered by the selected carrier
In order to get visibility on https://www.odoo.com/apps the OCA board has
decided to add the OCA as author of all the addons maintained as part of the
association.
Because it will print several labels for the same package.
add operation.get_weight()
add tests

fix wrong name of class

refactor tests for a better readability

s/tracking/package in docstring of generate_labels
- Reactivate
- Move files in views and models
- Adapt XML views
- Update README.rst

Move settings menu in Inventory/Configuration

Remove test with Logistic units as it was removed from 9.0

Allow to give a filename to the created label if not defined use the attachment name

Fix weight calcul adding a field for total weight
This due to removed logistics units
If set this field will be used to define weight, otherwise we compute
weight even before quants have been created.

Fix stock picking view some labels were missing and the view was scrambled

Split files by model
[FIX] remove en.po that was erroneously created by transbot
Missing acl for stock user/manager
MIG 10.0 base_delivery_carrier_label
* Remove manifest.wizard model access rules.
* Add an attribute for the carrier tracking URI at the `stock.quant.package` level
@asaunier
Copy link
Contributor Author

asaunier commented Apr 11, 2018

@yvaucher

You can squash f32a2ca into cae9191

Well, I got some conflicts and I was not very sure how to fix them. Thus I preferred to skip squashing those ones.

you can also drop those 2 commits:

I have indeed missed 28baac4 => done

For 4b909bb set installable to false I didn't dare to drop it because it actually changes many things. If I remove it, I get a bunch of conflicts. Again I preferred to skip and avoid incorrect conflicts fixes.

On the other hand I have squashed two commits in a row by the same author on the same piece of code, which resulted in c1be3c9


.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/99/10.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/11.0

'category': 'Delivery',
'complexity': 'normal',
'depends': ['delivery'],
'website': 'http://www.camptocamp.com/',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'security/ir.model.access.csv',
'wizard/manifest_wizard_view.xml',
],
'tests': [],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

@@ -0,0 +1,234 @@
# Translation of odoo Server.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove POT

_description = 'Base account datas'

@api.model
def _get_carrier_type(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/selection/_get

Copy link
Contributor Author

@asaunier asaunier Apr 27, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean? Perhaps you mean _get_carrier_type should be renamed to _selection_carrier_type because it is used to feed a selection field. Is it a convention? Isn't it better to keep verb-based name for functions?

Since this method should be overridden in extended models, aren't you afraid this renaming might cause problems to inheriting modules?

('product_id', '!=', False),
])

# we make use get_weight with @api.muli instead of
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need all these empty lines?

elif not pack.quant_ids:
# package.pack_operations would be too easy
operations = self.env['stock.move.line'].search(
[('result_package_id', '=', pack.id),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.search([
    ('result_package_id', '=', pack.id),
    ('product_id', '!=', False),
])


@api.multi
def _complete_name(self, name, args):
res = super(StockQuantPackage, self)._complete_name(name, args)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all the super calls can be done w/out args on py3 super().foo()

_description = 'Delivery carrier manifest wizard'

@api.model
def _get_carrier_type_selection(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again


@api.one
def get_manifest_file(self):
raise exceptions.Warning(_("Manifest not implemented for '%s' "
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NotImplementedError

@asaunier
Copy link
Contributor Author

asaunier commented May 2, 2018

@simahawk Thanks for reviewing! I have made the changes you have suggested, see 49bfef9

Copy link
Contributor

@simahawk simahawk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@asaunier
Copy link
Contributor Author

asaunier commented May 2, 2018

I have squashed my commits. PR is ready for merging if no other objection is raised.

@gurneyalex gurneyalex merged commit ccc5e4b into OCA:11.0 May 29, 2018
@asaunier asaunier deleted the 11.0-mig-base_delivery_carrier_label branch May 29, 2018 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet