Mint-System / Odoo-Apps-Sale-Workflow

Collection of sale model related modules.
2 stars 3 forks source link

feat: upgrade the module and it's dependency, add test instructions #10

Closed laszlokr closed 4 months ago

laszlokr commented 4 months ago

@janikvonrotz this module depended on sale_order_contact_person module, which was deprecated, so I have changed the dependency to sale_order_sale_partner module that replaced it. I had to resolve inconsistencies between the modules, maybe it makes sense to rename sale_blanket_order_contact_person to sale_blanket_order_sale_partner.

When installing the module, there was also an error from the sale_order_sale_partner module, so I refactored the model. Her is the relevant part of the error message:

  File "/home/laszlokr/work/mintsystem/Odoo-Build/addons/sale_workflow/sale_order_sale_partner/models/sale_order.py", line 24, in _compute_partner_sale_id
    self.partner_id.address_get(["sale"])
  File "/home/laszlokr/work/mintsystem/Odoo-Build/odoo/odoo/addons/base/models/res_partner.py", line 1024, in address_get
    default = result.get('contact', self.id or False)
                                    ^^^^^^^
  File "/home/laszlokr/work/mintsystem/Odoo-Build/odoo/odoo/fields.py", line 5092, in __get__
    raise ValueError("Expected singleton: %s" % record)
ValueError: Expected singleton: res.partner(11, 10, 12, 15, 8)

I also added test instructions to sale_order_sale_partner and technically submit the upgrade of both modules in this PR. Please let me know if you want to have sale_order_sale_partner changes as a separate PR.