Skip to content

Commit

Permalink
[MIG] account_brand: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
RicardCForgeFlow committed Mar 11, 2024
1 parent e264c02 commit b90df1a
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 15 deletions.
2 changes: 1 addition & 1 deletion account_brand/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{
"name": "Account Brand",
"summary": "Send branded invoices and refunds",
"version": "16.0.1.0.0",
"version": "17.0.1.0.0",
"category": "Accounting Management",
"website": "https://github.com/OCA/brand",
"author": "Open Source Integrators,"
Expand Down
11 changes: 2 additions & 9 deletions account_brand/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,7 @@ class AccountMove(models.Model):
_name = "account.move"
_inherit = ["account.move", "res.brand.mixin"]

brand_id = fields.Many2one(
states={
"open": [("readonly", True)],
"in_payment": [("readonly", True)],
"paid": [("readonly", True)],
"cancel": [("readonly", True)],
}
)
brand_id = fields.Many2one()

def _is_brand_required(self):
self.ensure_one()
Expand Down Expand Up @@ -59,7 +52,7 @@ def _onchange_partner_id(self):
account_id = rec_account
if account_id:
self.line_ids.filtered(
lambda l, a=account_id: l.account_id.account_type
lambda line, a=account_id: line.account_id.account_type
== a.account_type
).update({"account_id": account_id.id})
return res
1 change: 0 additions & 1 deletion account_brand/static/description/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
Expand Down
4 changes: 2 additions & 2 deletions account_brand/tests/test_account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class TestAccountMove(TransactionCase):
def setUp(self):
super(TestAccountMove, self).setUp()
super().setUp()
self.product = self.env.ref("product.product_product_4")
self.account_receivable = self.env["account.account"].create(
{
Expand Down Expand Up @@ -63,7 +63,7 @@ def setUp(self):

def _get_receivable_account(self, move):
return self.move.line_ids.filtered(
lambda l: l.account_id.account_type == "asset_receivable"
lambda line: line.account_id.account_type == "asset_receivable"
).account_id

def test_on_change_partner_id(self):
Expand Down
2 changes: 1 addition & 1 deletion account_brand/tests/test_brand_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

class TestBrandMixin(TransactionCase):
def setUp(self):
super(TestBrandMixin, self).setUp()
super().setUp()
self.partner = self.env.user.partner_id
self.company = self.env.user.company_id
self.other_company = self.env["res.company"].create(
Expand Down
3 changes: 2 additions & 1 deletion account_brand/views/account_move_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
<field name="partner_id" position="after">
<field
name="brand_id"
attrs="{'invisible': [('move_type', 'not in', ('out_invoice', 'out_refund', 'in_invoice', 'in_refund', 'out_receipt', 'in_receipt'))], 'readonly': [('state', '!=', 'draft')]}"
invisible="move_type not in ['out_invoice', 'out_refund', 'in_invoice', 'in_refund', 'out_receipt', 'in_receipt']"
readonly="state != 'draft'"
/>
</field>
</field>
Expand Down

0 comments on commit b90df1a

Please sign in to comment.