feat(fusion_shipping): UPS bill-receiver clarity + controllable commercial invoice

- Relabel UPS 'Bill My Account' -> "Bill recipient's UPS account" with clear
  help (it bills the customer's own UPS account; $0 shipping line; falls back to
  Bill Shipper when the customer has no account on file).
- Improve the customer 'UPS Account Number' field help (stored per-customer,
  auto-recalled at ship time for Bill Receiver).
- Add ups_rest_documentation_type setting (No / UPS commercial invoice) on the
  UPS REST carrier, mirroring FedEx. Default 'invoice' preserves the existing
  auto-generate-on-international behaviour; gate require_invoice on it so it can
  be turned off. Surfaced on the UPS REST config page.

Validated live on entech (UPS production): CA->US shipment generated the label
+ a 60KB commercial invoice PDF (country of origin auto = CA, HS code applied),
then voided. Bill Receiver request confirmed accepted by UPS.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsinghpal
2026-06-04 19:12:10 -04:00
parent 7426501555
commit a86f20017d
4 changed files with 24 additions and 6 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "Fusion Shipping",
"version": "19.0.1.5.0",
"version": "19.0.1.6.0",
"category": "Inventory/Delivery",
"summary": "All-in-one shipping integration — Canada Post, UPS, FedEx, DHL Express. "
"Live pricing, label generation, shipment tracking, and multi-package support.",

View File

@@ -242,9 +242,12 @@ class DeliveryCarrier(models.Model):
('EPL', 'EPL'),
('SPL', 'SPL')],
string="UPS Label File Type", default='GIF')
ups_bill_my_account = fields.Boolean(string='Bill My Account',
help="If checked, ecommerce users will be prompted their UPS account number\n"
"and delivery fees will be charged on it.")
ups_bill_my_account = fields.Boolean(string="Bill recipient's UPS account",
help="When the customer has a UPS account number on file (set on the "
"customer's contact, Sales & Purchase tab), charge UPS shipping to "
"THEIR account instead of yours (UPS 'Bill Receiver'). The shipping "
"line on the order is set to $0 since the customer pays. Customers "
"with no account on file are billed to your account at the normal rate.")
ups_saturday_delivery = fields.Boolean(string='UPS Saturday Delivery',
help='This value added service will allow you to ship the package on saturday also.')
ups_cod_funds_code = fields.Selection(selection=[
@@ -261,6 +264,16 @@ class DeliveryCarrier(models.Model):
ups_access_token = fields.Char(string='UPS Access Token', groups="base.group_system")
ups_default_packaging_id = fields.Many2one('stock.package.type', string='UPS Package Type')
ups_require_signature = fields.Boolean("Require Signature")
ups_rest_documentation_type = fields.Selection(
[('none', 'No'),
('invoice', 'UPS commercial invoice (paperless if account enrolled)')],
string='Generate customs invoice', default='invoice',
help="For international shipments, have UPS generate the commercial invoice "
"from the order data (UPS 'International Forms') and attach the PDF to the "
"delivery. If your UPS account is enrolled in Paperless Invoice, UPS also "
"submits it electronically to customs/the recipient (and you avoid UPS's "
"paper-invoice surcharge). Requires an HS code and country of origin on the "
"shipped products. No invoice is generated for domestic shipments.")
# ══════════════════════════════════════════════════════════════════════════
# FEDEX SOAP (Legacy) FIELDS
@@ -1892,7 +1905,7 @@ class DeliveryCarrier(models.Model):
currency_code = picking.sale_id.currency_id.name
shipment_info = {
'require_invoice': picking._should_generate_commercial_invoice(),
'require_invoice': (self.ups_rest_documentation_type != 'none') and picking._should_generate_commercial_invoice(),
'invoice_date': fields.Date.today().strftime('%Y%m%d'),
'description': picking.origin or picking.name,
'total_qty': sum(sml.quantity for sml in picking.move_line_ids),

View File

@@ -7,5 +7,8 @@ class ResPartner(models.Model):
property_ups_carrier_account = fields.Char(
string="UPS Account Number",
company_dependent=True,
help="UPS carrier account number for bill-my-account shipping.",
help="The customer's own UPS account number. Stored on the customer and "
"recalled automatically when you ship to them with a UPS carrier that "
"has \"Bill recipient's UPS account\" enabled -- UPS then bills this "
"account for the shipping (UPS 'Bill Receiver') instead of yours.",
)

View File

@@ -120,6 +120,8 @@
<field name="ups_require_signature"/>
<field name="ups_duty_payment" string="Duties paid by"
required="delivery_type == 'fusion_ups_rest'"/>
<field name="ups_rest_documentation_type"
required="delivery_type == 'fusion_ups_rest'"/>
</group>
</group>
</group>