[MIG] delivery_stamps: to Odoo 14.0

This commit is contained in:
Jared Kipe
2021-09-14 10:33:11 -07:00
parent c1efe06d1a
commit 37b39c9776
3 changed files with 6 additions and 4 deletions

View File

@@ -3,7 +3,7 @@
{ {
'name': 'Stamps.com (USPS) Shipping', 'name': 'Stamps.com (USPS) Shipping',
'summary': 'Send your shippings through Stamps.com and track them online.', 'summary': 'Send your shippings through Stamps.com and track them online.',
'version': '13.0.1.0.0', 'version': '14.0.1.0.0',
'author': "Hibou Corp.", 'author': "Hibou Corp.",
'category': 'Warehouse', 'category': 'Warehouse',
'license': 'OPL-1', 'license': 'OPL-1',

View File

@@ -52,7 +52,8 @@ class ProductPackaging(models.Model):
class ProviderStamps(models.Model): class ProviderStamps(models.Model):
_inherit = 'delivery.carrier' _inherit = 'delivery.carrier'
delivery_type = fields.Selection(selection_add=[('stamps', 'Stamps.com (USPS)')]) delivery_type = fields.Selection(selection_add=[('stamps', 'Stamps.com (USPS)')],
ondelete={'stamps': 'set default'})
stamps_username = fields.Char(string='Stamps.com Username', groups='base.group_system') stamps_username = fields.Char(string='Stamps.com Username', groups='base.group_system')
stamps_password = fields.Char(string='Stamps.com Password', groups='base.group_system') stamps_password = fields.Char(string='Stamps.com Password', groups='base.group_system')
@@ -104,7 +105,8 @@ class ProviderStamps(models.Model):
package_type = self.stamps_default_packaging_id package_type = self.stamps_default_packaging_id
else: else:
package_type = package.packaging_id package_type = package.packaging_id
return package_type.length, package_type.width, package_type.height # TODO should convert to inches if it is not already
return package_type.packaging_length, package_type.width, package_type.height
def _get_stamps_service(self): def _get_stamps_service(self):
sudoself = self.sudo() sudoself = self.sudo()

View File

@@ -32,7 +32,7 @@
<field name="model">product.packaging</field> <field name="model">product.packaging</field>
<field name="inherit_id" ref="delivery.product_packaging_delivery_form"/> <field name="inherit_id" ref="delivery.product_packaging_delivery_form"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//field[@name='length']" position='after'> <xpath expr="//field[@name='barcode']" position='before'>
<field name="stamps_cubic_pricing"/> <field name="stamps_cubic_pricing"/>
</xpath> </xpath>
</field> </field>